Giocoso 3 - The Control Menu

The general 'philosophy' of Giocoso is that listening to classical music is a pleasure -but that it's a pleasure to be taken seriously. That's why Giocoso doesn't 'do' tracks: you don't listen to mere parts of whole compositions in the concert hall (on the whole), so you shouldn't be doing that in your music listening room at home, either. It's also why Giocoso doesn't encourage you to skip through recordings; or repeat them; or pause them: if you don't do it in public, you shouldn't be getting into the habit of doing those things in private, either.

That said, listening to a twenty minute symphony without pause or break is one thing; but even the most devout classical music fan is going to struggle listening through 4 hours of Götterdämmerung without a break every now and then! So... yes, somewhat belatedly, Giocoso acquired 'controls' that allow you to pause, resume, repeat and stop playback. These controls are exercised by using the Control menu in one Giocoso session that isn't itself playing music: they send messages to another Giocoso session that is, which then responds appropriately. You can then shut the controlling session down once the control command has been issued.

It is functionally impossible for two music-playing Giocoso sessions to be running simultaneously (the cacophony resulting from that would be awful!), so although Giocoso usually opens automatically on the Play menu, when an already-playing session exists, the second session will open automatically on the Control menu instead. It's a visual reminder, if you needed it, that the second session is there only to send control messages to the first.

The Controls

Most of the controls on this menu are, I think, self-explanatory in function, so I won't dwell on them in detail. I will just quickly point out their intended function, however:

Autostop: If you launch Giocoso with the 'Number of plays per cycle' Persistent Configuration parameter set to (say) 10, but after the 2nd recording you need a break, you can send the autostop message to the playing session. It tells the playing session to complete the recording it's already playing, but not to start any new play after that. The currently-playing recording thus completes normally and will be recorded in the Giocoso database as a successful 'play'.

Terminate: If you send this control message to a playing Giocoso session, it will immediately cease playback of the currently-playing recording and will not attempt to play anything else subsequently. No attempt to complete the playback is made: the music just stops abruptly. A terminated play thus hasn't completed successfully and is therefore not recorded in Giocoso's database as a play at all: you don't get partial brownie points for almost-finishing listening to something!

Skip: This control message tells a playing Giocoso session to immediately cease playback of the currently-playing recording, but to then pick something new to play afterwards (assuming that 'plays per cycle' is set to a number higher than 1 and that 'unused' plays in that cycle exist). A skipped recording doesn't count as a successful play, so isn't recorded in Giocoso's database. A skipped recording also 'consumes' one of the plays in a cycle. If you've said, 'play 10 recordings one after the other' (by setting 'Number of plays per cycle' to 10) and you're currently on play number 4 in that cycle... then a skip command stops the 4th playback and triggers Giocoso to start playing the 5th. If you were on play number 10 and issued a skip, then as there is no 11th play to be had in a cycle, all playback ceases when this 10th recording is stopped in its tracks.

Repeat: This control message tells a playing Giocoso session to repeat the currently-playing recording once it has reached its natural conclusion. Nothing about the current play is interrupted or altered in any way; once it has finished, however, the same recording will get played again, in its entirety, from beginning to end. If you are in a 10-play cycle, however, and request the 10th recording to be played again, the repeat will not happen, because that would be an 11th play in the cycle: there have to be spare 'plays' to accommodate the repeat, basically. Repeated plays are recorded in the database.

Pause/Resume: This message tells a playing Giocoso session to immediately pause the recording it's playing. If a recording has already been paused, however, then the message is interpreted as an instruction to resume playback (from the precise moment where playback had previously reached).

ALSA Volume Control: This is distinct from the other menu options, in that it merely gives access to an external utility which should (but might not!) allow you to control the audio volume on your system. See below for more details.

Autostop, Repeat and Pause/Resume are all toggle commands. That is, you can send them once to initiate some action in a playing Giocoso session -but, so long as you do it swiftly enough, you can also send the same message again to reverse the earlier command. This is explicitly true of pause/resume: one press of menu Option 5 triggers playback pause; a second press of the same option reverses that; a third press would re-initiate a pause and so on, ad infinitum. It is also true of the other commands mentioned: a request to stop all playback after the present recording ends (i.e., an Autostop) can be reversed by sending another Autostop request; likewise, a request to repeat the currently-playing recording can be revoked by sending the same request a second time.

The music playing Giocoso session will display a message showing the current state of play for any of these toggles. For example, when a second session issues an Autostop request, this appears in the playing session:

The 'Autostop Applied' message under the album art tells you 'I've received the Autostop request'. Issue the same command again:

...and the 'Autostop Applied' message disappears. The sending session can also see whether the relevant toggle is on or off:

When an Autostop command is first sent, the sending session sees the 'Autostop message sent' indicator, for about 3 seconds after the menu option has been taken. Take the same menu option again, however, and the indicator changes to:

Equivalent 'sent/rescinded' messages appear for the other toggle options. There is no limit to how many times you can send/rescind a control message, other than the fact that they all have to be sent and rescinded before the playback of the currently-playing recording reaches its natural conclusion. That is, were you to say 'Repeat', then 'Rescind', then playback of that recording ends, the next 'Repeat' message you send is effectively a new one: please repeat the new recording, not the previous one.

By definition, the terminate and skip instructions are not toggle options: they have a direct and immediate consequence for the playing session and thus cannot be revoked or rescinded.

Run-time Equivalents

It may seem a bit excessive to have to spin up an entire Giocoso session merely in order to tell another session to pause or resume! Accordingly, you don't have to. Instead, you can invoke Giocoso with a number of runtime parameters which achieve the same things as the Control menu options, but without triggering a full-on running Giocoso session.

The parameters are, somewhat unsurprisingly perhaps:

  • --autostop
  • --pause
  • --skip
  • --terminate
  • --repeat

You add the required parameter to the end of the basic command giocoso issued in a briefly-opened terminal session. For example:

Here you see me running Giocoso and playing some Monteverdi in a background window: I've opened a new terminal in front and issued the command giocoso --autostop: my foreground session responds as you'd expect Giocoso proper to, with a 'message sent' confirmation. The background playing session has also responded correctly, with an 'Autostop Applied' confirmation message. After the requisite couple of seconds, the foreground session will simply return to a command prompt and can be closed, without ever running the full-on Giocoso program interface. The same sort of thing works in much the same way for all the runtime parameters.

Shortcuts and Keybindings

Taking this one step further: given this is Linux, you can always assign an alias to a command, whatever that command might be. Thus, if I add the line alias ga="giocoso --autostop" and then re-login so that the change gets picked up and applied, I could open a new terminal session and just type the command 'ga' to achieve an autostop. Different aliases are possible for this and the other control commands, too! Issuing an alias command still requires you have access to a new terminal session, of course.

It is not too tricky, however, to then think of how to extend this functionality further: a tool such as xbindkeys, for example, can be used to assign the key press sequence Alt+Shift+a to the command giocoso --autostop ...and thus by mere key press combinations achieve control of a playing Giocoso session without needing to open a new terminal session manually beforehand at all. For example, having installed xbindkeys, I can issue the command:

cd
nano .xbindkeysrc

Add in the following lines:

"giocoso --autostop"
Shift+Alt+Mod2 + a

"giocoso --terminate"
Shift+Alt+Mod2 + t

"giocoso --pause"
Shift+Alt+Mod2 + p

Save the modified file and run the command:

xbindkeys

...and now I can pause/resume by simply typing Alt+Shift+p, or terminate by typing Alt+Shift+t, autostop with an Alt+Shift+a... and so on. I need to ensure xbindkeys runs at each startup thereafter, but that's not too difficult to do these days, either (using KDE, I stick the 'xbindkeys' command in the System Settings -> Autostart dialog, but other desktop environments have equivalent options!) There are equivalent alternatives to xbindkeys as well, of course... but exploration of those I'll leave as an exercise for the reader!

ALSA Volume Control

The last option on the Control Menu invokes the alsamixer utility, with which you can control the output volume levels used for each audio device detected on the system, assuming that your system is using ALSA as its sound server in the first place. If you're using Pipewire or other sound servers, it may not work at all.

Alsamixer controls one device at a time: you press F6 to obtain a list of all audio devices and select one. Once a device has been selected to be the 'active device', you can increase or decrease the volume of that device using the up- and down-arrow cursor keys.

As you know, of course, you tell Giocoso the audio device you want a music signal to be sent to by setting the 'Audio device to use as default output' parameter in the Persistent Configuration file, accessed via the Administration menu, Option 3. That parameter defaults to a default of, er... 'default': if that's still true for you, then taking this ALSA Volume Control menu option will cause alsamixer to open to the 'master channel' by default -which may or may not be the one you need to adjust the volume of, depending on your hardware specifics.

If you have set Giocoso's audio device parameter to something more specific than 'default', it will usually be to a named device in the format plughw:x,y ...and if that's what your Giocoso is set to, then taking the ALSA Volume Control menu option will cause alsamixer to open with the device with device index x set as the active channel (i.e., the first number after the 'plughw:' bit will be treated as though it were the device index). Again, that might or might not be the correct device to alter the volume of, depending on your specific circumstances.

If Giocoso opens alsamixer with the 'wrong' audio device set as active, for whatever reason, remember you can always press F6 to get a pop-up list of all devices, from which you can select the correct one instead.

Here is my current music room PC configuration, for example:

In the Administration menu Option 3, I've said 'plughw:2,0' is my audio device. So when I then take the Control menu Option 6, I see this:

That tells you that alsamixer has opened with the E30 'item' set as the active device. I happen to know that's correct: I play my music via a Topping E30 Digital-to-Analogue converter. So, I can increase that device's volume with the up-arrow:

...or lower it with the down-arrow:

But if I didn't know what 'E30' was, how would I know? Well, press F6:

The blue pop-up dialog lists all known audio devices on this PC: you can see most of them relate to audio output via assorted HDMI ports... definitely not something I'd want to control the volume of, since they're not what's plugged into my amplifier! However, if it turned out that starting with the 'E30' device was incorrect, I could just select one of the other devices  and up- and down-arrow for that device instead.

You quit out of the alsamixer interface by pressing the ESC ('escape') key: you should be returned to Giocoso's own Control menu.

Now, suppose you hadn't the faintest clue how to configure Giocoso to use the correct audio device:

Here, you see me having set the default audio device for Giocoso as 'plughw:62,0'. That will mean alsamixer would try to open with device '6' as the controlled device (Giocoso only passes the first character of the first device number to alsamixer, so 92 would be passed as '9' and so on)... but as no such device actually exists, that's going to get quite messy:

As you can see, alsamixer tries manfully to tell you that device 6 doesn't exist... but it's getting a bit cluttered on-screen at this point, because Giocoso cannot control the way alsamixer displays its messages. The Giocoso menu is actually working fine, despite appearances, so tapping 'c' at this point, for example, would re-display the Control menu and tidy up all the messy messages.

In short:

  • if your Giocoso default audio device is configured to 'default', alsamixer will open the 'master' audio channel, which may or may not allow you to set the volume correctly. Try pressing F6 and selecting another listed device and altering the volume of that if the master device is not what is needed.
  • if your Giocoso default audio device is correctly configured to a numbered plughw device, then alsamixer should open that device and volume control on it will probably work correctly, assuming you're using the ALSA sound server technology at all in the first place. Again, use the F6 trick to select another device if it doesn't seem to work.
  • if your Giocoso default audio device is incorrectly configured to mention a hardware device number that doesn't actually exist... then invoking alsamixer will result in an error and the Giocoso menu will appear a bit scrambled. Fix your Persistent Configuration file with Administration menu Option 3 before trying to get this ALSA Volume Control option working once more!

You can always adjust the volume using whatever standard controls your distro gives you, entirely outside of Giocoso's purview, of course: this menu option is only provided as a possible convenience, whereby volume can be achieved entirely within the context of Giocoso program operation. You don't have to use it if you don't want to, or if it's giving incorrect results.


[ User Manual Home ] | [ Play Music ] | [ Database Management ] | [ Reporting ] | [ Administration ] | [ Control ]