Autostop and Skipping

1.0 Introduction

Giocoso has no real play controls to speak of (by design, I hasten to add!) You cannot pause, rewind or fast-forward through playback, for example. You don't pause a concerto in mid-movement at the concert hall, do you? Right: Giocoso follows that exact same model of play. Once started, you listen until the end 🙂 This remains true in Giocoso Version 2: you still cannot pause playback.

Of course, you can stop play in Giocoso: simply press Ctrl+C and playback will be terminated immediately. There might be a couple of seconds of music that continue to play from data that's been buffered already, but generally termination of playback is pretty much instantaneous. Bear in mind that a play that is terminated by Ctrl+C is regarded as never having happened at all. There will thus be no record of it having taken place in Giocoso's destination database (assuming there is one); it won't get scrobbled to (even if scrobbling was configured and asked for); and the composer of the interrupted piece won't be subject to a time-bar, since Giocoso doesn't recognise him (or her) as having been played to any degree... even if you were 3 hours 15 minutes in to a 3 hour 16 minute-long opera! Giocoso will terminate cleanly when it has played to the end of the last possible 'selection' it has been asked to play (i.e., whatever number of recordings was requested by use of the --selections=n runtime parameter). There can be anything between 1 and 99 selections specified, with the default being 1 -meaning that by default, Giocoso will play a single piece of music and then quit cleanly.

The --pause=n runtime parameter specifies a number of seconds which Giocoso will wait before playing the next selection. It is meant to give you a break between otherwise-continuous plays of recordings. The number of seconds can be anything you like (that is, there's no limit on what you can set it to, provided it's not a negative number), but defaults to 10 seconds. An invalid parameter value (such as "-99" or "ABC") will be interpreted as 10 seconds anyway.

Giocoso has had an 'autostop' feature since Version 1, and it fundamentally doesn't work any differently in Version 2 than it did back then. It allows a second Giocoso session to tell the main, 'playing session' to continue playing its current recording until it reaches its natural end, but then to play no further music. This is handy when you've launched Giocoso with --selections=9 (for example), meaning that you want 9 recordings played one after the other in one sitting, but then realise you need to nip out to the shops with 2 minutes of the 3rd successive play left to go. If you merely stopped playback by pressing Ctrl+C in the main playing session, you would certainly stop music playback almost immediately -but then that 3rd recording you had almost completely listened to would not get recorded in Giocoso's database as having been played at all, which might seem a bit harsh! So, you can open a second terminal, type the command giocoso --autostop and the main playing session will allow the 3rd recording to complete naturally, permitting it to be recorded as a 'play' in the database. However, the 4th and subsequent plays will not start at all -so, you won't be missing any music whilst out on your shopping trip.

Skipping recordings is an entirely new feature in Giocoso Version 2. It allows a second Giocoso session to tell the main playing session, by using the command giocoso --skip that the randomly-selected current track is not to your taste or current mood, so please skip it and move on to the next possible selection. The main playing session will respond to the message by almost immediately killing playback of the current recording and then, after a slight pause to allow buffered music to clear, will resume playback of an entirely new recording, selected at random. You can skip that one too, if you're still not entirely happy with it. Skipping a recording only makes sense when the main playing session was launched with --selections greater than 1, since the skip 'consumes' one of the selections. If you originally ran Giocoso with --selections=5, for example, and you are listening to the 5th randomly-selected recording, then running giocoso --skip in a second terminal session will mean the last possible selection has been played and the skip will in fact trigger the complete halt of the main Giocoso session. If, however, you were listening to the 3rd of the 5 possible selections, then the skip request will 'consume' the third selection and the main playing session will start playing the 4th selection, after which it will play the 5th one, sequentially, before finally quitting.

A skipped playback is never recorded in the Giocoso database, nor is it scrobbled to By skipping it, you've basically agreed that you never actually listened to it in full, so you can't then claim it as a successful 'listen'!

In the next few paragraphs, I'll walk you through these two useful features in turn.

2.0 Autostop

We start with a standard Giocoso session running at the top of my screen, with album art being displayed below it, entirely normally. You'll note that I've launched Giocoso with --selections=9, which you can tell because in the top part of the main Giocoso display, we see the message 'Selection: 01 of 09 selections'. So this bit of Scarlatti is the first of my nine requested recordings to be played:


You can also see that this Scarlatti is not due to finish playing until around 8.36pm: the 'Ending in...' line at the bottom of the main screen tells us this (pretty accurately). In this screenshot, too, I've opened a second terminal session and have typed into it (but not yet submitted) the command:

giocoso --autostop

The command takes no further arguments. There's no need to specify dbname, or anything else. Just '--autostop' all by itself. When I submit that command, "things" happen:

The first thing you'll notice, perhaps is that the smaller terminal window is now displaying a message saying that 'Autostop is enabled' and that 'playback will conclude at the end of the currently-playing piece'. So, at least you know that Giocoso has responded to the command... but what else has happened as a consequence?

Well, look at the main playing window: it's still playing! There's still 14 minutes of play time left to go; we're still expecting playback to end at about 8.36pm; the countdown timer is still ticking down, and the album art is still being displayed. As far as the playback of the currently-playing Scarlatti recording, therefore, the autostop has done precisely nothing, very much. But that it has done something is revealed by the bit of blue text that has appeared on the bottom bit of text (the 'footer') of the main program window: 'Autostop' there tells us that an Autostop request was submitted by a secondary Giocoso session and this primary, playing session has received it and knows all about it.

In other words, as the yellow text in the smaller terminal window spells out: the autostop request will only take practical effect when the Scarlatti reaches its natural conclusion. Playback won't proceed to the 2nd, 3rd and 4th and so on selections I originally asked for, but this first one is going to be allowed to complete.

Here's what the main playing session will look like once that first selection does reach its natural end:

You'll get a clear message that 'playback finished early, because of an Autostop request' -but you'll also note that the recording just played has been stored in the Giocoso database properly and, if scrobbling was requested, then will know about it too. The recording finished naturally: that you were not, perhaps, around to hear its final few minutes is a bit, er, tricky as far as Giocoso's general philosophy of how to listen to classical music goes... but it's a tolerant program and figures it was probably close enough to the end of the currently-playing piece that it mostly 'counts'!

The point is that Autostop doesn't affect the currently-playing recording at all. It only stops other recordings from being played after the current one.

Incidentally, the --autostop parameter is really a kind of toggle switch. Run Giocoso with it once and you'll be told Autostop has been enabled:

But run the exact same command again, immediately afterwards, and you'll see this message instead:

This time, the message is 'Autostop disabled: playback will continue as normal'. One --autostop enables autostop; a second --autostop disables it; and a third would re-enable it, and so on. Each new --autostop issued before playback actually stops reverses the effect of the one before it. If you manage to get back from the shops before the long Scarlatti recording has actually finished, therefore, you can re-instate the playback of your originally-requested nine selections by re-issuing the autostop request and thereby reverse the effect of the first one.

If you interrupt playback with Ctrl+C, by the way, you immediately kill off the current playback and wipe all record of any outstanding autostop requests. Ctrl+C always takes effect immediately, prevents scrobbling and recording of the play in the database, and clears out the state of the autostop message queue.

3.0 Skip

Whereas autostop affects only future plays, the --skip runtime parameter will immediately halt the playback of the currently-playing recording; if there are unused 'selections' left, then Giocoso will move on to playing the next randomly-selected recording, continuing to play it and any subsequent selections as if nothing had ever happened. The skipped recording will not count as a 'played' recording: no record of it in Giocoso's database will be made; nothing of it will be scrobbled to All subsequent plays, if allowed to complete normally, however, will be recorded in the database and scrobbled (assuming you do scrobbling in the first place, of course).

By way of demonstration, let's start with this situation:

It's about 9.15AM by the clock; a long piece of Purcell realizations has just started playing, the first of 9 possible selections of music... and I've just realised that an hour-and-a-quarter of Purcell is pushing my boundaries for the day! I therefore prepare a new Giocoso command in the smaller terminal window:

The command is simply giocoso --skip. There are no other parameters to specify; nothing extra to say. The moment I press [Enter] to submit that command, this happens:

It's still approximately the same clock-time as before (give or take the few minutes it takes me grab appropriate screenshots!). The smaller terminal window is clear: the command was submitted and processed and the terminal cleared of all textual input (Giocoso likes to keep things tidy whenever possible!)

For the rest of the screen: the album art has changed, giving us the first visual clue that Henry Purcell is no longer playing. Closer inspection of the main Giocoso window reveals, indeed, that I'm now on to the 2nd of my nine possible music selections, and instead of something by Purcell, I'm now a few seconds in to listening to some Mahler (and some might say, 'from the frying pan into the fire!).

I'm not entirely sure Mahler is what my ears crave today, either: so I can re-issue the -skip command in the secondary window, and keep re-issuing it as often as Giocoso keeps picking music I don't fancy listening to. As I do so, if I'm really quick, I might notice this down near the bottom of the main, playing, window:

That is to say, whenever a skip message is processed, the main playing window always waits 3 seconds before starting playback of something new. You can't change or alter that wait period, by the way: it's needed to ensure the audio data buffer is fully flushed before trying to fill it with fresh data from a new recording.

If I keep on repeatedly skipping, I'll eventually end up in this state:

Again, the clock tells you that this has all happened within the space of about 5 minutes, but you'll note that I'm now on the 9th of my nine possible selections... so I've obviously skipped through the previous eight in pretty swift fashion! What happens when I issue the giocoso --skip command once more? Well, this:

There's no album art at all showing... so that's your first clue! The second clue is the text at the bottom of the main Giocoso window: "Playback Finished!". When you are on your last playback 'cycle' of selections and ask to skip it... there's nowhere else to go, except to quit Giocoso completely. You'll note that, on the way out, Giocoso has thoughtfully reminded you that nothing has been scrobbled of this 9th play, because it was interrupted. There's also no message you'd normally see about 'Recording play in the database'... because, having been interrupted, there was no play!

4.0 Skip & Autostop Interaction

As we saw above, once you submit an autostop message, it remains 'sent', unless you repeat the autostop command to send what amounts to a cancellation message. That is autostop toggles between 'enforce a stop' and 'revert to normal'. If you are in the 'enforce a stop' mode and then send a skip message, you will trigger the autostop termination of all music playback.

That is: say you are playing the 1st of 9 selections. You issue an --autostop command. Nothing much happens, because an autostop only takes effect at the end of the playback of the 1st music selection.

So, the 1st selection is happily playing away, with autostop set. Now you issue a --skip command. That immediately terminates the playback of the 1st music selection... but it doesn't mean the 2nd selection starts, because at this point the autostop kicks in and terminates all further playback. If Giocoso has no further music to play (whether because it's playing the 9th of 9 selections, or because autostop is set), then a skip message will always trigger the complete end of playback.

And just to finish the story: you're playing selection 1 of 9; you issue an autostop; selection 1 keeps playing. Now you issue another autostop: that has the effect of reversing the previous autostop, so you get the message about 'playback will continue as normal'. At this point, you issue a skip command: and Giocoso will immediately start playing the 2nd of 9 selections. Because you lifted the autostop before issuing the skip, Giocoso has more music it can play, so the skip command merely pushes it on to playing it.

5.0 Conclusion

Summing up:

  • Both --autostop and --skip are examples of 'messaging parameters'. That is, they are sent from a secondary terminal session by running a short Giocoso command to the main, playing Giocoso session. The main session then alters its normal behaviour in response to the messages received.
  • Autostop affects nothing currently playing, but stops subsequent play selections from being made
  • Since Autostop allows currently-playing recordings to play to completion, the play is recorded in the Giocoso database and scrobbled to (if requested by the --scrobble parameter)
  • Skip kills the currently-playing recording completely and immediately, but allows Giocoso to continue playing subsequent play selections, if there are any left
  • A recording that is skipped is deemed never to have been played back at all, so it's not recorded in the Giocoso database nor scrobbled, even if the --scrobble parameter says scrobbling should ordinarily take place

These are probably not pieces of functionality you'll use every day; and whilst --autostop honours the Giocoso 'philosophy' of taking classical music seriously and not interrupting things on a whim, --skip definitely does not! That said, I think both features provide useful extra capabilities that come in handy from time to time.

[Back to Front Page]|[Appearance Runtime Parameters]