<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6362282027015388030</id><updated>2011-07-08T04:00:35.933-07:00</updated><title type='text'>...superkaleidoscope!</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-554944901054041027</id><published>2010-04-30T13:13:00.000-07:00</published><updated>2010-04-30T14:46:03.648-07:00</updated><title type='text'>stuff ive found out from research papers on music and emotion</title><content type='html'>&lt;u&gt;Defining affective musical parameters &lt;/u&gt;&lt;br /&gt;Much of the current music&amp;amp;emotion research uses the circumplex model of emotion, which consists of two components on a 2d scale: valence (positive or negative) and arousal (amount of energy). This model can be easily mapped out in SC using a 2dSlider object. The PAD model extends this further, adding a 3rd axis called dominance, which is a measure of approach and avoidance response, ie the difference between anger and fear. Also mentioned are different 'types' of tempo: score tempo (absolute, eg bpm), preferred tempo (the speed at which people tap along - "60 to 120 bpm, no matter what the score tempo is", and perceived tempo, which relates to the sparsity of the music. They also note that staccato articulation (glitchiness plz) is higher in arousal levels whereas legato tends to be low. Harmonic modes can be ordered from brightest to darkest according to Persichetti, in this order: Lydian, Ionian, Mixolydian, Dorian, Aeolian, Phrygian and Locrian.&lt;br /&gt;&lt;br /&gt;So all of these elements can be introduced into my musical grammar. So far I have chosen three polarities: happy/sad, bored/excited, euphoria/dysphora. Happy/sad is simply determined by mode. Bored/excited determined by perceived tempo/staccato-legato. Euphoric/dysphoric would be how the melody is reolved as well as increasing aleatory/glitchy elements.&lt;br /&gt;These were the initial ones I wanted to use, however from this research I have found out the placing of emotions such as anger and fear on the valence-arousal-domination scale and so will try to include this information somehow.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;A more scientific approach&lt;/u&gt;&lt;br /&gt;Much of the research on music and emotion is based on subjective descriptions of both the music and the response, although the valence-arousal-domination scale is good more precise methods could be found. It would also be more appropriate to measure the participant's neural activity as opposed to asking them to verbalise their responses. Music programming languages provide a good environment to study the effects of frequencies on brainwaves, as the level of control over the sonic output is roughly equivalent to the level of feeeback we can measure, ie its all numbers now.&lt;br /&gt;&lt;br /&gt;A possible example is the &lt;span id="EBSpanHighlighter" style="background-color: yellow; color: black;"&gt;solfeggio&lt;/span&gt; scale [&lt;span style="font-size: small;"&gt;&lt;span class="long-title" title="Solfeggio Arpeggio  396  417  528   639   741  852   963"&gt;&lt;span id="EBSpanHighlighter" style="background-color: magenta; color: black;"&gt;396&lt;/span&gt;  &lt;span id="EBSpanHighlighter" style="background-color: chartreuse; color: black;"&gt;417&lt;/span&gt;  &lt;span id="EBSpanHighlighter" style="background-color: dodgerblue; color: black;"&gt;528&lt;/span&gt;   &lt;span id="EBSpanHighlighter" style="background-color: yellow; color: black;"&gt;639&lt;/span&gt;    &lt;span id="EBSpanHighlighter" style="background-color: cyan; color: black;"&gt;741&lt;/span&gt;  &lt;span id="EBSpanHighlighter" style="background-color: magenta; color: black;"&gt;852&lt;/span&gt;   &lt;span id="EBSpanHighlighter" style="background-color: chartreuse; color: black;"&gt;963&lt;/span&gt; Hz], which is said to have a soothing and healing effect due to the 'sacred geometry' of the frequencies, and is used for meditation. Ignoring its nebulous origins (bible code), it does provide an interesting and precise hypothesis which could be tested using SC &amp;amp; a ECG machine very easily...eg create a sequence based on these specific frequencies and see if brainwave patterns differ with random mutations (could even use a genetic algorithm to create The Most Trancey sequence ever by creating a GUI for real-time user feedback). Also, on the trance-state aspect of music, gong and bell sounds are used for meditation all over the world due to their wide spectrum of harmonicity, and it is relatively easy to recreate these kinds of sounds using additive synthesis.The harmonics could then be fine-tuned to precise mathematical formulas. I like the idea of music as 'brain food'. Juslin et al note that it is very important to young people in defining self-identity, and essentially listening to bad music is like feeding children junk food for the soul (sort of). Music that is attuned to creating mental states would be like eating wholegrains/pure vitamins except mainlined straight into ur brainz..............&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span class="long-title" title="Solfeggio Arpeggio  396  417  528   639   741  852   963"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span class="long-title" title="Solfeggio Arpeggio  396  417  528   639   741  852   963"&gt;So to recap: there is plenty of research on affective music using conventional means, and lots of room to explore non-conventional means.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-554944901054041027?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/554944901054041027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/stuff-ive-found-out-from-research.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/554944901054041027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/554944901054041027'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/stuff-ive-found-out-from-research.html' title='stuff ive found out from research papers on music and emotion'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-7437737492356227712</id><published>2010-04-23T10:25:00.000-07:00</published><updated>2010-04-30T10:34:54.134-07:00</updated><title type='text'>physical modelling in supercollider</title><content type='html'>supercollider offers a lot of possibilities for physical modelling of real-life sounds. this is interesting because of the options to sonify situations that we can barely imagine, eg a string the length of the path from earth to the sun being plucked by a subatomic astronaut, or a drum as big as jupiter, or a guitar the size of the milky way... &lt;br /&gt;whilst there might not be a particularly pressing need for humans to hear such sounds, the technology could be useful in sound design for games, in creating a dynamic soundtrack that is based on the user interacting with the physical modelling of the game.&lt;br /&gt;this topic reminds me of dr fiorella terenzi's work on sonifying galaxies; as extensions, data from "outer space" combined with visual representations would be an interesting way to look at physics and may aid understanding from beyond a theoretical maths perspective, and it would be fascinating on a smaller scale, using high-musicality algorithms to render the theories of subquantum kinetics. the effects of music/sound on thought patterns and cognitive activity is well-documented, and sonifying theoretical science may well lead to interesting scientific breakthroughs via altered mental states (eg kekule seeing the uroborus in a dream). so we may yet come closer to a theory of everything with supercollider (but not the one at cern)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-7437737492356227712?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/7437737492356227712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/physical-modelling-in-supercollider.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/7437737492356227712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/7437737492356227712'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/physical-modelling-in-supercollider.html' title='physical modelling in supercollider'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-132352415942810764</id><published>2010-04-22T09:04:00.000-07:00</published><updated>2010-04-22T09:18:27.917-07:00</updated><title type='text'>research papers on music and emotion</title><content type='html'>http://www.acoustics.hut.fi/dafx08/papers/dafx08_02.pdf&lt;br /&gt;http://portal.acm.org/citation.cfm?id=1180665&lt;br /&gt;http://books.google.co.uk/books?id=HuWCVGKhwy0C&amp;amp;dq=music+emotion&amp;amp;lr=&amp;amp;source=gbs_navlinks_s&lt;br /&gt;http://www.stefan-koelsch.de/PeMS_lectures/Juslin+_BehavBrSci31_2008_emotional-reponses-to-music.pdf&lt;br /&gt;http://www.stefan-koelsch.de/PeMS_lectures/Koelsch_2009_12-Juslin%20&amp;amp;%20Sloboda-Ch-12_in-press.pdf&lt;br /&gt;http://www.psy.mq.edu.au/me2/uploads/publications/a_cross_cultural_investigation_of_the_perception_of_emotion.pdf&lt;br /&gt;http://www.wisegeek.com/what-are-the-seven-modes-of-music.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-132352415942810764?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/132352415942810764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/research-papers-on-music-and-emotion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/132352415942810764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/132352415942810764'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/research-papers-on-music-and-emotion.html' title='research papers on music and emotion'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-4418647799709040174</id><published>2010-04-22T07:04:00.000-07:00</published><updated>2010-04-23T10:17:25.226-07:00</updated><title type='text'>algorithmic composition</title><content type='html'>algorithmic composition is the technique of using predetermined rules to create music. the algorithms can be aleatory or totally predetermined, derived from fractals, L-Systems or other statistical models, evolutionary methods (ie mutation/selection processes from genetic algorithms) or a musical grammar could be explored.&lt;br /&gt;it is essentially music which is created using consciously mathematical processes as opposed to a more intuitive 'jamming' state...although most musicians will use algorithms in some form, a guitarist soloing thru a particular scale could be thought of as using aleatory algorithms.&lt;br /&gt;algorithmic composition seems to be a more 'left-brain' approach to composition, i think a 'right-brain' approach would encompass the composer/listener's emotional state as well, this is what i want to try and do with my algorithmic piece, by making it interactive as well as a little bit aleatory.&amp;nbsp;first i would have to create a musical grammar of emotion, a simple start is happy=major key, sad=minor; excited=fast, tired=slow; etc....using polarities so that a slider could be used as a gui. the gui would initialise the piece, which would then run itself through varying possibilities based on the initial inputs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-4418647799709040174?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/4418647799709040174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/algorithmic-composition.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/4418647799709040174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/4418647799709040174'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/04/algorithmic-composition.html' title='algorithmic composition'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-3025113065380972538</id><published>2010-03-04T07:50:00.001-08:00</published><updated>2010-03-04T07:50:36.482-08:00</updated><title type='text'></title><content type='html'>SwingOSC.default.boot;&lt;br /&gt;(&lt;br /&gt;var &lt;br /&gt;// GUI elements&lt;br /&gt;w, slider1, slider2, slider3, &lt;br /&gt;kickcs, cymbalcs, hatscs, snarecs, melodycs, bubblecs,&lt;br /&gt;makewindow,&lt;br /&gt;// Timing elements&lt;br /&gt;bps, clock, bar, beat,&lt;br /&gt;//Drum patterns&lt;br /&gt;kickpattern, snarepattern, hatspattern, cypattern,&lt;br /&gt;kickp, snp, hhp, cyp, hatsdecay,&lt;br /&gt;&lt;br /&gt;//Melody patterns&lt;br /&gt;wholepattern, bassline, baseline, mela, melb, melc, meld, mele, melody,&lt;br /&gt;//colors&lt;br /&gt;rainbow,highpink,sunset,amethyst,emerald,skyfi,&lt;br /&gt;//synths&lt;br /&gt;bfcs, bassfreq;&lt;br /&gt;&lt;br /&gt;bps = 6;&lt;br /&gt;clock= TempoClock(bps);&lt;br /&gt;bar= 4/bps;&lt;br /&gt;beat= bar/4;&lt;br /&gt;&lt;br /&gt;//drumSynths&lt;br /&gt;SynthDef(\kick,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, pitch= 1, filter= 1, on=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sin, pw, kik, kikfilter, volon;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= LFTri.ar(freq: Line.kr(40,20,0.1*decay,doneAction:2)*pitch+2,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add: 0, mul: 0.3*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pw= Pulse.ar(freq: 40, add: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: EnvGen.ar(Env.perc(0,0.07,0.3*volon)));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kik= Mix.new([sin,pw]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kikfilter= LPF.ar(in: kik, freq: XLine.kr(200,30,0.1*decay)*filter);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out.ar(0, Pan2.ar(kikfilter, 0))}).store;&lt;br /&gt;&lt;br /&gt;SynthDef(\snare,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, on= 0, decay= 1, pitch= 1, filter= 1, filter2= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filtap, volon, tri, snare, snaref, snaref2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filtap= EnvGen.ar(Env.perc(0,0.2*decay,0.2*volon,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= WhiteNoise.ar(mul: filtap, add: Line.kr(-3.5,2,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tri= Pulse.ar(freq: Line.kr(60*pitch,228,0.3,doneAction:2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: Line.kr(0.1,0.00,0.1)*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snare= noise+tri;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref= HPF.ar(in: snare, freq: Line.kr(800,200,0.22)*filter);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref2= LPF.ar(in: snaref, freq: Line.kr(600,1000,0.81)*filter2);&lt;br /&gt;Out.ar(0, Pan2.ar(snaref*on, 0))}).store;&lt;br /&gt;&lt;br /&gt;SynthDef(\hats,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, on=0, pitch=1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filter, envel, menv,onvol;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; onvol= -1*on*vol;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; menv= EnvGen.ar(Env.perc(0.3,0.01,1,4));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= PinkNoise.ar(mul: menv*onvol*7, add: Line.kr(1*pitch,0,0.03*decay,doneAction:2));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envel= EnvGen.ar(Env.adsr(0.00001,0.2*decay,0.7,0.2,2900));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filter= HPF.ar(in: noise, freq: envel);&lt;br /&gt;Out.ar([0,1], Mix.ar(filter))}).store;&lt;br /&gt;&lt;br /&gt;SynthDef(\cymbal,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 0.5, decay= 1, pitch= 1, on= 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sq1, sq2, volon;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq1= Pulse.ar(freq: Line.kr(623*pitch,223,0.2*decay,doneAction:2)*pitch, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mul: 0.3*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq2= Pulse.ar(add: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq:EnvGen.ar(Env.triangle(0.8*decay,300)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: 0.3*volon);&lt;br /&gt;Out.ar([0,1], Mix.ar(sq1*sq2))}).store;&lt;br /&gt;&lt;br /&gt;//synthSynths&lt;br /&gt;SynthDef(\lead,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { arg note=60, amp=4, clock=bps, filfreq=2, length=1, pan=7;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var freq, sin, saw, sinsaw, panner, filterenv, beat, sinres;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq= note.midicps*2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; beat= bps;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= SinOsc.ar&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (freq: Line.kr(freq-3,freq,beat,doneAction:2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mul: Line.kr(0.2,0.01,beat+1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; saw= LFTri.ar&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (freq: Line.kr(freq-1,freq,beat,doneAction:2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mul: Line.kr(0.2,0.01,beat+1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterenv= LPF.ar(in: saw, freq: filfreq*1000+70);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sinres= Resonz.ar(in: sin, freq: SinOsc.ar(freq: 0.3, mul: 0.6,add:700));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; panner = Pulse.ar(freq: (pan*3), mul:0.5);&lt;br /&gt;Out.ar(0, Pan2.ar(in:filterenv+sinres, pos:panner))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }).store;&lt;br /&gt;&lt;br /&gt;SynthDef(\bass,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { arg note=44, bubble=0, bubblelength=3;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var env2, freq, pulse, tri, beat,env,filter, out1, sin;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq= note.midicps;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; beat= (4/18);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pulse= Pulse.ar(freq: freq, mul:0.4);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tri= LFTri.ar(freq: freq, mul: 0.3);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= bubble*SinOsc.ar(freq: Line.kr(freq*16,freq*2, beat*bubblelength), mul:0.3);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env= Line.kr(0,1,beat,doneAction:2);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env2= EnvGen.ar(Env.triangle(1,beat));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out1= MoogFF.ar(in:tri+pulse, freq: 1900*env);&lt;br /&gt;Out.ar(0, Pan2.ar(in:out1+sin, pos:0)) } ).store;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SynthDef(\am,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { arg am= 1, arp=0, bubble=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var freq, ampmod, sin, sin2, arparray, bubbles, pan;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq= 622;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ampmod= SinOsc.ar(freq:Line.kr(4,1,4,doneAction:2), mul:0.1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= Pulse.ar(freq: 622, mul: 0.3*ampmod);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin2= LFTri.ar(freq: Line.kr(1245,311,4), mul:0.04);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bubbles= Resonz.ar(in:sin, freq:Line.kr(9100,00,4));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pan= SinOsc.ar(freq: 4);&lt;br /&gt;Out.ar([0], (Pan2.ar(in: bubbles, pos: pan)+Pan2.ar(in: sin2, pos: -1*pan))) } ).store;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rainbow = {&lt;br /&gt;highpink= Color.new255(2554194);&lt;br /&gt;sunset= Color.new255(255,94,41);&lt;br /&gt;amethyst= Color.new255(195,15,255);&lt;br /&gt;emerald= Color.new255(41,255,94);&lt;br /&gt;skyfi= Color.new255(102,255,217);&lt;br /&gt;&amp;nbsp;};&lt;br /&gt;rainbow;&lt;br /&gt;&lt;br /&gt;w= JSCWindow("- 0 - 0 - 0 - 0 -", Rect(100,100,510,230));&lt;br /&gt;w.view.decorator= FlowLayout(w.view.bounds, 10@10, 20@20);&lt;br /&gt;//w.view.background= Color.rand;&lt;br /&gt;&lt;br /&gt;//Buttons&lt;br /&gt;a= JSCButton(w,Rect(20,20,150,30));&lt;br /&gt;a.states= [ ["drumsON", emerald], ["OFF", highpink]];&lt;br /&gt;b= Ppar([kickp,hhp,snp,cyp]).play(clock, quant:1);&lt;br /&gt;a.action= { | state |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 0, {b.stop});&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 1, {b= Ppar([kickp,hhp,snp,cyp]).play(clock, quant:1); &lt;br /&gt;})};&lt;br /&gt;c= JSCButton(w,Rect(20,20,150,30));&lt;br /&gt;c.states= [ ["leadON"], ["OFF"] ];&lt;br /&gt;d= Ppar([melody]).play(clock, quant:12);&lt;br /&gt;c.action= { | state |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 0, { d.stop } );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 1, { d= Ppar([melody]).play(clock, quant:12) } ) };&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;e= JSCButton(w,Rect(20,20,150,30));&lt;br /&gt;e.states= [ ["bassON"], ["OFF"] ];&lt;br /&gt;f= baseline.play(clock, quant:12);&lt;br /&gt;e.action= { | state |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 0, { f.stop } );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(state.value == 1, { f= baseline.play(clock, quant:12) } ) };&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;w.front;&lt;br /&gt;w.onClose= {b.stop; d.stop; e.stop};&lt;br /&gt;&lt;br /&gt;//Sliders&lt;br /&gt;slider1= Slider2D(w,Rect(8,9,150,150));&lt;br /&gt;slider2= Slider2D(w,Rect(8,9,150,150));&lt;br /&gt;slider3= Slider2D(w,Rect(8,9,150,150));&lt;br /&gt;&lt;br /&gt;kickcs= ControlSpec(1,9,'linear',1,1);&lt;br /&gt;snarecs= ControlSpec(1,4,'linear',1,1);&lt;br /&gt;hatscs= ControlSpec(1,10,'linear',1,1);&lt;br /&gt;cymbalcs= ControlSpec(1,5,'linear',1,1);&lt;br /&gt;melodycs= ControlSpec(1,7,'linear',1,2);&lt;br /&gt;bubblecs= ControlSpec(-4,7,'linear',1,2);&lt;br /&gt;&lt;br /&gt;//Drum patterns&lt;br /&gt;kickpattern=&amp;nbsp; Pseq([1,0,0,0, 0,0,0,0, 0,0,1,0, 0,0,0,0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 1,0,0,0, 0,0,0,0, 0,0,1,1, 0,0,0,0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 1,0,0,0, 0,0,0,0, 0,0,1,0, 0,0,0,0,],inf);&lt;br /&gt;hatspattern=&amp;nbsp; Pseq([1,1,1,1, 1,0,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1],inf);&lt;br /&gt;snarepattern= Pseq([0,0,0,0, 1,0,0,0, 0,0,0,0, 1,0,0,0],inf);&lt;br /&gt;cypattern=&amp;nbsp;&amp;nbsp;&amp;nbsp; Pseq([0,0,0,0, 0,0,0,0, 0,0,1,0, 0,0,0,0, 0,0,1,0],inf);&lt;br /&gt;hatsdecay=&amp;nbsp;&amp;nbsp;&amp;nbsp; Pseq([1,1,3,1, 1,2,3,1, 1,3,1,1, 1,2,1,1],inf);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;kickp=&amp;nbsp;&amp;nbsp; Pbind(&amp;nbsp; \on,Pseq([kickpattern],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \kick,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,4,\filter,115,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \pitch,Pfunc({kickcs.map(slider1.x).postln}));&lt;br /&gt;hhp= &amp;nbsp;&amp;nbsp;&amp;nbsp; Pbind(&amp;nbsp;&amp;nbsp;&amp;nbsp; \on,Pseq([hatspattern],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \hats,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \decay,Pseq([hatsdecay],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,Pfunc({hatscs.map(slider2.x).postln}));&lt;br /&gt;snp= &amp;nbsp;&amp;nbsp;&amp;nbsp; Pbind( \on,Pseq([snarepattern],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \snare,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,Pfunc({snarecs.map(slider2.y).postln}),\pitch,5);&lt;br /&gt;cyp=&amp;nbsp;&amp;nbsp;&amp;nbsp; Pbind( \on,Pseq([cypattern],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \cymbal,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,1.5,\pitch,Pfunc({cymbalcs.map(slider1.y).postln})); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mela=&amp;nbsp;&amp;nbsp; Pseq([44,58,46,44,44,72,44,51],2);&lt;br /&gt;melb=&amp;nbsp;&amp;nbsp; Pseq([56,60,46,44,42,72,46,51],4);&lt;br /&gt;meld=&amp;nbsp;&amp;nbsp; Pseq([44,58,70,44,42,75,44,51],1);&lt;br /&gt;mele=&amp;nbsp;&amp;nbsp; Pseq([44,58,46,44,44,87,42,51],1);&lt;br /&gt;melc=&amp;nbsp;&amp;nbsp; Pseq([56,58,46,44,40,68,44,51],4);&lt;br /&gt;&lt;br /&gt;melody= Pbind( \instrument, \lead,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \note, Pseq([melb,mela,meld,mele,melc],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \length, Prand([0.5,0.66,0.75,1],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \filfreq,Pfunc({melodycs.map(slider3.x).postln}));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bassline= Pseq( [56,44,56,44,56,44,56,44] ++ 44.dup(4) ++ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [44,44] ++ [44,44] ++ [56,40,56,40,56,40,56,40]);&lt;br /&gt;&lt;br /&gt;baseline= Pbind(&amp;nbsp; \instrument, \bass,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \note, Pseq([bassline],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; \stretch,4);&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-3025113065380972538?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/3025113065380972538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/03/swingosc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/3025113065380972538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/3025113065380972538'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/03/swingosc.html' title=''/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-2491431752274198435</id><published>2010-02-28T12:30:00.000-08:00</published><updated>2010-02-28T12:30:33.966-08:00</updated><title type='text'>Drum sequencing with Patterns</title><content type='html'>&lt;span style="font-size: xx-small;"&gt;&lt;/span&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;This is v2 of my drum sequencer. It uses Patterns instead of a routine and therefore has a slightly more intuitve method of editing, as you can see the whole pattern laid out in a grid. There are randomised Patterns used to control the pitch of the cymbal and kick, and the decay on the hi-hat. The code could be neatened up a lot but there are way cooler things I could be doing...like...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;1. Integrating a GUI to control volume/pitch/decay of different drums.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;2. Create a way of selecting different patterns.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;3. Create a controller to put shuffle on the hi-hats.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;4. Make some GUI-editable laser sounds.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;5. Integrate a bassline synthesiser.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;6. Put some chords on top.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;7. Make an arpeggiator...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: xx-small;"&gt;// Kick Drum&lt;br /&gt;&lt;br /&gt;SynthDef(\kick,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, pitch= 1, filter= 1, on=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sin, pw, kik, kikfilter, volon;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= LFTri.ar(freq: Line.kr(40,20,0.1*decay,doneAction:2)*pitch,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add: 0, mul: 0.3*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pw= Pulse.ar(freq: 40, add: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: EnvGen.ar(Env.perc(0,0.07,0.3*volon)));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kik= Mix.new([sin,pw]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kikfilter= LPF.ar(in: kik, freq: XLine.kr(200,30,0.1*decay)*filter);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out.ar(0, kikfilter)}).store&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;// Snare Drum&lt;br /&gt;&lt;br /&gt;SynthDef(\snare,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, on= 0, decay= 1, pitch= 1, filter= 1, filter2= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filtap, volon, tri, snare, snaref, snaref2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filtap= EnvGen.ar(Env.perc(0,0.2*decay,0.2*volon,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= WhiteNoise.ar(mul: filtap, add: Line.kr(-3.5,2,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tri= Pulse.ar(freq: Line.kr(60*pitch,228,0.3,doneAction:2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: Line.kr(0.1,0.00,0.1)*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snare= noise+tri;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref= HPF.ar(in: snare, freq: Line.kr(800,200,0.22)*filter);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref2= LPF.ar(in: snaref, freq: Line.kr(600,1000,0.81)*filter2);&lt;br /&gt;Out.ar(0, snaref*on)}).store&lt;br /&gt;&lt;br /&gt;// Hi-hats&lt;br /&gt;&lt;br /&gt;SynthDef(\hats,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, on=0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filter, envel, menv,onvol;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; onvol= on*vol;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; menv= EnvGen.ar(Env.perc(0.3,0.01,1,4));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= PinkNoise.ar(mul: menv*onvol*7, add: Line.kr(0,0,0.03*decay,doneAction:2));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envel= EnvGen.ar(Env.adsr(0,0.2*decay,0.7,0.2,2900));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filter= HPF.ar(in: noise, freq: envel);&lt;br /&gt;Out.ar(0, filter)}).store&lt;br /&gt;&lt;br /&gt;// Other thing&lt;br /&gt;&lt;br /&gt;SynthDef(\cymbal,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 0.5, decay= 1, pitch= 1, on= 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sq1, sq2, volon;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volon= vol*on;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq1= Pulse.ar(freq: Line.kr(623*pitch,223,0.2*decay,doneAction:2)*pitch, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mul: 0.3*volon);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq2= Pulse.ar(add: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq:EnvGen.ar(Env.triangle(0.8*decay,300)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: 0.3*volon);&lt;br /&gt;Out.ar(0, sq1*sq2)}).store&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;var clock, &lt;br /&gt;hh, hhpatt, kd, kdpatt, sn, snpatt, cy, cypatt,&lt;br /&gt;cypitch, hhdecay, basspitch, snrdc;&lt;br /&gt;clock= TempoClock(8);&lt;br /&gt;kd= Pseq([1,0,0,0, 0,0,0,0, 0,0,1,0, 0,0,0,0],inf);&lt;br /&gt;hh= Pseq([1,1,1,1, 1,0,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1],inf);&lt;br /&gt;sn= Pseq([0,0,0,0, 1,0,0,0, 0,0,0,0, 1,0,0,0],inf);&lt;br /&gt;cy= Pseq([0,0,0,0, 0,0,0,0, 0,0,1,0, 0,0,0,0, 0,0,1,0],inf);&lt;br /&gt;&lt;br /&gt;cypitch= Pxrand([1,2,3,0.3, 1.2,0.6],inf);&lt;br /&gt;hhdecay= Pseq([1,1,2,1, 1,2,1,1, 1,3,1,1, 1,2,1,1],inf);&lt;br /&gt;basspitch= Pseq([2,2,3],inf);&lt;br /&gt;snrdc= Prand([1,1,1,1,1,1.3],inf);&lt;br /&gt;&lt;br /&gt;hhpatt= Pbind(&amp;nbsp;&amp;nbsp;&amp;nbsp; \on,Pseq([hh],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \hats,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \decay,Pseq([hhdecay],inf));&lt;br /&gt;kdpatt= Pbind(&amp;nbsp; \on,Pseq([kd],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \kick,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,4,\pitch,Pseq([basspitch],inf),\filter,115);&lt;br /&gt;snpatt= Pbind( \on,Pseq([sn],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \snare,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,Pseq([snrdc],inf),\pitch,5);&lt;br /&gt;cypatt= Pbind( \on,Pseq([cy],inf),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \instrument, \cymbal,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; \vol,1,\decay,1.5,\pitch,Pseq([cypitch],inf));&lt;br /&gt;&lt;br /&gt;Ppar([hhpatt,kdpatt,snpatt,cypatt]).play(clock); )&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-2491431752274198435?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/2491431752274198435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/drum-sequencing-with-patterns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/2491431752274198435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/2491431752274198435'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/drum-sequencing-with-patterns.html' title='Drum sequencing with Patterns'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-2532458557777613982</id><published>2010-02-28T04:35:00.000-08:00</published><updated>2010-02-28T04:35:06.195-08:00</updated><title type='text'>Using routines</title><content type='html'>I used a routine to sequence a pattern for the drum sounds that I made. It is however horribly longwinded to make or alter the pattern. I realise now that I could have assigned each different SynthDef to a letter variable, which would have shortened the code a bit, but the overall method is unintuitive and not very elegant. After a bit of research, I found code for a simple drum machine on this website: http://superdupercollider.blogspot.com/2009/02/simple-drum-machine.html. This uses the pattern mechanism and is a lot nicer!&lt;br /&gt;This is my code (using SynthDefs from the previous post):&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Routine.new({&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inf.do({ arg i;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var speed, speed2;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed=0.2;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed2= speed*2;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\kick,[\vol,4,\decay,2,\pitch,2,\filter,112]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,3]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\snare,[\vol,1,\decay,1,\pitch,5,\filter2,0]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\kick,[\vol,4,\decay,2,\pitch,2,\filter,2]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\cymbal);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,1]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\kick,[\vol,4,\decay,2,\pitch,1,\filter,112]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed2.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\snare,[\vol,1,\decay,1,\pitch,5,\filter2,0]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\hats,[\vol,3,\decay,2]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Synth(\cymbal,[\pitch,1.2]);&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; speed.wait;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;});}).play)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-2532458557777613982?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/2532458557777613982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/using-routines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/2532458557777613982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/2532458557777613982'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/using-routines.html' title='Using routines'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-5701243565659531162</id><published>2010-02-26T05:31:00.000-08:00</published><updated>2010-02-26T05:31:56.684-08:00</updated><title type='text'>Synthesising drums &amp; creating SynthDefs for them</title><content type='html'>&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;// Kick Drum&lt;br /&gt;&lt;br /&gt;({&lt;br /&gt;var sin, pw;&lt;br /&gt;&lt;br /&gt;sin= SinOsc.ar(freq: Line.kr(70,40,0.1,doneAction:2), &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; add: 0, mul: 0.3);&lt;br /&gt;pw= Pulse.ar(freq: 40, add: 0, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;mul: EnvGen.ar(Env.perc(0,0.07,0.2)));&lt;br /&gt;Mix.new([sin,pw]);&lt;br /&gt;}.play)&lt;br /&gt;&lt;br /&gt;SynthDef(\kick,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, pitch= 1, filter= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sin, pw, kik, kikfilter;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sin= LFTri.ar(freq: Line.kr(40,20,0.1*decay,doneAction:2)*pitch,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; add: 0, mul: 0.3*vol);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pw= Pulse.ar(freq: 40, add: 0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: EnvGen.ar(Env.perc(0,0.07,0.3*vol)));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kik= Mix.new([sin,pw]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; kikfilter= LPF.ar(in: kik, freq: XLine.kr(200,30,0.1*decay)*filter);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out.ar(0, kikfilter)}).load(s);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;a= Synth(\kick);&lt;br /&gt;b= Synth(\kick,[\vol,1,\decay,2,\pitch,2,\filter,2]);&lt;br /&gt;c= Synth(\kick,[\vol,1,\decay,4,\pitch,2,\filter,115]);&lt;br /&gt;d= Synth(\kick,[\vol,1,\decay,2,\pitch,9,\filter,10]);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Snare Drum&lt;br /&gt;&lt;br /&gt;SynthDef(\snare, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1, pitch= 1, filter= 1, filter2= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filtap, tri, snare, snaref, snaref2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filtap= EnvGen.ar(Env.perc(0,0.2*decay,0.2*vol,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= WhiteNoise.ar(mul: filtap, add: Line.kr(-3.5,2,1));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tri= Pulse.ar(freq: Line.kr(60*pitch,228,0.3,doneAction:2),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mul: Line.kr(0.1,0.00,0.1)*vol);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snare= noise+tri;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref= HPF.ar(in: snare, freq: Line.kr(800,200,0.22)*filter);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snaref2= LPF.ar(in: snaref, freq: Line.kr(600,1000,0.81)*filter2);&lt;br /&gt;Out.ar(0, snaref)}).play(s)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;e= Synth(\snare,[\vol,1,\decay,1.5,\pitch,5]);&lt;br /&gt;f= Synth(\snare,[\vol,1,\decay,1,\pitch,0,\filter,0.19]);&lt;br /&gt;g= Synth(\snare,[\vol,1,\decay,1,\pitch,5,\filter2,0]);&lt;br /&gt;&lt;br /&gt;// Hi-hats&lt;br /&gt;&lt;br /&gt;SynthDef(\hats,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 1, decay= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var noise, filter, envel, menv;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; menv= EnvGen.ar(Env.perc(0.3,0.01,1,4));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; noise= WhiteNoise.ar(mul: menv*vol*4, add: Line.kr(0,0,0.03*decay,doneAction:2));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envel= EnvGen.ar(Env.adsr(0,0.4*decay,0.7,0.2,2900));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filter= HPF.ar(in: noise, freq: envel);&lt;br /&gt;Out.ar(0, filter)}).play(s)&lt;br /&gt;&lt;br /&gt;h= Synth(\hats,[\vol,3,\decay,1]); &lt;br /&gt;i= Synth(\hats,[\vol,1,\decay,2]);&lt;br /&gt;&lt;br /&gt;// Cymbals...(not quite)&lt;br /&gt;&lt;br /&gt;SynthDef(\cymbal,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {arg vol= 0.5, decay= 1, pitch= 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var sq1, sq2;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq1= Pulse.ar(freq: Line.kr(623,223,0.2*decay,doneAction:2)*pitch, mul: 0.3*vol);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sq2= Pulse.ar(add: 0, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; freq:EnvGen.ar(Env.triangle(0.8*decay,300)), &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mul: 0.3*vol);&lt;br /&gt;Out.ar(0, sq1*sq2)}).play(s)&lt;br /&gt;&lt;br /&gt;j= Synth(\cymbal);&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Drum synthesis tutorials from 'The Dance Music Manual' -Snoman.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-5701243565659531162?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/5701243565659531162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/synthesising-drums-creating-synthdefs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/5701243565659531162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/5701243565659531162'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/synthesising-drums-creating-synthdefs.html' title='Synthesising drums &amp; creating SynthDefs for them'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-4605859266112613173</id><published>2010-02-15T12:56:00.000-08:00</published><updated>2010-02-15T14:27:54.987-08:00</updated><title type='text'>Arrays</title><content type='html'>&lt;div style="-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: white; background-image: initial; background-position: initial initial; background-repeat: initial; font: normal normal normal 13px/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.6em; padding-left: 0.6em; padding-right: 0.6em; padding-top: 0.6em;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;Defining arrays&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a = [1,3,5,7,9];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;#[1,3,5,7,9]&amp;nbsp;→ fixed array;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a= Array.fill(5, {arg i; i*2+1});&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a= Array.with(1,3,5,7,9);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a= Array.series(5,1,2);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;x= Array.geom(10,1,2)&amp;nbsp;→ [1,2,4,8,16,32,64,128,256,512];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;r= Array.rand(10,0,9)&amp;nbsp;→ Ten random numbers from 0 - 9;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;Modifying/accessing arrays&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a = a.add(11); → [1,3,5,7,9,11];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a.put(2,55); &amp;nbsp;→ &amp;nbsp;[1,3,55,7,9];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a[2] → 55;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;a.scramble&amp;nbsp;→ &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;[ 1, 3, 5, 7, 9 ]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 9.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[ 5, 9, 1, 3, 7 ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 9.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[ 7, 3, 9, 5, 1 ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 9.0px Monaco; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[ 7, 3, 9, 5, 1 ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Monaco, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: xx-small;"&gt;&lt;span class="Apple-style-span" style="font-size: 9px; line-height: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div style="color: #494949; font: 12.0px Verdana; line-height: 20.0px; margin: 0.0px 0.0px 14.0px 0.0px;"&gt;(var scr; &lt;br /&gt;a= Array.fill(5, {arg i; i*2+1});&lt;br /&gt;scr = {arg b; b.scramble};&lt;br /&gt;b = scr.value(a);&lt;br /&gt;c = scr.value(b);&lt;br /&gt;a.postln;b.postln;c.postln;)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;a.rotate(2);&amp;nbsp;→ [7,9,1,3,5] (rotates array around the given index);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;a;&amp;nbsp;→ [false,false,true,true,true];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;a.reverse&amp;nbsp;→ [9,7,5,3,1];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Example code&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="color: #494949; font-family: Verdana, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 12px; font-weight: bold; line-height: 20px;"&gt;({var stars, stars2, stars3, sky, waves, spacetime, heat, shine, shine2, shine3, sparkle;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #494949; font-family: Verdana, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 20px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: monospace, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"&gt;&lt;div style="color: #494949; font: normal normal normal 12px/normal Verdana; line-height: 20px; margin-bottom: 14px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;div style="color: #494949; font: 12.0px Verdana; line-height: 20.0px; margin: 0.0px 0.0px 14.0px 0.0px;"&gt;&lt;b&gt;x= SinOsc.ar(freq:3,mul:0.5);&lt;/b&gt;&lt;br /&gt;&lt;b&gt;waves= (Pan2.ar&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;(in: Resonz.ar&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;(in: WhiteNoise.ar(0.5), freq: SinOsc.ar(freq:0.5,mul:59,add: 200)),&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; pos: SinOsc.ar(freq:0.4, mul: 0.3)));&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #494949; font: 12.0px Verdana; line-height: 20.0px; margin: 0.0px 0.0px 14.0px 0.0px; min-height: 15.0px;"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;span class="Apple-style-span" style="white-space: normal;"&gt;shine= (Pan2.ar&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;(in: SinOsc.ar(freq: EnvGen.ar(Env.new(&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;[262,262,131,131,311,311,208,208,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;349,349,622,622,523,523,415,415,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;1865,1865,1047,1047,622,622,523,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;523,262,262,131,131,208,208,131,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;131,196,196,208,208,196,196,208,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;208,147,65],[0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;0.1, 0.1, 0.1,0.1,0.1,0.1,0.1,0.1,0.1,&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;0.1,0.1,0.1,0.1,0.1,0.3],'step')),&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;mul: 0.3),&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;pos:x));&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;shine2= (Pan2.ar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;(in: Saw.ar(freq: EnvGen.ar(Env.new(&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;[1865,1865,1047,1047,622,622,523,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;523,262,262,131,131,208,208,131,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;622,622,699,699,587,587,622,622,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;523,523,587,587,466,466,392,392,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;131,196,196,208,208,196,196,208,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;208,147,65],[0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;0.1, 0.1, 0.1,0.1,0.1,0.1,0.1,0.1,0.1,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;0.1,0.1,0.1,0.1,0.1,0.3],'step')),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;mul: 0.3),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pos:x));&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #494949; font: 12.0px Verdana; line-height: 20.0px; margin: 0.0px 0.0px 14.0px 0.0px; min-height: 15.0px;"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #494949; font: 12.0px Verdana; line-height: 20.0px; margin: 0.0px 0.0px 14.0px 0.0px;"&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shine3= (Pan2.ar&lt;/b&gt;&lt;br /&gt;&lt;b&gt;(in: Pulse.ar(freq: EnvGen.ar(Env.new(&lt;/b&gt;&lt;br /&gt;&lt;b&gt;[49,49,52,52,49,49,52,52,49,49,52,52,&lt;/b&gt;&lt;br /&gt;&lt;b&gt;49,49,52,52,49,49,52,52,49,49,52,52,&lt;/b&gt;&lt;br /&gt;&lt;b&gt;49,49,52,52,49,49,52,52],[0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,&amp;nbsp;0.1])),&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;mul: 0.7),&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pos:x));&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;stars= [523, 622, 1047, 1175];&lt;/b&gt;&lt;br /&gt;&lt;b&gt;stars2= [587, 466, 784, 8800];&lt;/b&gt;&lt;br /&gt;&lt;b&gt;stars3= [699, 294, 1568, 523];&lt;/b&gt;&lt;br /&gt;&lt;b&gt;heat= [x,x*0.7,x*2,x];&lt;/b&gt;&lt;br /&gt;&lt;b&gt;spacetime= Pulse.ar(freq:Line.kr(880,220,4,doneAction:2),mul:0.3);&lt;/b&gt;&lt;br /&gt;&lt;b&gt;sky= Array.fill(4,{arg i;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;SinOsc.ar(freq: stars.at(i),&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mul: heat.at(i),&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;add: 0)});&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;sparkle= HPF.ar(in: shine, freq: Line.kr(10,1000,4));&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="white-space: normal;"&gt;waves+Mix(sky)+spacetime+sparkle+shine2;}.play)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #494949; font: normal normal normal 12px/normal Verdana; line-height: 20px; margin-bottom: 14px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;in this patch i used arrays to assign frequency and volume levels. the different 'stars' variables store different chords that can be changed manually, hopefully ill work out how to do that automatically. i have been experimenting with different code layouts to find a style that is comfortable for me, and also with naming variables. naming variables adds a whole new dimension to it all. i like the idea of making SC poetry...supercollider forces you to have a totally different perspective on how music and sound is created, and its really inspiring. it turns all of the emotional impact of music into numbers, which are infinite....so theres endless creative possibilities to be explored!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;the swingOSC GUI stuff looks a bit lame but there seems to be a few people using it with processing, and the flosc project attempts to integrate supercollider with flash. but first i am going to start on my coursework...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Cool Stuff&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://peabody.sapp.org/class/st2/lab/notehz/ - frequency/pitch chart&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://www.benchun.net/flosc/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-4605859266112613173?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/4605859266112613173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/arrays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/4605859266112613173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/4605859266112613173'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/arrays.html' title='Arrays'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6362282027015388030.post-283624649052166847</id><published>2010-02-15T06:18:00.000-08:00</published><updated>2010-02-15T06:20:01.575-08:00</updated><title type='text'>Hello World</title><content type='html'>Previous blog posts are at &lt;a href="http://superkaleidoscope.wordpress.com/"&gt;http://superkaleidoscope.wordpress.com/&lt;/a&gt;.&lt;div&gt;Wordpress sucks!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6362282027015388030-283624649052166847?l=superkaleidoscope.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://superkaleidoscope.blogspot.com/feeds/283624649052166847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/283624649052166847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6362282027015388030/posts/default/283624649052166847'/><link rel='alternate' type='text/html' href='http://superkaleidoscope.blogspot.com/2010/02/hello-world.html' title='Hello World'/><author><name>Niadzi</name><uri>http://www.blogger.com/profile/11472988559710667507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
