Notes on Musical Mastermind

Susan Jones
This is a form of the game using notes instead of colours. The program sounds a chord and the player must identify the notes it contains, in ascending order of pitch.
A guess is entered as a sequence of upper-case note-names, e.g. DFAD. The program indicates the number of correct notes in the right place (yellow stars), and the number of correct notes in the wrong place (blue stars).
The process continues until the sequence is correct. The program keeps account of the best score (i.e. fewest guesses) and prints a message if the latest score is the best so far.
Pressing the space bar at any time plays the chord again. Single notes may also be sounded as their names are entered. For some people this will make things too easy, so the option can be switched on or off at the beginning of each new game. If the sound is turned off altogether the game becomes an exercise in logical deduction like ordinary Mastermind!
Minor problems are:
·         The random number generator sometimes gets stuck in a groove and presents the same chord twice running!
·         Repeatedly entering and deleting notes causes the pitch to rise. The octave is reset whenever the chord is sounded, or at the beginning of each new guess.

Chords

Because the program is meant for ear-training, it uses predefined chords rather than random note- clusters. Those supplied are common positions of chord I, III, IV, V, and VI of C Major. However, the program has been designed to be adaptable in a number of ways. Listed below are some possible modifications, with hints about how to do them.
1. Change the instrument used. The definition is in the "RUN" word. Some users may like to have a different instrument for each voice in the chord.
2. Change the key on which the chords are based. One example is given already. The file "U.DMAJ" holds a set of chord words which can overlay the existing ones. After loading the program, enter *EXEC U.DMAJ to do the replacement. In this context, C and F stand for C# and F# respectively.
3. Similar sets of words could be created for other keys by editing this file. Bear in mind that:
·         For each chord, it is necessary to alter both the notes sounded and the corresponding character string placed on the stack.
·         The "sign" word must be altered to set the correct key signature and print out a message saying what the key is. This is called by the "RUN" word.
·          Within each chord word a nested IF( )ELSE( )IF structure is used to select a particular inversion. You may insert more alternatives if you wish so long as you retain the correct structure. You will also need to alter the range of the random number generated for the global variable "inv" in the "RUN" word.
4. Use additional chord words. Define the new chord words, insert the necessary selections in the word "choose", and alter the range of the random number generated for the global variable "chord" in the "RUN" word.
5. Use chords with more (or fewer) than 4 notes. The program should handle chords with up to 6 notes. Alter the value of the global variable "len" in the "RUN" word and redefine all the chord words to correspond.

An unsolved problem

It would be difficult to handle accidentals in chords other than those which are part of a key signature, since the one to one mapping between note and typed symbol would be lost.
Suggestions for solving this neatly will be welcome - as will other comments on the program. If there is any interest I will try and produce an enhanced version!

Related files on this disc:
U.Masterm - Musical Mastermind AMPLE program
U.DMaj - alternate set of chord words for use with above program

Published in AMPLINEX 003, January 1988