This slideshow requires JavaScript.
The SAM2695 chip used in our Synthesizer cartridge, from French manufacturer Dream, is a 64-voice stereo synthesizer with approximately 150 instruments/drums. There are also various effects, including reverb and echo, which can be used to manipulate the sounds. Some of the functions are explained in the NanoPy environment under Cartridges/Synthesizer (Figure U). It is worth working through the tutorial here first.
First, start the script Cuckoo Setup.
Next, the script Cuckoo Sound shows the basic structure and summarizes the parts we need for our project. When you start this script (Figure V), you first hear a violin, then a telephone ringing. Then we have a triad chord, where we play three notes at the same time, as an example of our polyphonic capabilities.
Line 1:
The synthesizer library is loaded here. This was previously loaded when the script “Setup” is installed. If an error occurs, the setup must be run again.
Line 3:
We set the volume. This is a value between 0 and 127.
Line 4:
There are channels in the MIDI music world. In ours there are 16, with channel 10 (number 9) being the drum channel. Each channel can have its own effects and instruments.
Line 7:
We have two commands on one line here. The first command selects the instrument set, the second sets the instrument. There is a list of the different instruments in the supplement, each with two numbers behind it. The first number is the instrument number, the second is the set. So if I want to play instrument 125 (telephone) of set 0, I enter the information as shown on this line. You have to subtract another number from the instrument. The standard MIDI instruments start with the number 1, but in computer science everything starts with the number 0, so you have to “add” -1.
Line 8:
We will now play a note. This is done using the noteOn command, which has two parameters. The first parameter corresponds to the note (0-127), the second to the velocity, i.e. the hardness of the note (0-127). If you do not know the number of a note, you can also use notetoNum here. This function expects a description of the note as text. C4 corresponds to the note C of the fourth octave.
Line 10:
Each note is played indefinitely. With noteOff in the same channel and the same note, this is switched off.
Lines 19-22:
We are producing a triad here.