Diff from The Sounds of Fibonacci by henk.lasschuit (16 Mar'14 16:37) to Re: The Sounds of Fibonacci by ttsesmetzis (18 Mar'14 17:42)

name
Re: The Sounds of Fibonacci
description
Pisano Pperiods for rythe numbersic 2 pato 1000 converted to sournds.
code
/*b The= soBunffer.read( s, of FibonPlacci In the Fibfonacci-srm.reqsouenrce eveDiry term+/+ i"s founds/a11wlk01.wav" b); ( Sy adding thDef(\playBuf, two{| previous terms: = 0, 1,buf 1= 0, amp = 0.2, 3,pan 5,= 80.0, 13..... If yodur divide= 0.2, gathe = 1 stearmtPos of= the0 Fibon| vacci-r sig, equencv; env by= aEny givGen.ar( Enumbv.siner( andur note), gathe, remaindermp, ydouneAction: w2 ); sig = PllayBuf.ar( 1, bufind, BufRa repeating sequenSce called.ir( thebuf Pisano), Period 1, (Leon stardo tPisano was the* BufFreal names.ir( obuf Fibonacci): ); 2: 0 OffsetOut.ar(out, 1,Pan2.ar( 1,sig 0,* 1env, 1,pan 0,) 1, 1, 0) })...add 3:) ( Pn( Plazy({ var 0,divisor 1,= 1,3.rrand( 2,9 0), 2,repeats 2,= 1, 0,.rrand( 1, 1, 2, 0, 2, 2, 1...); This var pis greatno, becausize, you cstan rtsimply, tdurns, pans, Pamps; pisano Pe= Array.piod isanto( divisound! For th); size number= 2 the period has a length of 3 and u.sing a ze; stampling rates of= 44{ 1.00 this will .result in a toned of} 14700! Hsiz,e which i; durs within= audible{ 0.03.rrange d(if you0.08 are young enough). The} Pi! size; panos Period= for{ the number 1.000 is .rouandabout2 1500,} which! wsill givze you ; amps tone= of{ 0.05.rraboutnd( 30.8 Hz,) well} within! audsiblze range.; Any te "Divisorm: of %\the Ppisano Pperiod for a givens numberof can ble found by adding the: two %\n".previous terms of( that Pdivisano Period, dsividze it ); Pby the given d( \instrumber en note, the rem\playBuf, \pinder. That's aniceo, becauPseq( you don't hpisave tno, work with the penormouats num), \bers ouf, the originb, \almp, FPibondex( acci-mps, Pkequence. Any( P\pisano perio) ), \dur, wPill containdex( 1 odurs, 2Pkey( \pisanor 4) zeros.), This \pan, Pindeax( wpas inspired, bPkey( th\pis videano: ) ), h \sttp://www.youtube.com/wartch?v=Nu-lW-Ifyec ThePos, FPibonacci-sdequencex( cstanrts, bPkey( found \pisano the) Onl) ) }), ine Encyclof ).pedila oy ) b.f Integer Sequences: http: //oeis.org/A000045/////////////////////////////////////////////////////////////////// as// well+ Arrasy the{ sequence // of // lengtThs of the Ppisano Pperiod for dthe giffverent inumbtegers:. http://oeis.org/A001175 */ pis.boot; a=Array.new(14700000);//array for storing{ 1000| sounds each with a duratvisonr of= 1/3 of a second| c=Array.newClear(14700) // varray for storling 1 sound with, la durastPaionr, of 1sum; /3/ o if a( divisecond cr.puisInt(0,0); ceger.punot(1,1); ( for: (2, 1000, {arg j; // voor j=2 t/m 1000, divisors for (2,< 14699,0 {arg} i; c=c.put(i, (c[i-1]+c[i-2])%j)});{ c=2*(c+0.5)/j-1; //normalise, t "The divisor will bmust thbe values cponsitiven iently beger".throween; // -1 and 1 }; // for list (= List[ 0, 14699, {arg i; a=a.add(c[i])}); // a.add(c); whille not{ // work: a wi ll conastPain an array in= each cell in st.kead of a number c.put(0,0 -2 ); //this i sum necessary= lafster normPalising cr.psut(1,1)m; }); ) //this will take a few seconds um a!=a.add(0); //to1 avoidr: g{ litcheas when switchPaing the sound ofr. It also prevents nasty effects!= when0 p} // }{ // laying sthe.add( soundsm repeatedly % b=Buffer.loadCollection(vis,or a); // x }; // = ^ { PlayBufist.ar(1, b, BufRrateScaley.kdr(b), loop:( 0)-1 };) // x.play; } x.free; // b.free; } a.free;//////////////////////////////////////////////////////////////////////
category tags
code fork, mathematics, research
ancestors
1-4VW