mpogue2 / SquareDesk

Fully-featured music player and sequence designer, designed for square dance callers
10 stars 4 forks source link

Feature: half/automatic session detection #961

Open Gero5 opened 11 months ago

Gero5 commented 11 months ago

Here is my basic idea how that could work:

maybe instead of the checkbox define detection modes

mpogue2 commented 11 months ago

@danlyke This is your wheelhouse!

danlyke commented 11 months ago

Hmmm... trying to figure out the intent here.

It looks like this is a way to leave SquareDesk running and automatically switch away? I've been reluctant to pursue too much automatic setting, because it starts to get weird in conjunction with manually setting sessions. Like if I set a session, then we pass a time boundary, do I remember that I set a session? Override it?

I haven't done an "until" time because I didn't know what to do with overlap, but I guess we'd go for "on startup, select the latest start time in which there's an end time", and if you start in one not switch sessions until the end time for that session has passed?

I guess I could see doing this with the "always/ask/no" option, though it feels like a lot of user complexity. I guess this needs to be configurable per session. Message ID: @.***>

Gero5 commented 11 months ago

I think "manual" would be the better phrasing for "no".

Gero5 commented 11 months ago

Hmmm... trying to figure out the intent here.

Well, I wanted to set a session several times, but I always forgot to do that. the computer knows weekday and time. that is why I thought it could be helpful.

Ah! I just discovered that in the pref/session tab there is a "set session at startup" option that I did not know of so far. the way you are commenting @danlyke makes much more sense now. give me hint next time please. I am just a hapless user. :-)

So if on the preference tab there is a session "Saturday" for Saturday / 8pm and I startup SquareDesk after 8pm it will set the session to "Saturday", right? what happens if I start squaredesk at 7pm? only the other option defines the first entry as default. but I guess it is the same? so there is an implicit time frame that goes until midnight?

I assumed that the weekday and time was just a note with no use for automatic session setting at all. I think that is pretty close to cover the use cases that I had in mind with the proposal above.

danlyke commented 11 months ago

Grin. One of the problems with implementing features for myself is that I know where to find the option. Would it help to move that "set session at startup" to the top?

And yes: it's an implicit "until midnight". If you have multiples on the same day, it sets to the latest that's before the current time. I agree that something more than startup could be cool, on the other hand I also think regular restarts are good for you, even if Mike is spending time getting the memory leaks fixed.

So I think the two missing features that we've discussed in this thread are:

  1. An end time of some sort, this would let it automatically switch to the default session if you started up after that time, but would add an extra row and extra complexity to the configuration.
  2. Something that associated a session with a playlist. I'm not using a playlists much, so I can't speak to this, but I could see the appeal.

If anyone thinks #2 is worth pursuing, it's definitely something we could consider. I haven't looked at playlist formats, but maybe the Playlist menu gets an "associate current session with playlist" option (and a "remove current session from playlist", for completeness)? Or maybe this is just extraneous complexity... Message ID: @.***>

Gero5 commented 11 months ago

Funny enough, the alternative easier implementation I had in mind was a "ask for session at startup per dialog". So the current feature is exactly between the two.

Would it help to move that "set session at startup" to the top?

Yes. I think it would be less likely be overlooked. And I thought if a ON/OFF switch for "automatically set session at startup" would make it clearer as well. "default to first session" (at startup) is always the case, isn't it?

  1. end time

for all evening dances/ club nights midnight works well enough, I think. I could think of callers out there that have club dances at Saturday 10am, but wait until they show up.

  1. Something that associated a session with a playlist.

I still try to figure out what the advantage of that would be.

mpogue2 commented 11 months ago

Something that associated a session with a playlist. I still try to figure out what the advantage of that would be.

This is probably my primary use case for sessions. I create a playlist before each dance, and they are named like this "Jokers_2023.11.10.csv". The club name is "Rockin' Jokers". I currently maintain (by hand) a list of every song that I've called for them. I can't use the sessions mechanism, because I call for Jokers on most Wednesday nights, but also some Saturday and Sunday afternoons. I don't want to have to remember to manually set the Session ID every time I start calling.

So, something like [X] Automatic session based on playlist name might work well for me. Whenever a song from a playlist is loaded, strip off everything before the first '_' and use that as the session key. That would get me 95% there.

The other 5% is that I often play music for testing and for gathering while people talk just BEFORE the dance starts. I don't want that music to count towards official playback in a session, unless I continue that song into the first tip and use it for patter after the dance officially starts (I use it as the first patter about 25-50% of the time).

I'd love to have some mechanism for both of these, because I'm tired of tracking song usage manually. (I do that with Export Song History, I cut out the songs I didn't really "use", and I append to a file. I have an external program that creates a list of "patters I haven't used ever yet with this club", "patters by last-used date at this club", and two similar files for singing calls. I use those to plan the next playlist for the next dance at each club.

Gero5 commented 11 months ago

Since I had 40 dances this year at 19 different clubs I kind of have the same problem. no regular basis in my case and I use the play history for a specific date and timeframe as well usually to look at what I called the last clubnight.

playlist before each dance, and they are named like this "Jokers_2023.11.10.csv".

Mine are the other way round "2023-10-02 Desperados.csv". Because of the palettes I use one for singers and one for patter music. "2023-10-02 Patt Desperados.csv". "2023-10-02 Sing Desperados.csv". Naming problems can be solved.

I am a bit worried that typos would be a thing that causes irritation or unwanted results: "2023-11-02 Desperados Squares.csv". "2023-12-02 Dseperados.csv".

The palettes have to be given a thought. What if the user has loaded three playlists with three different names?

I often play music for testing and for gathering while people talk just BEFORE the dance starts.

so we are back to the timeframe? And important to know: do you pick that music from your session named playlist?

unless I continue that song into the first tip and use it for patter

If I get that right... Now it gets really tricky. You want the computer to detect that the same music that has been played the same way turns into session music because something outside happens e. g. you start to call? That would be a very very smart system, maybe too smart for me. SquareDesk asks me for permission to use the microphone. I guess the "caller in business" detection is already implemented. ;-)

mpogue2 commented 11 months ago

The palettes have to be given a thought. What if the user has loaded three playlists with three different names?

I thought about this. The was-played-in-Session would be the playlist that I double clicked on to load the song. In my case, if I had Jokers_2023.11.10 in palette slot #1, and I double-clicking or used ENTER to load a song from that slot, the playback would be recorded for session "Jokers".

In your case, you have TWO palette entries per club. But, if you named them consistently, double-clicking or ENTER in either "2023-10-02 Patt Desperados.csv" or "2023-10-02 Sing Desperados.csv" would be recorded as "Desperados", which I think is what you want!

I am a bit worried that typos would be a thing that causes irritation or unwanted results

Yes, but this is also easily fixed. It would probably also be detectable if we did one or both of the following:

so we are back to the timeframe?

That's still an open issue. It's only 5% of the issue for me, though! I'd be happy solving the 95%!

do you pick that music from your session named playlist?

Yes, I always do. If in the middle of a dance I pick something (like say Happy Birthday) from the main songTable, I always add it to the playlist and double-click from there. In the new scheme, I'd need to remember to double-click on the playlist version, not the songTable version, but I can live with that...

mpogue2 commented 11 months ago

SquareDesk asks me for permission to use the microphone

That's probably a bug leftover from when we did voice recognition for SD. That has been removed, and so the permission should not be requested of the user. I'll open a ticket on that.

You want the computer to detect that the same music that has been played the same way turns into session music because something outside happens e. g. you start to call?

Not exactly. If I play "Bad Guy" at 5:55 for 7 minutes (ending beyond the start of the Jokers dance), that's testing and while-chatting music. I don't want this to count as a "session playback". But, when I start it up after 6PM (the dance start time) and play for more than a few minutes (say >3 mins), then I'm definitely using it for Patter in the first tip.

Right now, we record CALLER_PRESSED_PLAY time, but not duration_of_play time or STOP time, so we can't be any smarter about this yet.

Note: I am also OK with some false positives (SquareDesk thinks I played a song for Jokers dancing, but I didn't) and some false negatives (SquareDesk didn't notice that I played a song for Jokers dancing). I'd like the number of those to be <1%, but I can tolerate a few on occasion.

danlyke commented 11 months ago

This may be muddying the waters a bit, but I have occasionally used SQLite on the command line to change play history, and I have occasionally thought about a play history dialog box that'd give you the song history as a table, let you select rows, and change the session.

I think that with Qt's SQLite bindings this would actually be pretty simple.

That would help me with Mike's "I'm playing stuff before-hand to figure out what I'm gonna call" situation, and the "I restarted SquareDesk during the dance and forgot to reset the session" scenario, and the "I just plain forgot".

mpogue2 commented 11 months ago

@danlyke That would also work for me for associating songs with sessions in the first place, perhaps before we make it more automatic. And, it doubles as a "automatic assignment to a session got it wrong" mechanism, even once we have it more automatic.

For the datetime field, if it's Day of Week (regenerated from the timestamp) and LocalTime, that would get me about 80% of the way to what I was hoping for!

ANOTHER WAY? Another way to do it could be to provide an updated "Export Play History...", which be the same as what we have now, but would add a new exported column in the CSV file for "SessionName". That would allow me to edit in Excel or LibreOffice (e.g. to find all of the Jokers dances in the entire history programmatically, because I can write this in Excel!). Then, a new "Import Session Names from Play History..." could slurp in that modified CSV file and update just the new Sessions column in the sqlite DB (I don't think we necessarily want to replace data in all the other Song History columns).

ADV:

DIS:

mpogue2 commented 9 months ago

Time to look at this one again, I think...in the context of #1047....

I am inclined to:

For me, it allows me to set sessions automatically for the two clubs that I call regularly for:

And, if I call for Jokers on a weekend, I can always manually select "Jokers" as a temporary session. (Maybe it could automatically switch out of Jokers and back to Practice at the end of the day?).

In this method, I'd personally be covered by the correct session about 99% of the time (which I think is good).

It might also be interesting to consider (in the context of #1047) a preference that auto-sets the starting date time for "played recently" to "6 months ago", etc. which is my target for reusing songs with Jokers right now.

danlyke commented 9 months ago

How about an "automatic" option that sets based on playback time (with end times), and if you set it specifically it stays set? Maybe both "automatic" and the detected session are checked then? Message ID: @.***>

mpogue2 commented 9 months ago

@danlyke Yes, I'm thinking something like change the dropdown to say:

..where exactly one of those is [X] checked.

danlyke commented 9 months ago

That makes sense to me. Maybe we can use the mixed state identifier (not sure what QT is gonna call it, Cocoa calls it NSMixedState) to call out the current session under the "Manual" section, or maybe we put it in a display somewhere?

mpogue2 commented 9 months ago

@danlyke I'm thinking that the Automatic choice needs to choose once a minute which session to use. And that choice would be mutually-exclusive with the manual override options.

So, for example:

mpogue2 commented 9 months ago

See also #1047, which is a redefinition of what "played" means, and it's in the context of sessions.

I am hopeful that with these changes (redefinition of "played" AND changing automatic mode as per above):

danlyke commented 9 months ago

I think we're on the same page, except that I'd like an indicator of the current session. I was thinking it'd be the tri-state setting on the automatically chosen session in that menu, but I am also okay with something on the main window.

I don't think it needs to be at the beginning of every minute, I think at the point where we record session-dependent stuff is fine. Or report session dependent stuff (like if we keep the call lists, or if the choreography is session dependent).

And, yes, I like the rest of your suggestions.

mpogue2 commented 9 months ago

@danlyke Oh, I forget that we have the Session names as checkable in the Session menu!

mpogue2 commented 9 months ago

Commit: 6599bd88ec7cfe90ec72478acde86374a1240965

Sessions are now set dynamically (updated once per minute) according to the user preferences > Settings tab. They no longer are fixed at whatever they were at SquareDesk start. Also, sessions start AT the time specified, rather than 1 minute afterwards (this was a simple bug to fix). And, if the preference is set to "Default to first session" AND the user has deleted some sessions in the past, it now correctly sets the Session to the first non-deleted session ID (row number in the sessions table).

NOTE: Manually setting a Session in the Sessions menu doesn't work correctly right now. I gotta think about how that menu is used both for telling the user which Session is active, AND allowing them to set it manually (even when automatic setting is ON). I'm thinking something like:

This still seems a little weird to me, because if they are greyed out, there's no way to tell that it's in Automatic mode. Perhaps we should have a checkbox in the Sessions menu called "Automatic" instead of putting this in the Prefs dialog? That would get rid of the "set default to the first one at startup time", I guess. Hmmm.....

mpogue2 commented 9 months ago

Question: what does a day-of-week "<none>" mean? It doesn't seem to mean "any day of the week", it literally will never be chosen in Automatic mode right now, because the current day is never zero.

Should we change this to mean "any day of the week"? Maybe not...

mpogue2 commented 9 months ago

Commit: 3c0aa7970fcb5e0d3ef5366d990b42c68556f53b Clarified what now happens when in automatic mode vs manual (Practice) mode. Minor changes to column headers to clarify their use.

mpogue2 commented 9 months ago

Commit: 91b8db8d9f9706ce443354167e8302b3cdb1393e

OK, I think I did this in a way that makes sense.

mpogue2 commented 9 months ago

This feature is now complete for now.