Giocoso 3 - The Play Music Menu : Play Music by Advanced SQL Selection

If you know anything about databases, you'll know that you can query them by means of a 'Structured Query Language' (SQL) select statement. If you are fluent in writing SQL, you can use the Play Music menu option 4 to construct SQL select statements to pick out music you want to listen to -and have Giocoso play the results. If you are not familiar with relational databases and SQL, then I strongly suggest you give this menu option a miss! The word 'advanced' is in there for a reason!!

To give you a hint as to why you might want to get up to speed with this menu option, however, consider this use of the selection filter form (Play Music menu option 2):

It's fairly clear, I think, what the user is trying to do here: I'd like to listen to quartets and/or chamber music by two different British composers. It's a perfectly reasonable request, but Giocoso will respond to it this way:

This is because Giocoso matches each filter with the contents of each metadata tag... so saying 'Composer = Britten or Bridge' means Giocoso is literally looking for a single piece of music whose ARTIST tag was set to 'Britten or Bridge'... and that's an absurd value to assign to a tag! The same is true for the GENRE tag: it's going to be set either to 'Quartet' for hundreds of recordings, or to 'Chamber' for hundreds of others... but no one piece of music is going to have a tag that literally and exactly reads 'Chamber or Quartet' (not if you follow Axiom 4, at least!).

The Giocoso 'standard' selection filter cannot, in other words, do 'or' tests.... which is why you might want to start writing your own SQL which can do so with relative ease. Here, for example, is a selection test that would precisely give accurate results which the filter form was attempting to achieve but could not:

I'm here writing only the part of the music selection query which comes after the WHERE keyword. I do not need (and must not write!) anything before that point: Giocoso fills all that in for you. Giocoso will also 'sanitise' your input to some extent: if you use the keywords 'update' or 'delete' or include a semi-colon in your text, those will all be stripped out automatically. If the resulting query results in gibberish, so be it: you'll be told nothing matches your selection criteria. If more than one recording does match the submitted WHERE clause, then you'll be offered a chance to save the matching records in a playlist. If you choose not to, fine: playback of the selections begins immediately. If you do save your playlist, playback begins immediately after the playlist is saved.

Here is the playlist resulting from the Britten/Bridge/Chamber/Quartet query you see me submitting above:

It certainly mentions recordings by the two named composers and in the two genres requested (and no others!): so multiple selections joined with AND and OR keywords, with judicious use of parentheses to constrain processing order along logically-meaningful lines has certainly worked in this case.

Hopefully, you'll now see why the Advanced SQL option exists -but if you aren't familiar with writing SQL, it's a high mountain to climb. I would strongly recommend installing a tool such as DB Browser for SQLite and using its GUI tools to investigate the Giocoso database structure and to practice SQL selections before hoping to use Play Menu option 4 to meaningfully generate the sort of subtle and complex music selections it's capable of, anyway.


[ User Manual Home ] | [ Back to Play Music Menu ]