ChucK suena…
Friday, September 2nd, 2005Esto:
//connect
sinosc s1 => JCRev r1 => dac;
sinosc s2 => dac;
sinosc s3 => dac;
// adjust gains
.3 => s1.gain;
.2 => s2.gain;
.2 => s3.gain;
// scale array
//int scale [7];
[0, 2, 4, 5, 7, 9, 11] @=> int scale[];
60 => int baseNote;
// notes
std.mtof(baseNote) => s1.freq;
std.mtof(baseNote) => s2.freq;
std.mtof(baseNote) => s3.freq;
while (true) {
std.rand2(0, (scale.cap()-1)) => int noteNow;
scale[noteNow] => int noteInScale;
std.mtof((baseNote) + noteInScale) => s1.freq;
if (maybe) {
std.mtof(baseNote + noteInScale) => s2.freq;
}
if (maybe) {
std.mtof((baseNote - 12) + noteInScale) => s3.freq;
}
.3::second => now;
}
Otro ejemplo, esta vez usando samples en vez del motor de audio interno (el código está bastante feo como para compartirlo).
Y como me temo que va a haber más posts de estos, inauguramos categoría: ChucK
tags:No tags