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