Answers are at the bottom of https://cs4fn.blog/bitof6 where you can also read a copy of the magazine articles about Music and Artificial Intelligence.
1. _ _ _ _ _ a piece of text with musical symbols instead of letters that tells a performer which notes to play, also a piece of music that accompanies a film (5 letters)
2. and 10. _ _ _ _ _ _ (6 letters) separation is when computer scientists use AI to take a piece of music and split it into its _ _ _ _ _ (5 letters) – read more about this in ‘Separate your stems‘
3. The _ _ _ _ _ _ is the main part of the tune you might sing along to (6 letters)
4. A piece of music is made up of lots of different _ _ _ _ _ (5 letters)
5. We measure how loud something is in _ _ _ _ _ _ _ _ (8 letters)
6. A sequence of instructions that tell a computer what to do _ _ _ _ _ _ _ _ _ (9 letters)
7. If you halve the length of a guitar string the note is an _ _ _ _ _ _ (6 letters)
8. A guitar-like harp-lute from Ghana _ _ _ _ _ _ _ _ (8 letters) – read more about this in ‘The day the music didn’t die‘
9. How high or how low a musical note is _ _ _ _ _ (5 letters)
10. (see 2.)
More on…
We have LOTS of articles about music, audio and computer science. Have a look in these themed portals for more:
The Music and AI pages are sponsored by the EPSRC (UKRI3024: DA EPSRC university doctoral landscape award additional funding 2025 – Queen Mary University of London).
Subscribe to be notified whenever we publish a new post to the CS4FN blog.
How can a machine generate music? It needs an algorithm to follow: instructions to tell it what to do, step by step. Here are two simple games to play that compose a random tune by algorithm.
Writing Notes
We need a way to write notes. We use letters A to G as on a piano. They repeat all the way up the white keys, so after G comes different higher versions of A, B, C again. We will use notes running from what is called Middle C in the middle of the piano to the next C up. This is called an octave. We will call the two Cs, C1 and C2.
Roll two dice and add the numbers. Write down the note given in the table for Game 1, so if they add to 2 or 3 write down C1, if 4 write down D…If 7 then you get to roll again, and so on. Keep going until you have written 15 notes to make a tune of 15 notes.
Game 1 by CS4FN
Game 2: Up and Down
The second algorithm uses one die. First write down C1 then roll the die and do what it says in the Game 2 table. Each new note is based on the last note. If you roll a 1 then write down D (the next note UP from C1). Rolling a 6 means add a pause in the tune (write a dash). If the roll takes you beyond either C then you bounce back: so rolling a 4 when you last wrote C1 means you write C1 again. Rolling 5 from C1 bounces you up to E. Continue until you have 15 notes.
Are they any good? Does either game give better tunes?
Good music isn’t just random notes. That is why we pay composers to come up with the really good stuff! Both human and machine composers learn more complicated patterns of what makes good music.
What do you think of our musical masterpiece?
On Game 1 we rolled 6 4 8 8 8 | 5 9 4 9 6 | 5 6 9 9 10 so our tune is F D G G G | E A D A F | E F A A B
Here’s what our tune sounds like once harmonies have been added.
Could you improve your tunes by tweaking the notes? Some people use simple algorithms to spark human creativity like that. Rock legend David Bowie helped write a program he then used to write songs. It took random sentences from different places, split them in half and swapped the parts over to give him ideas for interesting lyrics. It was possibly the first algorithm to help write hit songs.
A ‘note’ on bias
Think about the numbers that are rolled and the number of different ways that each number can be produced. For example with two dice (let’s call them ‘left’ and ‘right’) you can make the number 9 twice by rolling a 5 with the left and 4 with the right, or 4 with the left and 5 with the right. Same with 6 and 3. There are only two ways to roll a 2 (both dice have to show 1) or a 3 (a 1 and a 2 or a 2 and a 1). This is baked in to the process and so will affect the notes that appear most often.
Jo Brodie and Paul Curzon, Queen Mary University of London
More on…
We have LOTS of articles about music, audio and computer science. Have a look in these themed portals for more:
The Music and AI pages are sponsored by the EPSRC (UKRI3024: DA EPSRC university doctoral landscape award additional funding 2025 – Queen Mary University of London).
Subscribe to be notified whenever we publish a new post to the CS4FN blog.
The Knights Templar were a 12th century order of catholic warrior monks, more accurately if convolutedly called “The Poor Fellow-Soldiers of Christ and of the Temple of Solomon” though they weren’t exactly poor. In addition to their original role of protecting catholic pilgrims heading to Jerusalem from robbery and murder, they also acted as a kind of international banker to support their main role. They laid some important foundations of modern international banking in the process. In particular, they invented a way to move money (or gold) around safely, without ever actually moving it anywhere. That sounds like a magic trick! Did they use some supposed mystical magic powers to do this? No, they kept the actual money given to them in the nearest of their large network of 1000 or so headquarters and forts around the continent. The money didn’t have to move anywhere. They then gave the person a note to hand in at their headquarters in another country. It promised that the Knights there would give them the equivalent amount from their money store when asked and given the note. The Knights there just swapped them the money for that note. This worked as long as they had a suitable store of money in each location, which of course would be topped up each time someone wanted to move money from that point. This is a simple version of how international banking works now. A British 20 pound note just promises to pay the bearer an equivalent amount, and without that promise (and people’s belief in it) it is just a piece of paper. It is just a similar promissory note, except people now just swap notes, treating it as money in its own right. Similarly, the banks don’t actually move any gold or other physical form of money about when you pay a shop with your debit card or banking app. They just move information equivalent to those promissory notes embodied in the transaction, around a network (though a computer one rather than a network of forts connected by roads).
There is a problem though with moving money from one person to another in this way using notes. If someone steals the note then it is potentially as valuable to them as actually stealing the chest of gold left in the original fort (just as stealing a 20 pound note is). In the Templar’s time the thief would just need to take it to a Templar headquarters and swap it for money just as the original owner would have done (a bit risky perhaps, given how fearsome the Templars were, but potentially possible!). Worse though, without a system to protect from this kind of attack, a thief could copy the note and then ask for the money repeatedly!
However, the Templars are know to have used encryption in their communications. The notes may therefore have been encrypted too and if so that would have made them useless if stolen. Banks now encrypt all those messages that move money about computer networks for the same reason. If only the Templar’s could read their notes (as only the Templar’s knew the key to their code), then only they could know it even was promising money. That doesn’t fully make it secure though, perhaps a thief could guess it was such a note, and if so what is to stop them then trying to cash it in (apart from the risk of being wrong). You would need something more. A simple possibility is the person with the note would need to know the encrypted amount that was contained somewhere within it. If they didn’t ask for the right amount then they couldn’t have handed over the money in the first place. They would reveal themselves as a thief!
Modern banks have to deal with similar problems even though modern financial transactions are all encrypted. Simple encryption alone is still not enough, protocols (special algorithms) are needed to prevent wide ranging kinds of attack being possible. Banks also need to use better ciphers than those from the Middle Ages, as today we can quickly crack ciphers as simple as the Templar Cipher. Banking is all done differently in detail today, but the ideas behind what is done and why are the same.
Can you crack the Templars’ cipher and decrypt the message below? One way might be using frequency analysis. The most common letters in English are likely (if not definitely) the most common in the message. E is most frequent in English, so which symbol might stand for E? Frequency analysis had been known for several hundred years before the Templars used ciphers (at least by the Arabs, though the Templars weren’t exactly their friends!), so it is actually possible even then that the Templars’ messages might be cracked, unknown to them. It was an Arabian scholar called Al Kindi, who actually invented frequency analysis (or at least was the earliest known person to write about it in his manuscript “On Deciphering Cryptographic Messages”.) Another way to crack the code might be to look for cribs – what words might be included in the message if it is a promissory note? Using both together may give you a good chance of decrypting the message. If you can’t crack their code (there is a big clue in this article), the key is given at the end if you scroll down. Use it to then decrypt the message.
Superheroes don’t just have physical powers. Often theycome out on top because of their mental abilities. Sherlockis a good example, catching villains through logicalthinking. Anyone can get better at thinking! Just practice.
It is important for everyone to be able to think clearly. It is especially true for programmers, detectives and lawyers as well as superheroes. You need to be able to work things out from the facts you know. The Ancient Greeks were very good at logic. They invented the idea of a ‘syllogism’. These are common patterns that combine facts where you figure out a conclusion only using the facts.
For example, if we know facts 1 and 2 below (where you can swap in anything for X, Y and Z) then we can create a new fact as shown.
Image by Paul Curzon
So let’s replace X with the word superheroes, Y with fight crime and Z with my favourite superhero, Ghost Girl. If we put them in to the picture above we get the new picture:
Image by Paul Curzon
In this case we can deduce the new fact that Ghost Girl fights crime. Notice how you use the plurals in Fact 1 and singular words in the other facts to make the English work.
Puzzles
Can you solve these Superhero Syllogism puzzles? Work out which conclusion is the one that follows from the given facts. Use our coloured template above to help.
Superhero syllogism puzzle 1
FACT 1: ALL superheroes do good. FACT 2: The Invisible Woman is a superhero.
Which statement below (a, b, c or d) can we say from these facts alone? Don’t use anything extra, just use fact 1 and fact 2. (ANSWERS at the bottom of the page).
a) The Invisible Woman has superpowers. b) The Invisible Woman does good. c) The Invisible Man does good. d) The Invisible Woman does not do good
Superhero syllogism puzzle 2
FACT 1: ALL superheroes sometimes accidentally do harm. FACT 2: Jamila is a superhero.
What can we say from these facts alone?
a) Jamila sometimes accidentally does harm. b) Jamila is not a superhero c) Those with superpowers only do good. d) Jamie is a superhero
Superhero syllogism puzzle 3
FACT 1: ALL supervillains laugh in an evil way. FACT 2: The Spider is a supervillain.
What can we say from these facts alone?
a) The Spider sometimes accidentally does harm. b) The Spider does not laugh in an evil way. c) Supervillains are evil. d) The Spider laughs in an evil way.
As long as the facts are true the conclusion follows, though if the facts are not true then nothing is really known.
Superhero syllogism puzzle 4
The following logic is good but something has gone wrong because the conclusion is not true. The superhero called the Angel does not actually have any superpowers! The Angel just wears a flying suit! Can you work out what has gone wrong with our logic?
1. ALL superheroes have superpowers. 2. The Angel is a superhero.
Therefore we can conclude from these facts alone that
3.The Angel has superpowers.
Answers are at the bottom of the page.
Fun to do
Take the pattern of the above syllogisms and invent your own. Just substitute your own words, but keep the pattern.See how silly the “facts” you can deduce are.
– Paul Curzon, Queen Mary University of London, first appeared in A BIT of CS4FN 2
Learn the basics of computer science through magic tricks
Subscribe to be notified whenever we publish a new post to the CS4FN blog.
This blog is funded by EPSRC on research agreement EP/W033615/1.
Answers
Superhero syllogism puzzle 1
Answer: b. FACT 1: ALL superheroes … do good. FACT 2: The Invisible Woman is a superhero Therefore we can conclude from these facts alone that NEW FACT: The Invisible Woman … does good.
Superhero syllogism puzzle 2
Answer: a. FACT 1: ALL superheroes … sometimes accidentally do harm. FACT 2: Jamila is a superhero Therefore we can conclude from these facts alone that NEW FACT: Jamila … sometimes accidentally does harm.
Superhero syllogism puzzle 3
Answer: d. FACT 1: ALL supervillains … laugh in an evil way. FACT 2: The Spider is a supervillain. Therefore we can conclude from these facts alone that NEW FACT: The Spider … laughs in an evil way.
Superhero syllogism puzzle 4
Something has gone wrong. We are told that The Angel has no superpowers. They just wear a special flying suit. The new fact is therefore not true. This means that one of the original ‘facts’ was not actually true. If we start from things that are not true then the things we deduce will not be true either! In this case