| 1 |
// more music for replicants |
| 2 |
|
| 3 |
// patch |
| 4 |
Rhodey voc => JCRev r => Echo a => Echo b => Echo c => dac; |
| 5 |
|
| 6 |
220.0 => voc.freq; |
| 7 |
0.8 => voc.gain; |
| 8 |
.8 => r.gain; |
| 9 |
.2 => r.mix; |
| 10 |
1000::ms => a.max => b.max => c.max; |
| 11 |
750::ms => a.delay => b.delay => c.delay; |
| 12 |
.50 => a.mix => b.mix => c.mix; |
| 13 |
|
| 14 |
// shred to modulate the mix |
| 15 |
fun void vecho_Shred( ) |
| 16 |
{ |
| 17 |
0.0 => float decider; |
| 18 |
0.0 => float mix; |
| 19 |
0.0 => float old; |
| 20 |
0.0 => float inc; |
| 21 |
0 => int n; |
| 22 |
|
| 23 |
// time loop |
| 24 |
while( true ) |
| 25 |
{ |
| 26 |
Math.random2f( 0, 1 ) => decider; |
| 27 |
if( decider < .3 ) 0.0 => mix; |
| 28 |
else if( decider < .6 ) .08 => mix; |
| 29 |
else if( decider < .8 ) .5 => mix; |
| 30 |
else .15 => mix; |
| 31 |
|
| 32 |
// find the increment |
| 33 |
(mix-old)/1000.0 => inc; |
| 34 |
1000 => n; |
| 35 |
while( n-- ) |
| 36 |
{ |
| 37 |
old + inc => old; |
| 38 |
old => a.mix => b.mix => c.mix; |
| 39 |
1::ms => now; |
| 40 |
} |
| 41 |
mix => old; |
| 42 |
Math.random2(2,6)::second => now; |
| 43 |
} |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
// let echo shred go |
| 48 |
spork ~ vecho_Shred(); |
| 49 |
|
| 50 |
// scale |
| 51 |
[ 0, 2, 4, 7, 9 ] @=> int scale[]; |
| 52 |
|
| 53 |
// our main loop |
| 54 |
while( true ) |
| 55 |
{ |
| 56 |
// pentatonic |
| 57 |
scale[Math.random2(0,scale.size()-1)] => int freq; |
| 58 |
|
| 59 |
Std.mtof( ( 33 + Math.random2(0,1) * 12 + freq ) ) => voc.freq; |
| 60 |
Math.random2f( 0.6, 0.8 ) => voc.noteOn; |
| 61 |
|
| 62 |
// note: Math.randomf() returns value between 0 and 1 |
| 63 |
if( Math.randomf() > 0.85 ) |
| 64 |
{ 1000::ms => now; } |
| 65 |
else if( Math.randomf() > .85 ) |
| 66 |
{ 500::ms => now; } |
| 67 |
else if( Math.randomf() > .1 ) |
| 68 |
{ .250::second => now; } |
| 69 |
else |
| 70 |
{ |
| 71 |
0 => int i; |
| 72 |
2 * Math.random2( 1, 3 ) => int pick; |
| 73 |
0 => int pick_dir; |
| 74 |
0.0 => float pluck; |
| 75 |
|
| 76 |
for( ; i < pick; i++ ) |
| 77 |
{ |
| 78 |
Math.random2f(.4,.6) + i*.035 => pluck; |
| 79 |
pluck + -0.02 * (i * pick_dir) => voc.noteOn; |
| 80 |
!pick_dir => pick_dir; |
| 81 |
250::ms => now; |
| 82 |
} |
| 83 |
} |
| 84 |
} |