//code essay: find equivalences between most STK Ugens and //strangely pitched ones: PercFlut, BlowHole, and TubeBell //Graham Coleman [0, 2, 4, 5, 7, 9, 11, 12] @=> int maj[]; //major scale pan2 p[4]; //since StifKarp seems to be in tune with most other STK UGens, //let's use it as a reference StifKarp stif => p[0] => dac; PercFlut perc => p[1] => dac; BlowHole blow => p[2] => dac; TubeBell bell => p[3] => dac; 0.4 => stif.gain => perc.gain => blow.gain => bell.gain; //noteoffs perc.noteOff( 0.5 ); for (0=>int i; i<4; i++) { //set the pans p[i].pan( (i $ float + 0.5) / 4.0 ); } for (0=>int i; ; i++) { (i/8)%5 => int rep; maj[i%8] => int n; std.mtof( 5*12 +2 +n ) => float f; //d major scale //noteOff 0.5 => stif.noteOff => perc.noteOff => blow.noteOff => bell.noteOff; 0.5 => blow.stopBlowing; //doesn't respond to noteOff //TubeBell doesn't respond to noteOff, either 0.0 => bell.noteOn; if ( rep==0 ) { //default parameters f => stif.freq; stif.noteOn( 0.5 ); //the reference f => perc.freq; perc.noteOn( 0.5 ); f => blow.freq; blow.noteOn( 0.5 ); f => bell.freq; bell.noteOn( 0.5 ); } else if ( rep==1 ) { //suggested parameters f => stif.freq; stif.noteOn( 0.5 ); //the reference //seems a fifth above, divide by 5th ratio in just tuning //f * 1.3348 => perc.freq; perc.noteOn( 0.9 ); //up perfect fourth f / 1.4983 => perc.freq; perc.noteOn( 0.9 ); //down perfect fifth //blow doesn't seem to respond to the freq messages right now //f => blow.freq => blow.vent; blow.startBlowing( 0.5 ); //this one one may sound a little weird (like a diminished triad) //but if you listen to it by itself, //you will find that its fundamental is in the right place f => bell.freq; bell.noteOn( 0.5 ); } else if ( rep==2 ) { //the story of BlowHole //doesn't seem to respond to freq messages, or noteOff f => blow.freq => blow.vent; blow.startBlowing( 0.5 ); } else if ( rep==3 ) { //the story of TubeBell //seems to be alright, the inharmonicity gives it charm f => bell.freq; bell.noteOn( 0.5 ); } else { //the story of PercFlut //not sure if this will generalize over other exposed parameters //of PercFlut, but this one works with this one f / 1.4983 => perc.freq; perc.noteOn( 0.9 ); //down perfect fifth } 1::second => now; }