A video of this class is (or will be) posted at: http://echo360.uml.edu/heines2016/comp-mued2120.html
For your reading pleasure: Emily Howell by David Cope
All of the following code is available at http://scratch.mit.edu/projects/19070222/#editor
Sprite Control
- the hide block hides the costume for this sprite
Sprite Init (Initialize)
- here we are assigning values to four variables that were created in the Data section
- note that the numbers assigned are differences in MIDI note values from the starting note to the interval note
Sprite Maj. 2nd (generic Major 2nd interval)
- the top stack is the one that plays a major 2nd interval
- the bottom two stacks are only for testing and debugging
- look carefully at the set Ending Note to Starting Note - 12 - Delta 2nd block
- it is difficult to see in the screen capture, but the Starting Note - 12 - Delta 2nd part is really ( Starting Note - ( 12 - Delta 2nd ) )
- this means that ( 12 - Delta 2nd ) is computed first, and then that result is subtracted from the value of Starting Note
- thus, if Starting Note is 60 and Delta 2nd is 2, we get ( 60 - ( 12 - 2 ) ) = ( 60 - 10 ) = 50
- this makes sense because ( Starting Note + Delta 2nd ) = ( 60 + 2 ) = 62
- now you can see that the difference between 50 and 62 is 12, which is an octave, as it should be
Sprite Per. 4th (generic Perfect 4th interval)
- note the similarity of the stack that plays a perfect 4th to the previous one that plays a major 2nd
Sprite Per. 5th (generic Perfect 5th interval)
- again note the structural similarity of the top stack to the previous ones
- the other stacks are, once again, only for testing and debugging
Sprite Min. 7th (generic Minor 7th interval)
Sprite Ver. 1, which puts these all together to play a melody
The next version is the same as the previous one with the addition of the Play Starting Note variable
The interval scripts have all been modified to check the Play Starting Note variable before playing the starting note