electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
fun with fibonacci serie
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Wed Aug 30, 2006 3:00 pm    Post subject:  fun with fibonacci serie
Subject description: attempt to play with fibonacci serie for algorithmic composition
Reply with quote  Mark this post and the followings unread

Idea 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
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
jesusgollonet



Joined: Aug 29, 2006
Posts: 5
Location: Barcelona

PostPosted: Thu Aug 31, 2006 12:41 am    Post subject: Reply with quote  Mark this post and the followings unread

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?
Back to top
View user's profile Send private message
kijjaz



Joined: Sep 20, 2004
Posts: 765
Location: bangkok, thailand
Audio files: 4

PostPosted: Thu Aug 31, 2006 1:41 am    Post subject: Reply with quote  Mark this post and the followings unread

oh thanks ^^" Embarassed
i saw some great resources online.
i started at http://en.wikipedia.org/wiki/Fibonacci_sequence
(which i think'll lead you to some more fun places)

this is a good resource with lots of fun things to play around
http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fib.html

cheers.
- kijjaz
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
ultrasine



Joined: Aug 31, 2006
Posts: 16
Location: Europe

PostPosted: Fri Sep 01, 2006 2:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice one....
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [4 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use