MUSC 208. Computer Music and Sound. Winter 2014

Unit 7 Lecture

[Syllabus]

Homework 3-4 Grades

No homework answers posted. Everyone did well. Comments returned with homework.

Grade distribution

homework 3-4 grade stats

Homework 3-4 Notes

open keyboard - chuck parameters

// 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

miniAudicle parameters

chuck Terminal parameter for keyboard 1

chuck parameters in Terminal

Optimize keyboard template

Remove unnecessary code, only need c d e f g a b C and Shift

Key down and Key up message

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.

Multiple meanings of Sample

  1. a single 16 bit number representing one sample of digital audio
  2. my intended meaning of sample for DrumMachine.ck was "one hit on a drum"
  3. several of you used sample meaning a small section of a prerecorded performance

Edit Samples in Audacity before using in ChucK

  1. trim silence at beginning
  2. trim end if you can't hear it (depends on how loud final result will be)
  3. be sure samples begin and end on a zero crossing to avoid clicks

Incorporate the scale starting note and patchNum into playIt() function parameters

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

Blues Form

I
I
I
I
IV
IV
I
I
V
IV
I
V or I

Blues Form in C

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.

Homework 3-4 Highlights

Played in class.

[Syllabus]

Revised John Ellinger, Winter 2014