*** empty log message ***
[chuck-blob.git] / v2 / test / artrd02.ck
blobfe89aee56221b3c109ddee7313246a0953f40563
1 // Radio Drum Mapping 1
2 // Whack mode
3 // z controls gain
4 // x controls pitch
5 // y controls effect mix (reverb)
7 StifKarp synth1 => gain g1 => JCRev rev1 => dac;
8 StifKarp synth2 => gain g2 => JCRev rev2=> dac; 
10 MidiIn min;
11 MidiMsg msg;
13 // open midi port
14 if ( !min.open( 0 ) )
15    me.exit;
17 while ( true )
19         min => now;
20         while ( min.recv ( msg ) )
21         {
23                 if (msg.data1 == 160)
24                 {
27                         // left stick whack  -- vel, x, y
28                         if (msg.data2 == 1)
29                         {
30                            // z-axis output
31                            (msg.data3/127.0)*2. => g1.gain;
32                            (msg.data3/127.0) => synth1.noteOn;
33                         }       
38                         // right stick whack -- vel, x, y
39                         if (msg.data2 == 11)
40                         {
42                                 if (msg.data3 < 50)     
43                                 30. => synth1.freq;
45                                 if (msg.data3 > 50)     
46                                 10. => synth1.freq;
47                         }       
48                 
49                 
50                 }
51         }