From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #385 Reply-To: sc-users Sender: owner-sc-users-digest@lists.io.com Errors-To: owner-sc-users-digest@lists.io.com Precedence: bulk sc-users-digest Monday, November 26 2001 Volume 01 : Number 385 ---------------------------------------------------------------------- Date: Sat, 24 Nov 2001 23:48:49 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart >On 24/11/01 2:21 PM, "felix" wrote: > >> >> Well what kind of thing do you want to cause the restart ? a button ? >> another pattern ? >> >> i'm not sure why this is a difficult question, it seems simple. >> >> >> TSpawn.ar({ >> EnvGen.kr(env) * pattern.ar >> },trig) >> >> that restarts the thing each time. > >that's what i've been doing. the problem is that i have many, many, many >patterns that i want to load dynamically from files while the Synth engine >is running, and doing it like this requires many, many, many TSpawns. this >eventually adds too much cpu overhead for it to be worthwhile. >i've been switching patterns on and off using buttons (GUI, midi switches, >whatever). if you use a button to put nil in a stream (using Pswitch1), then >you've killed that stream and it makes no further demands on cpu. the >problem is the pattern from which that stream was created cannot make a new >stream without (1) killing and restarting synthesis, (2) using the kinds of >FuncStream::reset tricks that julian posted the other day (which also >incrementally tax the cpu as you add more patterns), or (3) using TSpawn. >there's a hole in the bucket, dear liza. you could also see if 'Parcel' and 'Plib' helps you. I'm always using it and I 'dynamically' write my code as I got fed up with sequencing as such. (http://swiki.hfbk.uni-hamburg.de:8080/MusicTechnology/324) to use it in sc2 I use Library3 that felix backported from sc3. - -- . ------------------------------ Date: Sat, 24 Nov 2001 17:44:28 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart On 24/11/01 4:47 PM, "James McCartney" wrote: > You should only need one. Your function should be able to choose a pattern. > Or alternatively, using 'triggerSynth', one TSpawn can spawn an unlimited > number of different functions. can you provide a short example using TSpawn and triggerSynth? perhaps just something using a couple of Synths. i've looked at a few things in the archive that use triggerSynth inside a Sequencer, but i don't really understand how it works. thanks. ------------------------------ Date: Sun, 25 Nov 2001 00:16:15 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart >On 24/11/01 4:47 PM, "James McCartney" wrote: > >> You should only need one. Your function should be able to choose a pattern. >> Or alternatively, using 'triggerSynth', one TSpawn can spawn an unlimited >> number of different functions. > >can you provide a short example using TSpawn and triggerSynth? perhaps just >something using a couple of Synths. i've looked at a few things in the >archive that use triggerSynth inside a Sequencer, but i don't really >understand how it works. >thanks. ( { a = TSpawn.ar(nil, 2); s = a.source; a }.play; ) s.triggerSynth(Synth.new({ Pbind(\freq, Pseq([2000, 300, 10000], inf), \dur, 0.1, \amp, 0.03).ar })); s.triggerSynth(Synth.new({ Pbind(\freq, Pseq([200, 3000, 1000], inf), \dur, 0.1, \amp, 0.03).ar })); - -- . ------------------------------ Date: Sun, 25 Nov 2001 05:53:12 -0800 From: MarkDavid <---@---.---> Subject: Re: Patterns and other tunnings Okay I solved the first problem on my own: ( Ppar([ Pbind( \dur, Pseq([0.28], inf), \midinote, Pseq([60, 52.9805, 56.8241,52.9805,57.9609,52.9805,56.8241, 52.9805,56.8241,52.9805,56.8241,57.9609], 4)+[0,5.2151,22.4301], \db, -16, \legato, 1) ], inf).play(Event.protoEvent, effects: { arg out; 3.do({ out = AllpassN.ar(out, 0.05, [0.04.rand, 0.04.rand], 3) }); out }); ) Any way to assign a value like 52.9805 a variable and use it in a pattern? ANy help is appreciated-MarkDavid on 11/24/01 11:25 AM, MarkDavid at markdavid@mdhosale.com wrote: > Dear SC-users: > I am currently working on an étude involving patterns and some quasi > extended Pythagorian tuning I developed. What I am hoping to do is simplify > how I reference my tuning system. What I am doing is using MIDI decimal > values to obtain the pitches I want in the patterns. For example, > 314.3056981 cycles per second (Hz) is equal to 63.176 in midi decimal > notation. But in my patterns I would rather refer to the pitch as e3 to save > time. > Also is it possible to make the first pattern from the examples below sound > like the second pattern by somehow replacing the tuning system. My instinct > tells me that there may be an elegant solution for all of my problems. Any > help is appreciated. Thanks-MarkDavid > > EXAMPLE 1 > > ( > Ppar([ > Pbind( > \dur, Pseq([0.28], inf), > \midinote, Pseq([60, 52.9805, 56.8241, 52.9805, 57.9609, 52.9805, > 56.8241, 52.9805, 56.8241, 52.9805,56.8241, 57.9609], 4)+[0,5], > \db, -16, > \legato, 1) > ], inf).play(Event.protoEvent, effects: { arg out; > 3.do({ out = AllpassN.ar(out, 0.05, [0.04.rand, 0.04.rand], 3) > }); > out > }); > ) > > > EXAMPLE 2 > > ( > Ppar([ > Pbind( > \dur, Pseq([0.28], inf), > \midinote, Pseq([60, 52.9805, 56.8241, 52.9805, 57.9609, 52.9805, > 56.8241, 52.9805, 56.8241, 52.9805, 56.8241, 57.9609], 4), > \db, -16, > \legato, 1), > Pbind( > \dur, Pseq([0.28], inf), > \midinote, Pseq([64.0782, 57.9609, > 62.0391,57.9609,62.0391,57.9609,62.0391,57.9609,62.0391,57.9609,62.0391,63.1 > 76], 4), > \db, -16, > \legato, 1) > ], inf).play(Event.protoEvent, effects: { arg out; > 3.do({ out = AllpassN.ar(out, 0.05, [0.04.rand, 0.04.rand], 3) > }); > out > }); > ) > - -- Experience After-Life on the Bardo Plane of Existence: http://www.mdhosale.com/BookOfTheDead ------------------------------ Date: Sun, 25 Nov 2001 06:03:09 -0800 From: MarkDavid <---@---.---> Subject: Re: Patterns and other tunnings Okay - never mind. I don't know why I couldn't get it to work before. I feel like I should start my own mailing list for myself-MD on 11/25/01 5:53 AM, MarkDavid at markdavid@mdhosale.com wrote: > Okay I solved the first problem on my own: > > ( > Ppar([ > Pbind( > \dur, Pseq([0.28], inf), > \midinote, Pseq([60, 52.9805, > 56.8241,52.9805,57.9609,52.9805,56.8241, > 52.9805,56.8241,52.9805,56.8241,57.9609], 4)+[0,5.2151,22.4301], > \db, -16, > \legato, 1) > ], inf).play(Event.protoEvent, effects: { arg out; > 3.do({ out = AllpassN.ar(out, 0.05, [0.04.rand, 0.04.rand], 3) > }); > out > }); > ) > > Any way to assign a value like 52.9805 a variable and use it in a pattern? > ANy help is appreciated-MarkDavid - -- Experience After-Life on the Bardo Plane of Existence: http://www.mdhosale.com/BookOfTheDead ------------------------------ Date: Sun, 25 Nov 2001 17:59:10 +0100 From: Fredrik Olofsson <---@---.---> Subject: Re: intervalles/inversion classes >Hi everyone, > >This Patch works and is simple but I am still unable to write it as a >class... > >From it, two 'collection type'classes could be created: > > One for calculating intervals between adjacent elements of an array > (this is to be used with frequencies so we need to know > if we are moving up or down). > > The second class would use such an interval (given as an array) for an >inversion of the original (changing direction). hi fabrice! if i understand you correctly you want to make two functions into methods for the Collection class, right? the following methods ported from pyrite may help you. differentiate is the same as your intervalles function and your inversion is simple with the integrate method (see d). add this to Collection.sc and recompile. //difference a list differentiate { var last=0; ^this.collect({arg item; var a; a=item-last; last=item; a}) } //sum a list integrate { var sum=0; ^this.collect({arg item; sum=sum+item}) } code for testing... ( a = [-2, 1, -1, 3, 5]; a.postln; 'original'.postln; ''.postln; b = a.differentiate; b.postln; 'intervals'.postln; ''.postln; c = b.integrate; c.postln; 'integrated intervals'.postln; ''.postln; d = a.differentiate.put(0,0).neg.integrate+a.at(0); d.postln; 'integrated inverted intervals'.postln; ''.postln; [ -2, 1, -1, 3, 5 ] original [ -2, 3, -2, 4, 2 ] intervals [ -2, 1, -1, 3, 5 ] integrated intervals [ -2, -5, -3, -7, -9 ] integrated inverted intervals ) best/fredrik - -- #| http://olofsson.da.ru |# ------------------------------ Date: Sun, 25 Nov 2001 14:05:46 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart thanks julian, james, felix. i've almost got something working based on julian's last post. the only thing i can't figure out is how to release the envelope in the Synth that contains an event stream at the same time that i put nil in that event stream. in the code below, streams are triggered and killed from buttons. i need the button action to release the enclosing Synth's envelope when the button is switched off (ie. button.value == 0). any ideas as to how this could be reworked? ( var numChannels, patterns, n, w, trigger, output, tspawn; numChannels = 2; patterns = [ Pbind(\degree, Pseq(#[0,1,2,3,4], inf)), Pbind(\degree, Pseq(#[9,8,7,6,5], inf)) ]; patterns = patterns.collect({ arg item, i; Pswitch1([nil, item], Pfunc({ w.at(i).value.asInt }) ) }); n = patterns.size; w = GUIWindow("", Rect.newBy(100,100,120,20+(n*20))); n.do({ arg i; ButtonView(w, Rect.newBy(20,10+(i*20),80,15), "pat"++(i+1).asString); w.at(i).backColor_(rgb(255,255,255)); w.at(i).action_({ w.at(i).toggle; if( w.at(i).value == 1, { trigger.value(patterns.at(i)); w.at(i).backColor_(rgb(255,176,176)); },{ w.at(i).backColor_(rgb(255,255,255)); }); }); }); trigger = { arg pat; tspawn.triggerSynth( Synth({ arg spawn, i, synth; var env; env = Env.asr(0, 1, 1, 1, 'linear'); EnvGen.kr(env) * pat.ar(Event.protoEvent, numChannels); }); ); }; Synth.play({ output = TSpawn.ar(nil, numChannels); tspawn = output.source; output; }); w.close; ) ------------------------------ Date: Sun, 25 Nov 2001 14:29:00 -0500 From: newton armstrong <---@---.---> Subject: Re: Patterns and other tunnings you might want to store your values in IdentityDictionaries. that way you could keep multiple banks of tunings where note names correspond to different frequencies, according to which bank you're referencing. otherwise, multiple variable assignment can be pretty useful for this kind of thing. eg. #a,b,c,d,e,f,g = #[57.0, 59.2354, 60.0239, 61.8765, 64.2343, 65.1234, 66.9856]; Pbind(\midinote, Pseq([a,b,c,d,e,f,g,a+12])).play On 25/11/01 9:03 AM, "MarkDavid" wrote: > Okay - never mind. I don't know why I couldn't get it to work before. I feel > like I should start my own mailing list for myself-MD > > > on 11/25/01 5:53 AM, MarkDavid at markdavid@mdhosale.com wrote: > >> Okay I solved the first problem on my own: >> >> ( >> Ppar([ >> Pbind( >> \dur, Pseq([0.28], inf), >> \midinote, Pseq([60, 52.9805, >> 56.8241,52.9805,57.9609,52.9805,56.8241, >> 52.9805,56.8241,52.9805,56.8241,57.9609], 4)+[0,5.2151,22.4301], >> \db, -16, >> \legato, 1) >> ], inf).play(Event.protoEvent, effects: { arg out; >> 3.do({ out = AllpassN.ar(out, 0.05, [0.04.rand, 0.04.rand], 3) >> }); >> out >> }); >> ) >> >> Any way to assign a value like 52.9805 a variable and use it in a pattern? >> ANy help is appreciated-MarkDavid ------------------------------ Date: Sun, 25 Nov 2001 20:58:16 -0500 From: felix <---@---.---> Subject: Re: Pattern restart in crucial speak: ( var output,patterns; f = FlowLayout.new; output=EnvdSpawn.new;//set Env, numChannels here Ar(output).topGui(f);//stop,start,record,tempo controls all mod cons. patterns = [ Pbind(\degree, Pseq(#[0,1,2,3,4], inf)), Pbind(\degree, Pseq(#[9,8,7,6,5], inf)) ]; patterns.do({ arg pb,i; var synth; ToggleButton(f, i, // name { // on func synth = output.triggerUgenFunc({ pb.ar }) }, {// off func synth.release; }) }); ) this did require me to modify EnvdSpawn so it returns the synth, but that's progress, right ? (or is it cheating ?) > From: newton armstrong <---@---.---> > Reply-To: sc-users@lists.io.com > Date: Sun, 25 Nov 2001 14:05:46 -0500 > To: > Subject: Re: Pattern restart > > > ( > var numChannels, patterns, n, w, trigger, output, tspawn; > > numChannels = 2; > > patterns = [ > Pbind(\degree, Pseq(#[0,1,2,3,4], inf)), > Pbind(\degree, Pseq(#[9,8,7,6,5], inf)) > ]; > > patterns = patterns.collect({ arg item, i; > Pswitch1([nil, item], Pfunc({ w.at(i).value.asInt }) ) > }); > > n = patterns.size; > > w = GUIWindow("", Rect.newBy(100,100,120,20+(n*20))); > n.do({ arg i; > ButtonView(w, Rect.newBy(20,10+(i*20),80,15), "pat"++(i+1).asString); > w.at(i).backColor_(rgb(255,255,255)); > w.at(i).action_({ > w.at(i).toggle; > > if( w.at(i).value == 1, { > trigger.value(patterns.at(i)); > w.at(i).backColor_(rgb(255,176,176)); > },{ > w.at(i).backColor_(rgb(255,255,255)); > }); > }); > }); > > trigger = { arg pat; > tspawn.triggerSynth( > Synth({ arg spawn, i, synth; var env; > env = Env.asr(0, 1, 1, 1, 'linear'); > EnvGen.kr(env) * pat.ar(Event.protoEvent, numChannels); > }); > ); > }; > > Synth.play({ > output = TSpawn.ar(nil, numChannels); > tspawn = output.source; > output; > }); > > w.close; > ) > > > ------------------------------ Date: Sun, 25 Nov 2001 21:26:37 -0500 From: felix <---@---.---> Subject: Re: Pattern restart newton does reply to me that he wants to cut the notes off immediately but trail the envelope off. so the toggle button becomes: ToggleButton(f, i, // name { // on func streamPlayer = EventStreamPlayer(pb); synth = output.triggerUgenFunc({ streamPlayer.ar }) }, {// off func streamPlayer.pause; // stop new notes as of now synth.release; // trail off the env }) an EventStreamPlayer is what is used by Pattern::ar to play (in crucial world that is, not in standard library). by getting an explicit reference to the streamPlayer we can tell it to pause, resume, step, stop etc. ------------------------------ Date: Sun, 25 Nov 2001 21:45:25 -0500 From: felix <---@---.---> Subject: CrucialLibrary 1.1.1 CrucialLibrary 1.1.1 http://crucial-systems.com/code/SuperCollider (1.1.0 lasted all of 5 minutes.) The purpose of the library is to offer useful tools to solve reoccuring problems in building SuperCollider things. This release introduces some new objects, improved old objects, improved documentation (thanks to Princeton for the excuse to clean up), improved examples (still needs more) I would like to again stress that there are many many objects that are useful by themselves without throwing yourself full force into any 'system'. examples: Ar - put this around any standard pattern for all mod cons SynthConsole - all mod cons for your ugenFunc StreamKr - use a pattern to create a kr signal for other synthesis SFP as easy as SFPloop( SFP(":Sounds:floating_1"), repeats: 100 ).play BeatClock logically defined beat synched trigs, minimal cpu Include just like C KeyDown globally register keystrokes to play functions ToggleButton on function, off function ActionButton do shit these are class file names, not classes. alterations to Common classes: Array Color Env IOStream Kernel Nil not required: useful but not nec. for the lib AbstractFunction ArrayedCollection Collection Dictionary Object SoundFile Symbol View AudioThings: BeatClock Clip Looper MonoSpawn NumChannels ReTrigger Splay Editors: ArrayEditor ArrayEditorGui EnvEditor EnvEditorGui NumberEditor NumberEditorGui PluggableArrayViewGui PluggableNumberView ControlSpecGui Spec ControlPrototypes experimental: sc3gui: see [ExperimentalLayout] FLayout Layout - HLayout VLayout Timeline: - for rec/play event sequences from keys,midi,wacom etc. AbsEventEncoderGui EventEncoder EventRecorder KAmpsEventEncoder MonoLoopedTimeline RPT RPTGateSeq RPTgui Timeline TimelineEvent TopSynth - rk/sc3 style top level spawn FileTools: Include NaN PathName PlayPathButton GuisForCommonObjects: EnvGui GuiTools: AbstractGui Action ActionButton FlowLayout KeyDown LabelledSliderView Menu ModalDialog RangeToggleGui SaveConsole SelectButtonSet SelectButtonSet2 SynthConsole TempoG Updater KernelTools: DebugFrameGui DictionaryInspector Exception ExceptionDisplay ObjectInspector StylizedLabels MLID: Library3 MLIDbrowser Patch: Instr InstrGui Patch PatchBox PatchBoxGui PatchGui PatternTools: BasicOpsStream Environment Event EventStreamPlayer EventStreamPlayerGui FastEvent FilterPatterns ListPatterns Patterns Players: AbstractPlayer AbstractPlayerGui ArGui BeatClockPlayerGui Blender BlenderGui CCPlugProxy CCPlugProxyGui ControlPlayer CropPlayer CropPlayerGui EnvPlayer EnvPlayerGui FunctionPlayer FunctionPlayerGui Kr ModalFreq ModalFreqGui PlayerMixer PlayerMixerGui PlayerPool PlayerPoolGui PlayerSeq PlayerSeqGui PlayerTransport PlayerTransportGui PlayerTransportTriggerGui SimpleTrigger SimpleTriggerGui SchedulingTools: QuantizedScheduler Tempo SFP: SFP SFPfunc SFPfuncGui SFPgui SFPLoop SFPLoopGui SFPPointEditor SFPSeq SFPSeqGui SFPTransport SFPTransportGui TZM: TPlugProxy TPlugProxyGui TZM TZMGui ------------------------------ Date: Sun, 25 Nov 2001 20:30:03 -0800 From: MarkDavid <---@---.---> Subject: Re: Patterns and other tunnings on 11/25/01 11:29 AM, newton armstrong at newton@silvertone.Princeton.EDU wrote: > you might want to store your values in IdentityDictionaries. that way you > could keep multiple banks of tunings where note names correspond to > different frequencies, according to which bank you're referencing. > otherwise, multiple variable assignment can be pretty useful for this kind > of thing. > > eg. > > #a,b,c,d,e,f,g = #[57.0, 59.2354, 60.0239, 61.8765, 64.2343, 65.1234, > 66.9856]; > > Pbind(\midinote, Pseq([a,b,c,d,e,f,g,a+12])).play I guess that I was looking for the IdentiyDictionary solution, but as you mentioned the multiple variable solution is elegant enough for me. I was having problems getting it to work at first because of a syntax problem. I had: Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4) When I should have had: Pseq([c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4) The other problem, as I mentioned before was with harmonization in a non-equal temperament type tuning. But, I realized that if I think of the tuning as a cent value and just move the decimal point so that: Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4)+[0,5] /*equal tempered 500 cent interval*/ becomes: Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4)+[0,5.2151] /*pythagorian 521.51 cent interval*/ Thanks, - -MarkDavid - -- Experience After-Life on the Bardo Plane of Existence: http://www.mdhosale.com/BookOfTheDead ------------------------------ Date: Mon, 26 Nov 2001 13:04:50 +0000 From: "Fabs Mogini" <---@---.---> Subject: Re: intervalles/inversion classes Very useful thanks... ...but what exactly is pyrite? Fabrice - ---------- >From: Fredrik Olofsson <---@---.---> >To: sc-users@lists.io.com >Subject: Re: intervalles/inversion classes >Date: Sun, Nov 25, 2001, 4:59 pm > > //difference a list > differentiate { var last=0; ^this.collect({arg item; var a; > a=item-last; last=item; a}) } > //sum a list > integrate { var sum=0; ^this.collect({arg item; sum=sum+item}) } > > > code for testing... > ( > a = [-2, 1, -1, 3, 5]; > a.postln; 'original'.postln; ''.postln; > b = a.differentiate; > b.postln; 'intervals'.postln; ''.postln; > c = b.integrate; > c.postln; 'integrated intervals'.postln; ''.postln; > > d = a.differentiate.put(0,0).neg.integrate+a.at(0); > d.postln; 'integrated inverted intervals'.postln; ''.postln; > > > [ -2, 1, -1, 3, 5 ] > original > > [ -2, 3, -2, 4, 2 ] > intervals > > [ -2, 1, -1, 3, 5 ] > integrated intervals > > [ -2, -5, -3, -7, -9 ] > integrated inverted intervals > > ) > > best/fredrik > -- > #| > http://olofsson.da.ru > |# ------------------------------ Date: Mon, 26 Nov 2001 13:53:45 +0000 From: "Fabs Mogini" <---@---.---> Subject: Re: Patterns and other tunnings Hi, You can use scale and degree. You can specify first your special scale (mine is just a stupid one so you will have to change it to your values) and then call simply the degree number (integers). To get some help on degree, scale and other arguments that Event understand, do apple-y on the word: Event Fabrice Mogini //////////////////////////////////////////// ( var myscale; myscale = #[0, 1.5, 4, 5.25, 6.66, 8, 10.25]; Synth.play({ Pbind( \dur,0.6, \degree, Pseq([0,1,2,3,4,5,6,7],inf), \scale, myscale, \ugenFunc, {arg freq,dur,amp, pan; var e; e = Env.linen(0.04, dur, 0.05, 0.3); EnvGen.ar(e,SinOsc.ar(freq)) } ).asSpawn; }) ) //////////////////////////////////////////// - ---------- >From: MarkDavid <---@---.---> >To: >Subject: Re: Patterns and other tunnings >Date: Mon, Nov 26, 2001, 4:30 am > > on 11/25/01 11:29 AM, newton armstrong at newton@silvertone.Princeton.EDU > wrote: > >> you might want to store your values in IdentityDictionaries. that way you >> could keep multiple banks of tunings where note names correspond to >> different frequencies, according to which bank you're referencing. >> otherwise, multiple variable assignment can be pretty useful for this kind >> of thing. >> >> eg. >> >> #a,b,c,d,e,f,g = #[57.0, 59.2354, 60.0239, 61.8765, 64.2343, 65.1234, >> 66.9856]; >> >> Pbind(\midinote, Pseq([a,b,c,d,e,f,g,a+12])).play > I guess that I was looking for the IdentiyDictionary solution, but as you > mentioned the multiple variable solution is elegant enough for me. > I was having problems getting it to work at first because of a syntax > problem. I had: > Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4) > > When I should have had: > Pseq([c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4) > > The other problem, as I mentioned before was with harmonization in a > non-equal temperament type tuning. But, I realized that if I think of the > tuning as a cent value and just move the decimal point so that: > Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4)+[0,5] /*equal tempered 500 cent > interval*/ > becomes: > Pseq(#[c3, g3,eb3,f3,g3,eb3,g3,eb3,g3], 4)+[0,5.2151] /*pythagorian 521.51 > cent interval*/ > Thanks, > -MarkDavid > > > -- > Experience After-Life on the Bardo Plane of Existence: > http://www.mdhosale.com/BookOfTheDead > ------------------------------ Date: Mon, 26 Nov 2001 12:16:33 -0500 From: felix <---@---.---> Subject: Re: intervalles/inversion classes pyrite is where SC came from. it was/is a 'scripting' language that runs inside of max. > From: "Fabs Mogini" <---@---.---> > Reply-To: sc-users@lists.io.com > Date: Mon, 26 Nov 2001 13:04:50 +0000 > To: sc-users@lists.io.com > Subject: Re: intervalles/inversion classes > > Very useful thanks... > ..but what exactly is pyrite? > > Fabrice ------------------------------ Date: Mon, 26 Nov 2001 18:24:23 +0100 From: Julian Rohrhuber <---@---.---> Subject: Re: Pattern restart > ( { a = TSpawn.ar(nil, 2); s = a.source; a }.play; ) s.triggerSynth(y = Synth.new({ Pbind(\freq, Pseq([2000, 300, 10000], inf), \dur, 0.1, \amp, 0.03).ar *EnvGen.kr(Env.asr(0.002, 1, 1)) })); s.triggerSynth(x = Synth.new({ Pbind(\freq, Pseq([200, 3000, 1000], inf), \dur, 0.1, \amp, 0.03).ar *EnvGen.kr(Env.asr(0.002, 1, 1)) })); x.release; y.release; - -- . ------------------------------ Date: Mon, 26 Nov 2001 09:46:46 -0800 From: MarkDavid <---@---.---> Subject: Re: Patterns and other tunnings Okay this clears up some things. Thanks-markdavid on 11/26/01 5:53 AM, Fabs Mogini at fabs.mogini@virgin.net wrote: > Hi, > > You can use scale and degree. > > You can specify first your special scale > (mine is just a stupid one so you will have to change it to your values) > and then call simply the degree number (integers). > > To get some help on degree, scale and other arguments > that Event understand, do apple-y on the word: Event > > Fabrice Mogini > > //////////////////////////////////////////// > ( > var myscale; > myscale = #[0, 1.5, 4, 5.25, 6.66, 8, 10.25]; > > Synth.play({ > > Pbind( > \dur,0.6, > \degree, Pseq([0,1,2,3,4,5,6,7],inf), > \scale, myscale, > \ugenFunc, {arg freq,dur,amp, pan; var e; > e = Env.linen(0.04, dur, 0.05, 0.3); > EnvGen.ar(e,SinOsc.ar(freq)) > } > ).asSpawn; > > }) > ) > //////////////////////////////////////////// - -- Experience After-Life on the Bardo Plane of Existence: http://www.mdhosale.com/BookOfTheDead ------------------------------ Date: Mon, 26 Nov 2001 19:04:55 -0500 From: newton armstrong <---@---.---> Subject: Re: Pattern restart thanks julian and felix. julian, i'm still trying to merge what i'm attempting to do with your solution. i want the TSpawn triggers to create themselves according to the number of Patterns that live in an Array. that is, i don't want to have to write tspawn.triggerSynth 100 times if i'm dealing with 100 Patterns. the problem is, the trigger function requires that the Synth be assigned to a variable in order for its envelope to be released at a later stage. there's no easy way (as far as i can tell) to do, say, 100 different variable assignments within a do statement. and i'm pretty sure you can't put the Synths in any kind of Collection to index from the trigger function, which means i'm stuck writing w.at(blah).action (see below) with associated trigger function for as many patterns as i choose to deal with. i'm sure there's some entirely straightforward way to do move w.at(blah).action in to the immediately preceding n.do statement (where of course it would become w.at(i).action), but i can't figure it out... ( var patterns, n, env, w, output, tspawn; patterns = [ Pbind(\freq, Pseq(#[2000, 300, 10000], inf), \dur, 0.1, \amp, 0.03), Pbind(\freq, Pseq(#[200, 3000, 1000], inf), \dur, 0.1, \amp, 0.03) ]; patterns = patterns.collect({ arg item, i; Pswitch1([nil, item], Pfunc({ w.at(i).value.asInt }) ); }); n = patterns.size; env = Env.asr(0.002, 1, 1); w = GUIWindow("", Rect.newBy(100,100,120,20+(n*20))); n.do({ arg i; ButtonView(w, Rect.newBy(20,10+(i*20),80,15), "pat"++(i+1).asString); w.at(i).backColor_(rgb(255,255,255)); }); w.at(0).action_({ w.at(0).toggle; if( w.at(0).value == 1, { tspawn.triggerSynth(x = Synth({ patterns.at(0).ar * EnvGen.kr(env) })); w.at(0).backColor_(rgb(255,176,176)); },{ x.release; w.at(0).backColor_(rgb(255,255,255)); }); }); w.at(1).action_({ w.at(1).toggle; if( w.at(1).value == 1, { tspawn.triggerSynth(y = Synth({ patterns.at(1).ar * EnvGen.kr(env) })); w.at(1).backColor_(rgb(255,176,176)); },{ y.release; w.at(1).backColor_(rgb(255,255,255)); }); }); Synth.play({ output = TSpawn.ar(nil, 2); tspawn = output.source; output }); w.close; ) ------------------------------ End of sc-users-digest V1 #385 ******************************