[Syllabus]
No homework answers posted. Everyone did well. Comments returned with homework.
// which keyboard 0 => int device; // get from command line if( me.args() ) me.arg(0) => Std.atoi => device; // open keyboard (get device number from command line) if( !hi.openKeyboard( device ) ) me.exit(); <<< "keyboard '" + hi.name() + "' ready", "" >>>;
Keyboard device zero is the default, but I have an external keyboard attached to my laptop and want to use that instead. The external keyboard is most likely device one.
miniAudicle parameter for keyboard 1
chuck Terminal parameter for keyboard 1
Remove unnecessary code, only need c d e f g a b C and Shift
MIDI note on (NON) belongs in keyDown message. Matching MIDI note off belongs in keyUp message. Note will remain sounding as long as key is held down.
fun void playIt(int zeroBasedNote, int vel, int scaleStart, int patchNum) { // play midi note patchChange(patchNum); 0x90 => mmsg.data1; scaleStart + zeroBasedNote => mmsg.data2; vel => mmsg.data3; mout.send(mmsg); }
else if(msg.ascii == ascii_q) { playIt( -5, 100, 48, 19 ); }
This method would let you map one row of the keyboard to the blues scale for the I chord, another row to the blues scale for the IV chord, and a third row to the blues scale for the V chord. The blues form goes like this
I |
I |
I |
I |
IV |
IV |
I |
I |
V |
IV |
I |
V or I |
C |
C |
C |
C |
F |
F |
C |
D |
G |
F |
C |
G or C |
A possible group project would be to jam on the blues. One person improvises melody patterns/chords, another improvises bass lines, another plays the drums. You'd need to agree on a common beat, four beats to a measure, and when the chords change switch to a different row for the blues scale.
Played in class.
[Syllabus]
Revised John Ellinger, Winter 2014