Giocoso-Quiz

1.0 Introducing Giocoso-Quiz

If you've been using Giocoso to play your well-organised collection of classical music FLAC files for a while, using a back-end database, then by now you'll probably have several hundred (if not thousand) 'plays' recorded in Giocoso's 'plays' table.

Theoretically, you were paying close attention to the music whilst it was playing... so if someone were now to play you a chunk of a piece of music you claim to have played previously, you should be able to recognise it, right? And you should be able to confidently say who its composer was, even if you're a bit vague on the specifics of the piece itself, right?!

It's actually harder to do than it sounds!

But it seemed to me a good way to spend an odd quarter-of-an-hour, so I've knocked together 'Giocoso-Quiz', a piece of software that will interrogate your Giocoso back-end database, randomly find something you've previously played, and freshly play a random chunk of it for you to identify the composer (and the actual piece name, if you're up to it). It's all just a bit of fun -and not to be taken seriously. But I've found that (a) it makes me want to concentrate more when I'm playing music for real, so I get better scores when I play the quiz subsequently; and (b) it is actually quite a good bit of fun to play the quiz with friends present. Slightly more interesting than playing Trivial Pursuit®, anyway!

2.0 Installing Giocoso-Quiz

Installation of Giocoso-Quiz is achieved most simply by issuing the following three commands:

cd
wget https://absolutelybaching.com/abc_installer
bash abc_installer --giocoso-quiz

The installation process requires access to the Internet and will prompt you for sudo privileges in order to be able to copy files to the /usr/bin folder. Once installed, the program is run with the basic command: giocoso-quiz (i.e., all in lower-case, but as one hyphenated word, no spaces).

Please note that Giocoso-Quiz can only work if the Giocoso music player has been previously installed and used. If it's not installed, Giocoso-Quiz will spot its absence and quit with a warning. If it's installed but you've not used it to play much music, then there won't be many things the quiz can ask about. You need a history of a good hundred or more plays, really, for the quiz to be able to ask you sufficiently random -and sufficiently difficult!- questions about your music collection!

3.0 Run-time Parameters

There is no formal manual for Giocoso-Quiz, so I'll document here the various run-time parameters you supply to the program as you run it. The only one that's really essential to specify every time you launch Giocoso-Quiz is the --dbname one, because without knowing what database to query for previous 'plays', the quiz can't actually construct any meaningful questions!

Parameter Name Possible Values (if any) Function/comments
--checkver If present, the software will not run a quiz but will simply query this website to see if a newer version is available to install. If it is, it will download it automatically and prompt you for your sudo password in order to install it.
--dbname=xxxx Where xxxx is the name of a pre-existing Giocoso database that has previously been used to record plays of music files. If not supplied, a value of 'music' is assumed. If no database of that name exists, the program will error and quit. The same will happen if you provide a non-default name of a database that doesn't exist.
--clues If present, the quiz will provide textual clues for each question, consisting of the first two letters from either the first or last name of the composer in question. Whether it's first or last name is a matter of chance. If not present, no textual clues are offered: you simply listen to the music samples and guess the composer from them directly.
--questions=xxxx Where xxxx is a number greater than 0, but without upper limit. The default number of questions is 10. If you supply a number of 0 or less than 0, then 10 is silently substituted in for you. The parameter basically determines how many music samples you are asked to listen to. There is no upper limit.
--extract=xxxx Where xxxx is the number of seconds a musical extract should play for (and therefore how long you have to guess the composer). The default extract length is 30 seconds. The minimum length is 20 seconds; the maximum is 200 seconds. Any value supplied outside those bounds is silently transformed to be '30 seconds' long. Note that music extracts fade in for 5 seconds and fade out for 5 seconds, so a length of 20 seconds gives you just 10 seconds of listenable music to work with!
--displaycolour=xxxx
(or --displaycolor=xxxx)
Where xxxx is one of 'light', 'dark' or 'neutral'. Neutral is the default. The parameter works the same way to alter the display colours of the program text as the equivalent parameter does in Giocoso itself.
--device=xxxx Where xxxx is the technical name for the output audio device. The default audio device is 'default' and this usually works well enough. In advanced audio configurations, however, you can use this parameter to make music play back through a specific audio device. The parameter works exactly the same way as the identical parameter does in Giocoso itself.

Using these parameters, therefore, you could invoke a default game of Giocoso-Quiz with the command:

giocoso-quiz --dbname=mymusic

...assuming you had previously played music in Giocoso with an associated database called 'mymusic'. You'd be asked 10 questions, each involving the playing of a sample of music 30 seconds long and output via your computer's default audio device. Note that the music samples are always generated from a random starting point. You won't just hear the first xxxx seconds of a work, but any section of a work starting at any point that lasts for precisely the --extract number of seconds long.

If you wanted a longer game than normal, you could instead issue this command:

giocoso-quiz --dbname=mymusic --questions=50

Now, you'd be asked to identify the composers of 50 music samples -though each sample would still last the default 30 seconds.

For an even longer (and possibly getting a bit tedious!) game, you could try:

giocoso-quiz --dbname=mymusic --questions=50 --extract=100

This time, you'd get 50 samples to identify, but each would be in the form of a 100-second extract to listen to before you have to say who the composer is.

If you are not as familiar with your music collection as you thought you would be, you could instead try:

giocoso-quiz --dbname=mymusic --questions=20 --clues

Now, you'll get 20 questions, with music extracts back to being 30 seconds long... but this time you'll get a textual hint or clue to help you in your guessing. The clues will be the first two letters of the composer's first name or surname -though whether it's the first or last name is a matter of chance, and will change from question to question. Here's an example of what a question-with-clues looks like:

This example happens to show both questions hinting about the composer's surname -but you might, at random, instead be helped by a hint about a composer's first name. Assuming you've catalogued your composers as this site recommends, of course, then either hint should be useful -but pay close attention to the hint to know what part of the full name is being partially revealed in this way! Many's the time I've inadvertently been thinking of 'Michael... someone' when the clue was about the surname and I should have been thinking of '...Miaskovsky', for example! As they used to say when preparing students for exams: make sure you read the question carefully before you try answering it!

You'll also see in that screen shot how Giocoso-Quiz works. It simply picks something from your Giocoso play history at random, plays an audio extract from it, and asks you to identify its composer. It doesn't reveal the answer until the entire music extract has completed playing. So, by default, you get to listen to a random 30 second selection from a composition before the 'The answer is...' text appears. You are then prompted to press a key to make the next audio sample start playing -and this process repeats for as many questions as you've request you be asked (the default is 10).

The program neither checks your answers nor keeps a record of them: it's a bit of fun, and whether you cheat during or not is a matter between you and your conscience!

There's no formal scoring, either. Personally, I award myself a point for getting the composer's name in part ("Poulenc!"); an extra point if I get it in full ("Francis Poulenc!"); and a third point if I also happen to name the particular composition more-or-less correctly ("Three Songs!"). But it's always a pencil-and-paper exercise in not fooling myself and I try never to take it too seriously!

If you're playing with friends, it's again entirely up to you whether the exercise is competitive in spirit (in which case, if you guess the composer 5 seconds into a 30 second sample, you just keep quiet about it so as not to give the game away!), or collegial (in which case, you call out your guess as soon as you have one and other players can improve on your guess as they see fit. Provided the collegial discussion comes to a conclusion before the answer is revealed, it can still be good fun!)

4.0 Some Extra Points

Here are some extra observations and technical issues, listed in no particular order:

Like Giocoso, Giocoso-Quiz outputs to an ALSA audio device. Generally, ALSA only handles one active device at a time. That means you cannot have other audio playing when trying to launch Giocoso-Quiz: it will just be silent if you do. It would obviously be a bit silly to try listening to music samples when other music was already playing in any case -but the point is that Giocoso-Quiz simply doesn't let it happen, ordinarily.

In order to play an extract of (say) 30 seconds, the audio for a composition must be at least 30 seconds long. If it isn't, the file randomly selected is silently discarded and another file selected that does have the required length. Put another way, if you were to ask for a very long --extract value when running Giocoso-Quiz, you would simultaneously be excluding rather a lot of music from randomised selection. Setting --extract=200, for example (the maximum permitted value) would mean no music that lasted less than 200 seconds would ever be the subject of a quiz question.

For Giocoso-Quiz to work, you must already have installed and used Giocoso itself -and all the software prerequisites that apply to Giocoso therefore also apply to Giocoso-Quiz. Those needn't particularly worry you though: if you've managed to get Giocoso installed, then all the required prerequisites must already have been installed successfully. Giocoso-Quiz itself therefore only directly checks for the existence of an installed copy of Giocoso.