Tag Archives: lullaby

Breaking out Instruments

I did a bit more work on Submediant. The goal for this set of changes was to allow the score files to define what kind of instrument to use.  Before, we could add multiple instruments but they all used the same basic sine wave generator…

Not only did I want to give the ability of specifying an instrument to the score file, though, I wanted to make creating new types of instruments easily… so I introduced a class hierarchy.  Essentially, all instrument objects have a common ancestor, the Instrument.  I defined MusicalInstrument as any instrument that knows/understands musical notation.  Finally, I defined two children of MusicalInstrument, MusicalSineInstrument which plays a sine wave and MusicalSquareInstrument which plays a square wave.  I then found a simple score to transcribe into Submediant…  Here is what it sounds like:

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

According to the description, it’s a Welsh Lullaby arranged for a recorder duet.

In case you’re curious… here’s the Submediant score file:

@SONGTITLE:All Through The Night
@ALBUMNAME:Let Them Eat Test
@ARTIST:Little Robots
@YEAR:2011
@GENRE:other

@bpm:120
@timesignature:4/4
@volume:2000

&recorder_1 class:musical_sine volume:1000
_:1/2 G5:1/4. F#5:1/8
E5:1/4 G5:1/4 A5:1/4. G5:1/8
F#5:1/4 D5:1/4 E5:1/2

&recorder_2 class:musical_square volume:300
_:1/2 D5:1/2
C5:1/2 E5:1/2
D5:1/2 C5:1/4 D5:1/4

&recorder_1
F#5:1/4. G5:1/8 G5:1/2
C5:1/4 B4:1/4 C5:1/4 D5:1/4
E5:1/4 F#5:1/4 C5:1/4 B5:1/4

&recorder_2
E5:1/4 D5:1/8:tie C5:1/8:untie B4:1/2
_:whole
_:whole

&recorder_1
C5:1/4. B4:1/8 A4:1/4. G4:1/8
B4:1/4 A4:1/4 G4:1/4 F#4:1/4
G4:1/4. F#4:1/8 E4:1/4. G4:1/8
A4:1/4. G4:1/8 E4:1/4 D4:1/4

&recorder_2
G4:1/2 F#4:1/2
E4:1/2 D4:1/2
_:whole
_:whole

&recorder_1
E4:1/2 F#4:1/2. G4:1/8
G4:1/2. _:1/4
_:1/2 G5:1/2. F#5:1/8
E5:1/4 G5:1/4 A5:1/4. G5:1/8

&recorder_2
C4:1/2 D4:1/2
G4:1/2 _:1/2
_:1/2 D5:1/2
C5:1/2 E5:1/2

&recorder_1
F#5:1/4 D5:1/4 E5:1/2
F#5:1/4. G5:1/8 G5:1/2
C5:1/4 B4:1/4 C5:1/4 D5:1/4
E5:1/4 D5:1/4 C5:1/4 B5:1/4

&recorder_2
D5:1/2 C5:1/4 D5:1/4
E5:1/4 D5:1/8:tie C5:1/8:untie B4:1/2
_:whole
_:whole

&recorder_1
C5:1/4. B4:1/8 A4:1/4. G4:1/8
B4:1/4 A4:1/4 G4:1/4 F#4:1/4
G4:1/4. F#4:1/8 E4:1/4. G4:1/8
A4:1/4. G4:1/8 F#4:1/4 D4:1/4

&recorder_2
G4:1/2 F#4:1/2
E4:1/2 D4:1/2
_:whole
_:whole

&recorder_1
E4:1/2 F#4:1/4. G4:1/8
G4:1/4. _:1/4

&recorder_2
C4:1/2 D4:1/2
G4:1/2 _:1/2