kijjaz

Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Wed Aug 30, 2006 3:00 pm Post subject:
fun with fibonacci serie Subject description: attempt to play with fibonacci serie for algorithmic composition |
 |
|
this might not be one new idea
but it's exciting to me to have a listen to some interesting math patterns.
i'm finding ways to have fun with fibonacci serie now.
after i try adding the series up and modulo them
i can see some interesting patterns that might be useful for creating repetetive patterens in music.
and this is the last patch i play around with fibonacci engine in it.
let's share some more idea about what types of patterns we can extract from the serie.
i've read some math articles on the serie and there's still a lot of ways to extract some patterns or chaos from fibonacci.
this one i used the result to create the melody,
but still monotonous.
Code: | // kijjaz-OrientalRomantic.ck
// connect gain to reverbs to dac
gain g => NRev rv1 => dac;
0.2 => g.gain;
0.6 => rv1.mix;
// note playing engine
fun void play(int n, dur d, int h) {
BlitSaw s => g;
std.mtof(n) => s.freq;
h => s.harmonics;
for(0 => int i; i < 100; i++) {
1 - i * 0.01 => s.gain;
d * 0.01 => now;
}
s =< g;
}
// jazz minor scale (melodic minor scale)
[0, 2, 3, 5, 7, 9, 11] @=> int scale1[];
// initial fibonacci serie values
0 => int x1; 1 => int x2;
// the modulo to apply
160 => int modulo;
// beat values
0.9::second => dur Beat;
5 => int BeatsPerBar;
0 => int BeatCount;
while(true) {
// calculate new value in fibonacci serie
(x1 + x2) % modulo => int y;
// play chord at beat 1 of each bar
if (BeatCount % BeatsPerBar == 0)
// play chord I if note = DO, MI, LA
if (y % 7 == 0 || y % 7 == 2 || y % 7 == 5) {
spork ~ play(scale1[0] + 64, 2::Beat, 11);
spork ~ play(scale1[2] + 64, 1::Beat, 11);
spork ~ play(scale1[4] + 64, 1::Beat, 11);
}
// play chord VII if note = RE, FA, SOL, TI
else {
spork ~ play(scale1[1] + 64, 2::Beat, 9);
spork ~ play(scale1[3] + 64, 1::Beat, 9);
spork ~ play(scale1[6] + 64, 1::Beat, 9);
}
// choose note from scale
scale1[y % 7] => int note;
// choose octave
y / 7 => int octave;
// play the melody line within 3 octaves
play(note + 52 + octave % 3 * 12, 1::Beat, 30);
// prepare for next iteration
x2 => x1; y => x2;
BeatCount++;
} |
heheh.. good night all folks..
- kijjaz |
|
jesusgollonet
Joined: Aug 29, 2006 Posts: 5 Location: Barcelona
|
Posted: Thu Aug 31, 2006 12:41 am Post subject:
|
 |
|
that's cool kijjaz
I'm also trying to get into algorithms with chuck. I know there are tons of info on fibonacci series and algorithmic stuff arround the web, but, can anyone recommend any special resource? |
|