https://ccrma.stanford.edu/mediawiki/api.php?action=feedcontributions&user=Mikegao&feedformat=atom
CCRMA Wiki - User contributions [en]
2024-03-28T20:04:55Z
User contributions
MediaWiki 1.24.1
https://ccrma.stanford.edu/mediawiki/index.php?title=LUMI&diff=7452
LUMI
2009-03-25T01:09:26Z
<p>Mikegao: /* = */</p>
<hr />
<div>Mike Gao's 250b Wiki<br />
=============<br />
Developed with Craig Hanson, the LUMI is a 32 pressure sensitive LED button matrix combined with a touchscreen, 8 knobs, crossfader and infrared sensor.<br><br />
This project was developed in 250a, and continued in 250b.<br><br />
For 250b, a new chassis was constructed and knobs, infrared and crossfader was also added. Special thanks to Chris Weil for the help on mechanical engineering.<br />
<br><br />
New software features include:<br><br />
- Auto chop<br><br />
- Chop to Step sequencer<br><br />
- Auto-assign chops to buttons<br><br />
<br />
Features I am still working on over spring break:<br><br />
- KNN / MFCC based beatbox trigger of cops<br><br />
- groove features<br><br />
- auto chop by MIR<br><br />
<br />
Difficulties faced/Lesson learned:<br><br />
<br><br />
When utilizing an infrared sensor in a switching circuit, care must be taken in the power supply of the infrared, as there is a 20ms or so latency between when the infrared sensor is powered, and when it will give useful output.<br />
The way we got around this was using a transistor circuit, and permanently connecting the infrared's own power supply. The switching is then handled by the transistor rather than the sensor.</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=LUMI&diff=7451
LUMI
2009-03-25T01:08:27Z
<p>Mikegao: </p>
<hr />
<div>Mike Gao's 250b Wiki<br />
=============<br />
Developed with Craig Hanson, the LUMI is a 32 pressure sensitive LED button matrix combined with a touchscreen, 8 knobs, crossfader and infrared sensor.<br />
This project was developed in 250a, and continued in 250b.<br />
For 250b, a new chassis was constructed and knobs, infrared and crossfader was also added. Special thanks to Chris Weil for the help on mechanical engineering.<br />
<br />
New software features include:<br />
- Auto chop<br />
- Chop to Step sequencer<br />
- Auto-assign chops to buttons<br />
<br />
Features I am still working on over spring break:<br />
- KNN / MFCC based beatbox trigger of cops<br />
- groove features<br />
- auto chop by MIR<br />
<br />
Difficulties faced/Lesson learned:<br />
<br />
When utilizing an infrared sensor in a switching circuit, care must be taken in the power supply of the infrared, as there is a 20ms or so latency between when the infrared sensor is powered, and when it will give useful output.<br />
The way we got around this was using a transistor circuit, and permanently connecting the infrared's own power supply. The switching is then handled by the transistor rather than the sensor.</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=Stanford_Laptop_Orchestra/SoCal&diff=7072
Stanford Laptop Orchestra/SoCal
2009-03-06T05:12:46Z
<p>Mikegao: /* Desired Return Date */</p>
<hr />
<div>=People=<br />
* Jieun<br />
* Rob<br />
* Chryssie<br />
* Luke<br />
* Nick<br />
* Mike G.<br />
* Michael B.<br />
* Leah<br />
* Visda<br />
* Andy<br />
* Jason<br />
* Ge<br />
* (Let Ge know if you aren't on this list and want to go so additional arrangements can be made)<br />
<br />
=Schedule=<br />
* 3/19, PM (late afternoon / early evening): we depart for SoCal<br />
* 3/19, night: we have accommodations booked for us in SoCal<br />
* 3/20, day: set-up and rehearsal<br />
* 3/20, 7pm: performance<br />
* 3/20, after performance: reception + dinner + accommodations in SoCal<br />
* 3/21, AM: for those returning to Stanford, we depart<br />
<br />
=Logistics=<br />
<br />
==Driving Status...How many people/stuff can you transport==<br />
* Blablabla: cannot drive... abstract object<br />
* Nick: can take two people down there, but will not immediately return<br />
* Michael B.: can not drive (car needs to go in to the shop): needs ride there and back on Saturday.<br />
* Leah: no car, need ride down<br />
* Luke: I'm happy to drive, but CANNOT drive my van (it is running poorly and needs repairs.) I recommend we rent a van.<br />
* Jieun: need ride<br />
* Visda: needs ride, brings snacks, music and good mood to the car!<br />
* Mike Gao: can drive 2-4 people. Also this is a one way ticket because I will not return. I have driven this route countless times so have faith that I will deliver you safely and on time.<br />
<br />
==Desired Return Date==<br />
* Nick: none<br />
* Michael B.: needs to return Saturday morning<br />
* Leah: none - doesn't need ride back<br />
* Luke: Can return saturday or sunday.<br />
* Jieun: needs to return on Saturday (earlier the better)<br />
* Visda: none - stays in the warm socal for ever!<br />
* Mike: none - stay in LA. welcome to come crash at my house!!!! I have 2 kittens!<br />
<br />
==Special Notes==<br />
* (i.e. Special food or room accommodations, other)<br />
* (ex: On 3/19 I cannot leave until 3pm because I have a final...)</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=Stanford_Laptop_Orchestra/SoCal&diff=7071
Stanford Laptop Orchestra/SoCal
2009-03-06T05:12:03Z
<p>Mikegao: /* Driving Status...How many people/stuff can you transport */</p>
<hr />
<div>=People=<br />
* Jieun<br />
* Rob<br />
* Chryssie<br />
* Luke<br />
* Nick<br />
* Mike G.<br />
* Michael B.<br />
* Leah<br />
* Visda<br />
* Andy<br />
* Jason<br />
* Ge<br />
* (Let Ge know if you aren't on this list and want to go so additional arrangements can be made)<br />
<br />
=Schedule=<br />
* 3/19, PM (late afternoon / early evening): we depart for SoCal<br />
* 3/19, night: we have accommodations booked for us in SoCal<br />
* 3/20, day: set-up and rehearsal<br />
* 3/20, 7pm: performance<br />
* 3/20, after performance: reception + dinner + accommodations in SoCal<br />
* 3/21, AM: for those returning to Stanford, we depart<br />
<br />
=Logistics=<br />
<br />
==Driving Status...How many people/stuff can you transport==<br />
* Blablabla: cannot drive... abstract object<br />
* Nick: can take two people down there, but will not immediately return<br />
* Michael B.: can not drive (car needs to go in to the shop): needs ride there and back on Saturday.<br />
* Leah: no car, need ride down<br />
* Luke: I'm happy to drive, but CANNOT drive my van (it is running poorly and needs repairs.) I recommend we rent a van.<br />
* Jieun: need ride<br />
* Visda: needs ride, brings snacks, music and good mood to the car!<br />
* Mike Gao: can drive 2-4 people. Also this is a one way ticket because I will not return. I have driven this route countless times so have faith that I will deliver you safely and on time.<br />
<br />
==Desired Return Date==<br />
* Nick: none<br />
* Michael B.: needs to return Saturday morning<br />
* Leah: none - doesn't need ride back<br />
* Luke: Can return saturday or sunday.<br />
* Jieun: needs to return on Saturday (earlier the better)<br />
* Visda: none - stays in the warm socal for ever!<br />
<br />
==Special Notes==<br />
* (i.e. Special food or room accommodations, other)<br />
* (ex: On 3/19 I cannot leave until 3pm because I have a final...)</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=128x-fall-2008&diff=7001
128x-fall-2008
2009-02-19T04:44:30Z
<p>Mikegao: /* == */</p>
<hr />
<div>= SLOrk 2009 =<br />
<br />
== Lights and Levitation ==<br />
* Andy, Mikael, David<br />
<br />
<br />
== Networking ==<br />
* Craig, Isak, David<br />
<br />
<br />
== Platform ==<br />
* Craig, Mikael(--)<br />
<br />
<br />
== Notation ==<br />
* Leah, Rob, Jieun<br />
<br />
<br />
== Dancer ==<br />
* Visda<br />
<br />
== Live Coding ==<br />
* [https://cm-wiki.stanford.edu/wiki/LiveCoding wiki]<br />
<br />
== Pieces ==<br />
Feel free to submit introductory tutorials or suggestions regarding performance for any of the pieces currently in the Slork repertoire. Not only could many of last year's members use a refresher in the control-systems and subtleties of each very different piece, but to new members struggling with putting all the pieces together, these basic comments can get the ball rolling.<br />
<br />
<br />
=== Take it for Granite ===<br />
by Perry Cook<br />
<br />
To start, open a terminal window and type: "granite". A simple GUI with three horizontal sliders and a single button will open and you will hear a crackling sound (you will also hear a few percussive beats but that's a bug, isn't it? ) Move the sliders to the right and you'll hear changes in amplitude of the crackling sound (top slider), pitch of the crackling sound (middle slider), and density of the drum-like percussive beats (bottom slider). Pressing the button labled "Sync Pattern" will output a strong pulse, grounding the rhythmic pattern temporarily to your beat. <br />
<br />
<br />
<br />
<br />
<br />
[[Category: Courses]] [[Category: SLOrk]]<br />
==================<br />
<br />
<br />
// get input to which channel to send sound<br />
me.arg(0) => Std.atoi => int channel;<br />
2 => int device;<br />
MidiIn min;<br />
MidiMsg msg;<br />
if( !min.open(device) ) me.exit();<br />
<<< "MIDI device:", min.num(), " -> ", min.name() >>>;<br />
<br />
<br />
<br />
// open keyboard (get device number from command line)<br />
//if( !hi.openKeyboard( device ) ) me.exit();<br />
//<<< "keyboard '" + hi.name() + "' ready", "" >>>;<br />
<br />
// the patch<br />
SndBuf buf => Envelope e => ADSR masterEnv => dac.chan(channel);<br />
//SndBuf buf => Envelope e => JCRev rev => dac.chan(channel);<br />
<br />
me.arg(1) => buf.read;<br />
1 => buf.loop;<br />
(buf.length() / samp) / 127 => float grain_multiplier;<br />
//80 => float grain_duration; <br />
800 => float grain_duration; <br />
5.0 => float rand_grain_duration;<br />
1 => int position; <br />
1.0 => float pitch;<br />
0 => int rand_position;<br />
//0.0 => float rand_pitch;<br />
0.0 => float pause;<br />
20.0 => float rand_pitch;<br />
<br />
float position_target;<br />
float position_knob;<br />
float fineposition_knob;<br />
1.0 => float pitch_target;<br />
1.0 => float gain_target => buf.gain;<br />
int position_range;<br />
<br />
int samples;<br />
buf.samples() => samples;<br />
grain_duration*0.5::ms => e.duration;<br />
<br />
int midiMsg1[44];<br />
int midiMsg2[44];<br />
initMidiMsg();<br />
<br />
fun void grain()<br />
{ <br />
// can be changed to acheive a more varying<br />
// asynchronous envelope for each grain duration<br />
<br />
0.0 => float grain_length;<br />
while( true )<br />
{ <br />
Std.rand2f(Math.max(1.0,grain_duration-rand_grain_duration),grain_duration+rand_grain_duration) => grain_length;<br />
grain_length*0.5::ms => e.duration;<br />
Std.rand2f(Math.max(0.0625,pitch-rand_pitch),pitch+rand_pitch) => buf.rate;<br />
Std.rand2(Math.max(1,position-rand_position) $ int, Math.min(samples,position+rand_position) $ int) => buf.pos;<br />
e.keyOn();<br />
grain_length*0.5::ms => now;<br />
e.keyOff();<br />
grain_length*0.5::ms => now;<br />
// 0.0 => buf.gain;<br />
pause::ms => now;<br />
}<br />
}<br />
<br />
// position interpolation<br />
fun void ramp_position()<br />
{<br />
2.0 * (samples) $ float / 10.0 => float thresh;<br />
<br />
0.005 => float slew;<br />
<br />
while (1)<br />
{ <br />
if(Std.fabs(position - position_target) > samples/5)<br />
{<br />
1.0 => slew;<br />
}<br />
else<br />
{<br />
0.005 => slew;<br />
}<br />
((position_target - position) * slew + position) $ int => position;<br />
<br />
1 :: ms => now;<br />
}<br />
}<br />
<br />
<br />
// pitch interpolation<br />
fun void ramp_pitch()<br />
{<br />
0.05 => float slew;<br />
while (1)<br />
{<br />
((pitch_target - pitch) * slew + pitch) => pitch;<br />
5 :: ms => now;<br />
}<br />
}<br />
<br />
// volume interpolation<br />
fun void ramp_gain()<br />
{ <br />
0.05 => float slew;<br />
while (1)<br />
{<br />
((gain_target - buf.gain()) * slew + buf.gain()) => buf.gain;<br />
10 :: ms => now;<br />
}<br />
}<br />
<br />
// setup midimessagevalues<br />
fun void initMidiMsg()<br />
{<br />
224 => midiMsg1[0]; 0 => midiMsg2[0]; // F1 slider<br />
176 => midiMsg1[1]; 1 => midiMsg2[1]; // F2 slider<br />
176 => midiMsg1[2]; 7 => midiMsg2[2]; // F3 slider<br />
176 => midiMsg1[3]; 8 => midiMsg2[3]; // F4 slider<br />
<br />
176 => midiMsg1[4]; 9 => midiMsg2[4]; // C1 knob<br />
176 => midiMsg1[5]; 10 => midiMsg2[5]; // C2 knob<br />
176 => midiMsg1[6]; 11 => midiMsg2[6]; // C3 knob<br />
176 => midiMsg1[7]; 12 => midiMsg2[7]; // C4 knob<br />
176 => midiMsg1[8]; 13 => midiMsg2[8]; // C5 knob<br />
176 => midiMsg1[9]; 14 => midiMsg2[9]; // C6 knob<br />
176 => midiMsg1[10]; 15 => midiMsg2[10]; // C7 knob<br />
176 => midiMsg1[11]; 16 => midiMsg2[11]; // C8 knob<br />
<br />
144 => midiMsg1[12]; 36 => midiMsg2[12]; // P1 pad, note<br />
176 => midiMsg1[13]; 100 => midiMsg2[13]; // P1 pad, aftertouch<br />
144 => midiMsg1[14]; 38 => midiMsg2[14]; // P2 pad, note<br />
176 => midiMsg1[15]; 101 => midiMsg2[15]; // P2 pad, aftertouch<br />
144 => midiMsg1[16]; 40 => midiMsg2[16]; // P3 pad, note<br />
176 => midiMsg1[17]; 102 => midiMsg2[17]; // P3 pad, aftertouch<br />
144 => midiMsg1[18]; 41 => midiMsg2[18]; // P4 pad, note<br />
176 => midiMsg1[19]; 103 => midiMsg2[19]; // P4 pad, aftertouch<br />
144 => midiMsg1[20]; 43 => midiMsg2[20]; // P5 pad, note<br />
176 => midiMsg1[21]; 104 => midiMsg2[21]; // P5 pad, aftertouch<br />
144 => midiMsg1[22]; 45 => midiMsg2[22]; // P6 pad, note<br />
176 => midiMsg1[23]; 105 => midiMsg2[23]; // P6 pad, aftertouch<br />
144 => midiMsg1[24]; 47 => midiMsg2[24]; // P7 pad, note<br />
176 => midiMsg1[25]; 106 => midiMsg2[25]; // P7 pad, aftertouch<br />
144 => midiMsg1[26]; 48 => midiMsg2[26]; // P8 pad, note<br />
176 => midiMsg1[27]; 107 => midiMsg2[27]; // P8 pad, aftertouch<br />
144 => midiMsg1[28]; 50 => midiMsg2[28]; // P9 pad, note<br />
176 => midiMsg1[29]; 108 => midiMsg2[29]; // P9 pad, aftertouch<br />
144 => midiMsg1[30]; 52 => midiMsg2[30]; // P10 pad, note<br />
176 => midiMsg1[31]; 109 => midiMsg2[31]; // P10 pad, aftertouch<br />
144 => midiMsg1[32]; 53 => midiMsg2[32]; // P11 pad, note<br />
176 => midiMsg1[33]; 110 => midiMsg2[33]; // P11 pad, aftertouch<br />
144 => midiMsg1[34]; 55 => midiMsg2[34]; // P12 pad, note<br />
176 => midiMsg1[35]; 111 => midiMsg2[35]; // P12 pad, aftertouch<br />
144 => midiMsg1[36]; 57 => midiMsg2[36]; // P13 pad, note<br />
176 => midiMsg1[37]; 112 => midiMsg2[37]; // 13 pad, aftertouch<br />
144 => midiMsg1[38]; 59 => midiMsg2[38]; // P14 pad, note<br />
176 => midiMsg1[39]; 113 => midiMsg2[39]; // P14 pad, aftertouch<br />
144 => midiMsg1[40]; 60 => midiMsg2[40]; // P15 pad, note<br />
176 => midiMsg1[41]; 114 => midiMsg2[41]; // P15 pad, aftertouch<br />
144 => midiMsg1[42]; 62 => midiMsg2[42]; // P16 pad, note<br />
176 => midiMsg1[43]; 115 => midiMsg2[43]; // P16 pad, aftertouch<br />
}<br />
<br />
<br />
spork ~ grain();<br />
spork ~ ramp_position();<br />
spork ~ ramp_pitch();<br />
spork ~ ramp_gain();<br />
<br />
0.0 => float temp_gain;<br />
me.arg(2) => Std.atoi => int t;<br />
<br />
if(t == 0)<br />
{<br />
// infinite event loop<br />
while( true )<br />
{<br />
<br />
min => now;<br />
while( min.recv(msg) )<br />
{<br />
<<<msg.data1>>>;<br />
<br />
if ( msg.data1 == 144 ) <br />
{<br />
if (msg.data3 > 0) <br />
{<br />
masterEnv.keyOn();<br />
}<br />
else<br />
{<br />
masterEnv.keyOff();<br />
}<br />
}<br />
<br />
// slider f1 => Position Macro<br />
if( msg.data1 == midiMsg1[0] && msg.data2 == midiMsg2[0] )<br />
{<br />
<br />
(msg.data3 / 127.) * samples => position_knob;<br />
position_knob + fineposition_knob=> position_target;<br />
<<< "Position Target = ", position_target >>>; <br />
}<br />
// slider f2 => Position Micro<br />
else if( msg.data1 == midiMsg1[1] && msg.data2 == midiMsg2[1] )<br />
{<br />
((msg.data3/127.) * (samples/127.)) => fineposition_knob;<br />
position_knob + fineposition_knob=> position_target;<br />
<<< "Position Target = ", position_target >>>; <br />
<br />
<br />
<br />
}<br />
// slider f3 => Grain Size<br />
else if( msg.data1 == midiMsg1[2] && msg.data2 == midiMsg2[2] )<br />
{<br />
<br />
8+ (msg.data3 / 127.) * ((buf.length()/samp)/127.) => grain_multiplier;<br />
<<< "Grain Duration Multiplier = ", grain_multiplier>>>; <br />
Math.fabs(Math.log(127./((127-msg.data3)+1))) * grain_multiplier $ float => grain_duration;<br />
grain_duration*0.5::ms => e.duration;<br />
<br />
<br />
<<< "Grain Duration = ", grain_duration>>>; <br />
<br />
}<br />
// slider f4 => Grain Size Micro<br />
else if( msg.data1 == midiMsg1[3] && msg.data2 == midiMsg2[3] )<br />
{<br />
Math.fabs(Math.log(127./((127-msg.data3)+1))) * grain_multiplier $ float + 1 => grain_duration;<br />
grain_duration*0.5::ms => e.duration;<br />
<br />
<br />
<<< "Grain Duration = ", grain_duration>>>; <br />
<br />
}<br />
// KNOBS<br />
// knob C1 - random duration<br />
else if( msg.data1 == midiMsg1[4] && msg.data2 == midiMsg2[4] )<br />
{<br />
(msg.data3/ 127.) * 2000 => rand_grain_duration;<br />
<<< "Random Grain Duration = ", rand_grain_duration >>>;<br />
}<br />
// knob C2 - pitch<br />
else if( msg.data1 == midiMsg1[5] && msg.data2 == midiMsg2[5] )<br />
{<br />
(msg.data3 / 127.) * 6 => pitch_target;<br />
<<< "Pitch Target = ", pitch_target >>>; <br />
<br />
}<br />
<br />
// knob C3 Master release<br />
else if( msg.data1 == midiMsg1[6] && msg.data2 == midiMsg2[6] )<br />
{<br />
((msg.data3 / 127.) * 5)::second => masterEnv.releaseTime;<br />
<<< "Master Release = ", masterEnv.releaseTime() >>>;<br />
}<br />
// knob C4 Position Range<br />
else if( msg.data1 == midiMsg1[7] && msg.data2 == midiMsg2[7] )<br />
{<br />
Math.round((msg.data3 / 127.) * (samples/4.)) $ int => position_range;<br />
<br />
}<br />
// knob C5<br />
else if( msg.data1 == midiMsg1[8] && msg.data2 == midiMsg2[8] )<br />
{<br />
( (msg.data3 / 127.) * samples/16 ) $ int => rand_position;<br />
<<< "Random Position = ", rand_position >>>; <br />
<br />
<br />
}<br />
// knob C6 - Random Pitch<br />
else if( msg.data1 == midiMsg1[9] && msg.data2 == midiMsg2[9] )<br />
{<br />
((msg.data3/ 127.) * 100) => rand_pitch;<br />
<<< "Random Pitch = ", rand_pitch >>>;<br />
<br />
}<br />
// knob C7 - Aftertouch Mode<br />
else if( msg.data1 == midiMsg1[10] && msg.data2 == midiMsg2[10] )<br />
{<br />
<br />
}<br />
// knob C8<br />
else if( msg.data1 == midiMsg1[11] && msg.data2 == midiMsg2[11] )<br />
{<br />
(msg.data3/127.) * 3 $ float => gain_target;<br />
<<< "Gain = ", gain_target >>>;<br />
} <br />
// PADS<br />
<br />
else if( msg.data1 == midiMsg1[12] && msg.data2 == midiMsg2[12] )<br />
{<br />
pitch - 1.0 / 12 => pitch_target => pitch;<br />
<<< "Pitch Target = ", pitch >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[13] && msg.data2 == midiMsg2[13] )<br />
{<br />
<br />
// <<< "Pad P1 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[14] && msg.data2 == midiMsg2[14] )<br />
{<br />
pitch + 1.0 / 12 => pitch_target => pitch;<br />
<br />
<<< "Pitch Target = ", pitch >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[15] && msg.data2 == midiMsg2[15] )<br />
{<br />
<br />
// <<< "Pad P2 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[16] && msg.data2 == midiMsg2[16] )<br />
{<br />
(Math.max(200.0, rand_position - 500.0)) $ int => rand_position;<br />
<<< "Rand Position = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[17] && msg.data2 == midiMsg2[17] )<br />
{<br />
<br />
// <<< "Pad P3 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[18] && msg.data2 == midiMsg2[18] )<br />
{<br />
(Math.min(samples, rand_position + 500)) $ int => rand_position;<br />
<<< "Rand Position = ", msg.data3 >>>; <br />
<br />
}<br />
else if( msg.data1 == midiMsg1[19] && msg.data2 == midiMsg2[19] )<br />
{<br />
<br />
// <<< "Pad P4 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[20] && msg.data2 == midiMsg2[20] )<br />
{<br />
1.0 => pitch_target;<br />
// <<< "Pad P5 note = ", msg.data3 >>>; <br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[21] && msg.data2 == midiMsg2[21] )<br />
{<br />
<br />
//<<< "Pad P5 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[22] && msg.data2 == midiMsg2[22] )<br />
{<br />
<br />
0.75 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
<br />
<br />
<br />
else if( msg.data1 == midiMsg1[23] && msg.data2 == midiMsg2[23] )<br />
{<br />
<br />
//<<< "Pad P6 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[24] && msg.data2 == midiMsg2[24] )<br />
{<br />
0.5 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[25] && msg.data2 == midiMsg2[25] )<br />
{<br />
<br />
//<<< "Pad P7 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[26] && msg.data2 == midiMsg2[26] )<br />
{<br />
0.25 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[27] && msg.data2 == midiMsg2[27] )<br />
{<br />
<br />
//<<< "Pad P8 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[28] && msg.data2 == midiMsg2[28] )<br />
{<br />
0.125 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[29] && msg.data2 == midiMsg2[29] )<br />
{<br />
<br />
// <<< "Pad P9 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[30] && msg.data2 == midiMsg2[30] )<br />
{<br />
2 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[31] && msg.data2 == midiMsg2[31] )<br />
{<br />
<br />
//<<< "Pad P10 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[32] && msg.data2 == midiMsg2[32] )<br />
{<br />
4 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[33] && msg.data2 == midiMsg2[33] )<br />
{<br />
<br />
//<<< "Pad P11 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[34] && msg.data2 == midiMsg2[34] )<br />
{<br />
8 => pitch_target;<br />
<<< "Pitch", pitch_target >>>;<br />
}<br />
else if( msg.data1 == midiMsg1[35] && msg.data2 == midiMsg2[35] )<br />
{<br />
//<<< "Pad P12 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[36] && msg.data2 == midiMsg2[36] )<br />
{<br />
16 => pitch_target; <br />
<<< "Pitch", pitch_target >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[37] && msg.data2 == midiMsg2[37] )<br />
{<br />
<br />
//<<< "Pad P13 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[38] && msg.data2 == midiMsg2[38] )<br />
{<br />
<br />
<<< "Pad P14 note = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[39] && msg.data2 == midiMsg2[39] )<br />
{<br />
<br />
//<<< "Pad P14 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[40] && msg.data2 == midiMsg2[40] )<br />
{<br />
Math.min(samples, position + 11025) => position_target;<br />
<br />
<<< "Pad P15 note = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[41] && msg.data2 == midiMsg2[41] )<br />
{<br />
<br />
//<<< "Pad P15 aftertouch = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[42] && msg.data2 == midiMsg2[42] )<br />
{<br />
Math.max(1, position - 11025) => position_target;<br />
<<< "Pad P16 note = ", msg.data3 >>>; <br />
}<br />
else if( msg.data1 == midiMsg1[43] && msg.data2 == midiMsg2[43] )<br />
{<br />
<br />
//<<< "Pad P16 aftertouch = ", msg.data3 >>>; <br />
}<br />
else<br />
{<br />
<<< "unassigned midi message: ", msg.data1, msg.data2, msg.data3 >>>;<br />
}<br />
}<br />
<br />
<br />
// wait on event<br />
}<br />
}</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=128x-fall-2008&diff=7000
128x-fall-2008
2009-02-19T04:43:54Z
<p>Mikegao: /* Take it for Granite */</p>
<hr />
<div>= SLOrk 2009 =<br />
<br />
== Lights and Levitation ==<br />
* Andy, Mikael, David<br />
<br />
<br />
== Networking ==<br />
* Craig, Isak, David<br />
<br />
<br />
== Platform ==<br />
* Craig, Mikael(--)<br />
<br />
<br />
== Notation ==<br />
* Leah, Rob, Jieun<br />
<br />
<br />
== Dancer ==<br />
* Visda<br />
<br />
== Live Coding ==<br />
* [https://cm-wiki.stanford.edu/wiki/LiveCoding wiki]<br />
<br />
== Pieces ==<br />
Feel free to submit introductory tutorials or suggestions regarding performance for any of the pieces currently in the Slork repertoire. Not only could many of last year's members use a refresher in the control-systems and subtleties of each very different piece, but to new members struggling with putting all the pieces together, these basic comments can get the ball rolling.<br />
<br />
<br />
=== Take it for Granite ===<br />
by Perry Cook<br />
<br />
To start, open a terminal window and type: "granite". A simple GUI with three horizontal sliders and a single button will open and you will hear a crackling sound (you will also hear a few percussive beats but that's a bug, isn't it? ) Move the sliders to the right and you'll hear changes in amplitude of the crackling sound (top slider), pitch of the crackling sound (middle slider), and density of the drum-like percussive beats (bottom slider). Pressing the button labled "Sync Pattern" will output a strong pulse, grounding the rhythmic pattern temporarily to your beat. <br />
<br />
<br />
<br />
<br />
<br />
[[Category: Courses]] [[Category: SLOrk]]<br />
==================</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=LiveCoding&diff=6823
LiveCoding
2009-01-22T04:31:18Z
<p>Mikegao: /* end Visda's code ================================== */</p>
<hr />
<div>Page for Live Coding Examples from Luke's 12/21/2009 live-coding session<br />
================================================================================<br />
<br />
<br />
================================================================================<br />
''if you're bored...''<br />
<br />
http://www.youtube.com/watch?v=v4Wy7gRGgeA<br />
<br />
Code Monkey by Jonathan Coulton<br/><br />
<br />
Code Monkey get up, get coffee<br/><br />
Code Monkey go to job<br/><br />
Code Monkey have boring meeting<br/><br />
Boring manager Rob<br/><br />
Rob say Code Monkey very diligent<br/><br />
But his output stink<br/><br />
His Code not functional or elegant<br/><br />
What do Code Monkey think?<br/><br />
Code Monkey think,<br/><br />
Maybe manager wanna write<br/><br />
Goddamn log-in page himself<br/><br />
Code Monkey not say it out loud<br/><br />
Code Monkey not crazy, just proud<br/><br />
<br/><br />
Code Monkey like Fritos<br/><br />
Code Monkey like Tab and Mountain Dew<br/><br />
Code Monkey very simple man<br/><br />
Big, warm, fuzzy, secret heart<br/><br />
Code Monkey like you<br/><br />
Code Monkey like yooooouuuuu<br/><br />
<br />
Code Monkey hang around at front desk<br/><br />
Tell you sweater look nice<br/><br />
Code Monkey offer buy you soda<br/><br />
Bring you cup, bring you ice<br/><br />
You say no thank-you for the soda 'cause<br/><br />
Soda make you fat<br/><br />
Anyway, you busy with the telephone<br/><br />
No time for chat<br/><br />
Code Monkey have long walk back to cubicle<br/><br />
He sit down, pretend to work<br/><br />
Code Monkey not thinking so straight,<br/><br />
Code Monkey not feeling so great.<br/><br />
<br/><br />
Code Monkey have every reason<br/><br />
To get out this place<br/><br />
Code Monkey just keep on working<br/><br />
See your soft pretty face<br/><br />
Much rather wake up, eat a coffee cake<br/><br />
Take bath, take nap<br/><br />
This job fulfilling and creative way<br/><br />
Such a load of crap<br/><br />
Code Monkey say someday he have everything<br/><br />
Even pretty girl, like you<br/><br />
Code Monkey just waiting, for now<br/><br />
Code Monkey say someday, somehow<br/><br />
<br />
= Luke's Live Code: ===========<br />
<br />
// LC1: squares<br />
<br />
// -----------------------------------------------<br />
// bring tha noise <br />
// -----------------------------------------------<br />
<br />
SqrOsc mosc => SqrOsc cosc => ADSR env => dac => Delay del => LPF flt => dac;<br />
3::second => del.max;<br />
2 => cosc.sync;<br />
<br />
// some basic parms:<br />
<br />
// pitch:<br />
Std.mtof(Std.rand2(20, 30)) => cosc.freq; <br />
<br />
// pitch variation: <br />
Std.rand2f(5, 20) => mosc.gain; <br />
<br />
// speed of pitch variation: <br />
1 => mosc.freq; <br />
<br />
// delay feedback (be careful here!):<br />
0.7 => del.gain;<br />
<br />
// length of delay:<br />
100::ms => del.delay;<br />
<br />
// delay filter stuff:<br />
Std.rand2f(500, 2000) => flt.freq;<br />
Std.rand2f(0.5, 1.0) => flt.Q;<br />
<br />
<br />
// -----------------------------------------------<br />
// make time <br />
// -----------------------------------------------<br />
<br />
3.1::second => dur d; // how long it lasts<br />
0.8 => float decay_frac; // what fraction is decay<br />
env.set( d*0.3, d*0.01, .5, d*decay_frac ); // attack, decay, sustain, release<br />
env.keyOn();<br />
d*(1-decay_frac) => now;<br />
env.keyOff();<br />
d*decay_frac + 2::second => now;<br />
<br />
= end luke code ==============================<br />
<br />
= David ===================================<br />
/* Live Coding Test 1<br />
Have the user invoke different functions. */<br />
<br />
Phasor s => Gain g => dac;<br />
5000 => s.sfreq;<br />
0 => s.sync;<br />
0.5 => g.gain;<br />
<br />
440.00 => float A;<br />
466.16 => float Bb;<br />
493.88 => float B;<br />
523.25 => float C;<br />
554.37 => float Db;<br />
587.33 => float D;<br />
622.25 => float Eb;<br />
659.26 => float E;<br />
698.46 => float F;<br />
739.99 => float Gb;<br />
783.99 => float G;<br />
830.61 => float Ab;<br />
<br />
fun void code1() {<br />
B => s.freq;<br />
0.5::second => now;<br />
E => s.freq;<br />
0.5::second => now;<br />
}<br />
<br />
fun void code2() {<br />
G => s.freq;<br />
0.25::second => now;<br />
E => s.freq;<br />
0.25::second => now;<br />
D => s.freq;<br />
0.25::second => now;<br />
}<br />
<br />
fun void code3() {<br />
A => s.freq;<br />
0.125::second => now;<br />
B => s.freq;<br />
0.125::second => now;<br />
}<br />
<br />
fun void code4() {<br />
Gb => s.freq;<br />
0.5::second => now;<br />
}<br />
<br />
<br />
/* SECTION ONE - SEQUENCING<br />
Any sequence of the following:<br />
code1();<br />
code2();<br />
code3();<br />
code4();<br />
*/<br />
while(true) {<br />
code1();<br />
}<br />
= end David code ===================================<br />
<br />
= Visda's Live code ===================================<br />
// modulations<br />
SqrOsc mod => SinOsc car => Gain mult;<br />
// modulate the modulations<br />
Modulate vibe => mult => Envelope e => dac;<br />
// multiply<br />
3 => mult.op;<br />
// sync<br />
2 => car.sync;<br />
// envelope<br />
5::second => e.duration;<br />
<br />
//modulate between the three arrays<br />
<br />
// an array<br />
//[ 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10 ] @=> int arri[];<br />
<br />
// an array of melodic minor<br />
//[0,2,3,1,4,2,6,3,4,4] @=> int arri[]; //sequence data<br />
<br />
// an array of major<br />
//[0,2,4,5,7,9,11,12] @=> int arri[]; //major scale<br />
<br />
// vibrato<br />
5 => vibe.gain;<br />
.1 => vibe.randomGain;<br />
.02 => vibe.vibratoRate;<br />
<br />
while (true){ <br />
<br />
// modulator & carrier<br />
<br />
Std.mtof( 300 + Std.rand2(0,10)* 50 + arri[Std.rand2(0, arri.cap()-3)]) => mod.freq;<br />
5::ms => now;<br />
<br />
// modulate it between mod 500 - car 100 for earth<br />
// or mod 100 - car 200 for space<br />
<br />
4 => mod.gain;<br />
100 => car.freq;<br />
2 => car.gain;<br />
<br />
<br />
// go for it<br />
e.keyOn();<br />
e.duration() => now;<br />
e.keyOff();<br />
e.duration() => now;<br />
}<br />
= second part of Visda's code ===================================<br />
SinOsc s => JCRev r => dac;<br />
.3 => s.gain;<br />
.1 => r.mix;<br />
<br />
// an array<br />
[ 5, 1, 5, 1, 5, 1, 5, 1, 5,1] @=> int arri[]; <br />
<br />
<br />
while (true) <br />
{<br />
Std.mtof( 300 + Std.rand2f(0,10)* 50 + arri[Std.rand2(0, arri.cap()-3)]) => s.freq;<br />
52::ms => now;<br />
<br />
Std.mtof( 333 + Std.rand2(1,10) * 200 + Math.sin(arri[Std.rand2(0, arri.cap()-1)])) => s.freq;<br />
120::ms => now;<br />
<br />
Std.mtof( 700 + Std.rand2f(0,9)* 50 + arri[Std.rand2(0, arri.cap()-6)]) => s.freq;<br />
3::ms => now;<br />
}<br />
<br />
= end Visda's code ===================================<br />
<br />
= Mike Gao's Code ===================================<br />
//MOVE DA MOUSE ON BEAT SOMETIMES<br />
SinOsc a => SinOsc b => Gain g => g => dac;<br />
0 => int device;<br />
Hid hi;<br />
HidMsg msg;<br />
if( !hi.openMouse( device ) ) me.exit();<br />
<<< "mouse '" + hi.name() + "' ready...", "" >>>;<br />
spork ~ mouser();<br />
220 => a.freq;<br />
<br />
// TRY MULTIPLES OR FRACTIONS OF 100<br />
100=>int duration;<br />
<br />
for (;;)<br />
{<br />
Math.fabs(Math.tan(now/samp))*200 => b.freq;<br />
Math.fabs(Math.tan(now/ms))*100=>a.freq;<br />
Math.fabs(Math.tan(now/samp))=>a.gain;<br />
<br />
<br />
(now/ms)$int %3=>b.sync;<br />
<br />
duration::ms=>now;<br />
}<br />
<br />
fun void mouser()<br />
{<br />
for (;;) {<br />
while (hi.recv(msg))<br />
{<br />
if (msg.isMouseMotion())<br />
{<br />
msg.deltaX * 100=>b.freq;<br />
msg.deltaY * 300=>a.freq;<br />
//<<<msg.deltaX>>>;<br />
//(Math.fabs(msg.deltaX*100)+2) $ int => duration;<br />
}<br />
if (msg.isButtonDown())<br />
{<br />
0=>b.sync;<br />
}<br />
<br />
<br />
}<br />
hi=>now;<br />
}<br />
}<br />
= End Mike's Code=====================================</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=220a-fall-2008/finalprojects&diff=6689
220a-fall-2008/finalprojects
2008-12-12T03:02:30Z
<p>Mikegao: </p>
<hr />
<div>[https://cm-wiki.stanford.edu/wiki/Daniel_Smith_Final_Project_Music_220a_Fall_2008 Daniel Smith Final Project!]<br />
<br />
[https://cm-wiki.stanford.edu/wiki/Fractal_Computation_in_ChucK_-_The_Julia_Class OMG Chris Weil]<br />
<br />
[http://ccrma.stanford.edu/~chanson9/220/GRANULATOR.html The Granulator!!!] - Craig Hanson<br />
<br />
[http://ccrma.stanford.edu/~jorgeh/220a/project/index.php 3D Sounds] - Jorge Herrera<br />
<br />
[http://ccrma.stanford.edu/~aeg165 Multichannel openGL mapping: i heart asio] - Andy Greenwood<br />
<br />
[https://cm-wiki.stanford.edu/wiki/Siqi_Mou_Final_Project_Music_220a_Fall_2008 Why Are There So Many Me's?- Siqi Mou Music 220A Final Project]<br />
<br />
[http://ccrma.stanford.edu/~jakesb/220a/index.html Give Peace A Chance] - Jakes Bejoy<br />
<br />
[http://ccrma.stanford.edu/~stretto/220a/project/index.html Fun With The Stage] - Grahame Lesh<br />
<br />
[http://ccrma.stanford.edu/~darkowen/220a/project.html Sound Painting] - Mofei Zhu<br />
<br />
[http://sufferforfash.wordpress.com/2008/12/11/in-which-i-hijack-my-own-blog-for-my-music-project Sound-Inspired Jewelry] - Lauren Nguyen<br />
<br />
[http://gtakacs.stanford.edu/~gtakacs/mus220/index.htm The Sound of Chaos] - Gabriel Takacs<br />
<br />
[http://ccrma.stanford.edu/~benolson/snddraw/ sndDraw] - Ben Olson<br />
<br />
[http://ccrma.stanford.edu/~mikegao/index.html Trivial Intelligent Pitch Bend and WaveCut] - Mike Gao<br />
<br />
[http://www.stanford.edu/~rparikh/cgi-bin/music.html PASSWORD: pokeyman...also, ignore the junk surrounding the content] - Ravi "Ravi" Parikh...there is a password to view it, and the password is "pokeyman."<br />
<br />
[http://www.stanford.edu/~ppetroff/final220a/ Dreams of Sleep] - <3 Peter Petroff</div>
Mikegao
https://ccrma.stanford.edu/mediawiki/index.php?title=256-fall-2008/hw3&diff=6548
256-fall-2008/hw3
2008-11-25T04:17:36Z
<p>Mikegao: /* Note */</p>
<hr />
<div>= Homework #3: Sound Peeking =<br />
<br />
Due date: 2008.11.24 11:59:59pm (or thereabout), Monday.<br />
<br />
* [[256-fall-2008/hw3/FAQ|(F)AQ]]<br />
<br />
<br />
<div style="text-align: left;">[[Image:waves-bw.jpg]]</div><br />
<br />
In this assignment, you are to visualize sound in real-time, using OpenGL for the graphics programming.<br />
<br />
<br />
=== Specification (part 1 of 3): naming + compilation ===<br />
* choose a name for your program<br />
* get a framework compiling on your system (keep in mind the final deliverable must be compilable/runnable on the CCRMA machines OR on OS X)<br />
* might wish to start from the [http://ccrma.stanford.edu/courses/256-fall-2008/lectures/7a/VisualSine VisualSine] example from lecture (time domain waveform rendering)<br />
* additional code from class available [http://ccrma.stanford.edu/courses/256-fall-2008/lectures/ here]<br />
<br />
<br />
=== Specification (part 2 of 3): Visualizing the spectrum ===<br />
* implement short time fourier transform, and visualize the spectrum over time<br />
* considerations:<br />
** windowing (rectangular, hann, hamming)<br />
** window size<br />
** FFT size<br />
** hop size (for now, hop size can equal window size)<br />
* implement either a waterfall plot (like sndpeek) or a real-time scrolling spectrogram<br />
<br />
<br />
=== Specification (part 3 of 3): Visualize something about the sound ===<br />
* implement and visualize your choice of one of the following:<br />
** vowel vs. consonant<br />
** pitch tracking<br />
** an audio feature<br />
** use the sound to control some type of animation<br />
** (or something of your choosing)<br />
<br />
<br />
=== Note ===<br />
* have fun with it!!!<br />
* your code should compile and run on the CCRMA (or OSX) machines<br />
* comment your code!<br />
* choose your own coding conventions - but '''be consistent'''<br />
* you are welcome to work together, but you must do/turn in your own work (you'll likely get more out of it this way)<br />
<br />
=== Deliverables ===<br />
<br />
'''turn in all files by putting them in your Library/Web/256/hw3/ directory, and concise online documentation + readme'''<br />
<br />
* 1) source code to the project (*.h, *.cpp, *.c makefile, etc.)<br />
* 2) online page for your project (should be viewable at http://ccrma.stanford.edu/~YOURID/256/hw3/). It should include:<br />
** links to your files of various kinds<br />
** instructions on building the project (for example, anyone in the class should be able to download<br />
** a short README text section that:<br />
*** conveys your ideas/comments in constructing each program <br />
*** describes any difficulties you encountered in the process<br />
*** lists any collaborators<br />
* 3) '''email Ge''' with the link to your web page, as a confirmation that you are submitting the assignment</div>
Mikegao