From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #50 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 Wednesday, July 14 1999 Volume 01 : Number 050 ---------------------------------------------------------------------- Date: Sun, 4 Jul 1999 09:48:44 -0600 From: James McCartney <---@---.---> Subject: Re: Songs within a song At 4:04 AM -0600 7/4/99, crucial wrote: >>f) >>This is much more efficient. >> >> sound * EnvGen.ar(env) >> >>The way you do it above causes two EnvGens to be created due to >>multichannel expansion. >>Using a kr envelope is even better. > >Really ? I was thinking that a * would involve a binop ugen in addition >to the two ugens involved. by inserting the sound as the multiply, I >thought >I was saving a ugen ! Your method creates: [EnvGen.ar(env,...,sound), EnvGen.ar(env,...,sound)] mine creates: x = EnvGen.ar(env); [x * sound, x * sound] You are right that yours has fewer UGens, but lower UGen count is not necessarily better. EnvGen is much more expensive than *, and EnvGen's in your method still have to do a * internally via the mul input. >>i) >> \note,Pstutter(1,Pseq(tonerows.choose,inf)), >> >>You do realize that this chooses only one tone row to be played >>per interpreter session (i.e. from press enter to press cmd period). >>That choose only executes once and that Pseq gets created with that row. > >Yes I did. Which brings me to the other question I was going to ask : > >Many times I have wanted to do something like this : > >tonerows=#[ > [ 8, 0, 4, 13, 4, 10, 5, 9 ], > [ 8, -2, 4, 13, 4, 10, 5, 7 ], > [ 8, 0, 5, 15, 4, 8, 4, 4 ], > [ 10, -1, 17, 8, -2, 6, 3, 6 ], > [ 9, 2, 19, 9, 0, 6, 3, 6 ] >]; > > >Pseq(Pstutter(16,Pfunc({tonerows.choose}),inf)) Look at Iannis' Pstream example several messages back. (Though, Iannis, you should try to think of a more descriptive or at least different name I think, since ALL patterns return streams..) >As per your modified example: >This will work, but I still want to find a way to have the pattern >be a part of the event stream tree of other patterns, but have its 'audio' >more >independent. Not sure what you mean. Passing patterns to events is the way to do voice level internal phrasing. >It stays in sync to play it 'elsewhere' as asSpawn or >ugenFunc, >but it would be better compositionally for me if it were reacting with >duration, >state changes, streams and all that. If you want to pass down the event info inside your ugenFunction, Then don't use the protoEvent for the subpattern, make a copy of the currentEnvironment and pass that down, since that is your current event and has all the info for duration and tempo, etc. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 5 Jul 1999 10:19:46 +0100 From: finer@easynet.co.uk Subject: MIDI out Has anyone had any luck sending midi out out of the computer. I can get QT musical instruments working no problem. Cheers, Jem ------------------------------ Date: Mon, 5 Jul 1999 11:44:28 -0400 (EDT) From: "Ronald J. Kuivila" <---@---.---> Subject: Re: Testing MIDIOut(Re: version 2.1.6 available) How about a version of MIDIWrite that supports arbitrarily long lists of data? (It would be handy for sysex nonsense, for example programming an I Cube.) RJK ------------------------------ Date: Mon, 5 Jul 1999 13:42:17 -0400 (EDT) From: Tecumseh Fitch <---@---.---> Subject: Graphics in SC 2? Are the basic graphics capabilities (drawing lines, framing rects, etc.) that were present in SC 1 still present in SC2? * Wm. Tecumseh Fitch, Ph.D. ************************************************** * Post-doctoral Fellow, Harvard/MIT Speech & Hearing Sciences Program * Rm 982 Wm. James Hall, 33 Kirkland St. Cambridge MA 02138 * (617) 496-6575 (ofc), (617) 496-8355 (fax), tec@wjh.harvard.edu ************ ------------------------------ Date: Mon, 5 Jul 1999 19:02:31 +0100 From: finer@easynet.co.uk Subject: where to put synth arg Trying to make a set of patches for Main in which trying to use synth.repeat in a patch, eg : r = [ {// rhythm + sine, based on example 'making rhythms out of sampled voice' arg sp,i,synth; var t,pat,rate; t = LFPulse.ar(8); // use a pulse wave as a trigger Mix.arFill(8, { rate = exprand(0.4, 2.5); rate = Plug.kr(exprand(0.4, 2.5), 0); pat = `scramble([1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0]); synth.repeat(4, 4, { if (0.7.coin, { pat.value = pat.value.scramble; rate.source = exprand(0.4, 2.5); }); }); Decay2.ar( ImpulseSequencer.ar(pat, t), 0.001, 0.25,SinOsc.ar(rate*100)) }); } ]; j = r.size.rand * 4; Synth.scope({XFadeTexture.ar({r.at(r.size.rand).value},10,5,2)}); } - ----------------- - - I get the error message 'repeat' not understood. If I put arg sp,i,synth in XFadeTexture - XFadeTexture.ar({arg sp,i,synth; r.at(r.size.rand).value},10,5,2) I get an error because synth not understood. What's the trick ? ! Thanks, Jem ------------------------------ Date: Mon, 05 Jul 1999 20:43:06 +0200 From: julian rohrhuber <---@---.---> Subject: time in patterns as far as I can see, protoEvent has a similar time concept like Spawn, using \dur as distributing parameter. is there anything like TSpawn for patterns? ------------------------------ Date: Mon, 5 Jul 1999 14:28:14 -0600 From: James McCartney <---@---.---> Subject: Re: time in patterns At 12:43 PM -0600 7/5/99, julian rohrhuber wrote: >as far as I can see, protoEvent has a similar time concept like Spawn, >using \dur as distributing parameter. >is there anything like TSpawn for patterns? Patterns are inherently sequential. What exactly do you want to do? Give me a scenario. You can easily put a pattern inside a TSpawn. ( var pattern, stream, ugenFunc, envelope, table, protoEvent; envelope = Env.adsr(0.005, 0.1, 0.5, 0.8) ; table = Wavetable.sineFill(512, 1.0/[1, 2, 3, 4]); ugenFunc = { arg freq, amp; COsc.ar(table, freq, 1, EnvGen.kr(envelope, 1, 0, amp)) }; pattern = Pbind( // bind names to value patterns \ugenFunc, ugenFunc, \sustain, 0.125, \degree, Pseq(#[0, 2, 4, [7, 9], 6, 5, 4, 2], inf); ); Synth.play({ stream = pattern.asEventStream; TSpawn.ar({ arg spawn, i, innersynth; // this code was hacked out of // Pattern asSpawn and modified. var event; event = stream.next; if (event.isNil, { spawn.stop; nil },{ event.use({ var freqs; freqs = ~freq; if ( freqs.isKindOf(Symbol), { nil },{ innersynth.releaseTime = ~sustain; innersynth.channelOffset = ~chanOffset; if (freqs.isKindOf(SequenceableCollection), { // mix chords Mix.arFill(freqs.size, { arg i; var freq; ~freq = freqs.at(i); ~ugenFunc.valueEnvir; }); },{ ~ugenFunc.valueEnvir; }); }); }); }); }, 2, nil, Dust.kr(MouseX.kr(0.3, 20, \exponential)) // trigger ); }); ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 5 Jul 1999 16:05:58 -0600 From: James McCartney <---@---.---> Subject: bug in FilterPatterns I have discovered a bug in FilterPatterns. The problem is that FilterPatterns modify events on their way down, but the pattern they are modifying might return nil, so the unmodified event needs to be given to the next process. Unfortunately the FilterPattern has already modified it. So the event needs to be copied and saved before the filter trashes it. The audible effect of this bug was that the next event after a FilterPattern finished had parameters from the previous event. The fix is below. Replace this class in FilterPatterns.sc : FilterPattern : Pattern { var <<>pattern; *new { arg pattern; ^super.new.pattern_(pattern) } embedInStream { arg inval; var stream, outval, saveEvent; stream = this.asStream; while ({ saveEvent = inval.copy; outval = stream.value(inval); outval.notNil },{ inval = outval.yield; }); ^saveEvent } } --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Mon, 5 Jul 1999 17:09:17 -0600 From: James McCartney <---@---.---> Subject: Re: Graphics in SC 2? At 11:42 AM -0600 7/5/99, Tecumseh Fitch wrote: >Are the basic graphics capabilities (drawing lines, framing rects, etc.) >that were present in SC 1 still present in SC2? No. There are a number of issues involved, so I have not done it yet. QuickDraw calls are illegal from interrupt level. They'd have to be FIFO'ed up asynchronously. If you FIFO'ed up raw QuickDraw commands then they would not get updated properly when the window was obscured and revealed. To do that you would have to define graphical objects via a set of methods. The graphic objects could not be SC objects, because the GUI cannot access SC objects since they are living at interrupt level and might have been garbage collected. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Mon, 5 Jul 1999 21:28:10 -0600 From: James McCartney <---@---.---> Subject: Re: where to put synth arg At 12:02 PM -0600 7/5/99, finer@easynet.co.uk wrote: >Trying to make a set of patches for Main in which trying to use >synth.repeat in a patch, eg : > >r = [ >{// rhythm + sine, based on example 'making rhythms out of sampled voice' > >arg sp,i,synth; You are calling this function below with: r.at(r.size.rand).value Since you are not passing it any params it is not getting any. Rewrite it so that this function gets passed the synth as a param: r = [ { arg synth; var t,pat,rate; ... and then below: Synth.scope({ XFadeTexture.ar({ arg spawn, i, synth; // get the args passed in // !!Pass the synth arg to your function!! : r.at(r.size.rand).value(synth) },10,5,2) }); - ----- Howver you have other problems going on here.. You need to define "pat" and "rate" inside the Mix.arFill so that each voice gets its own copy. Otherwise they are all sharing one copy of the variable that they are each writing over. change: var t,pat,rate; t = LFPulse.ar(8); // use a pulse wave as a trigger Mix.arFill(8, { rate = exprand(0.4, 2.5); to: var t; t = LFPulse.ar(8); // use a pulse wave as a trigger Mix.arFill(8, { var pat,rate; rate = exprand(0.4, 2.5); (And since you are no longer using PlayBuf, I'd rename "rate" to "freq"..) /------------ Here's my reworking with a few changes.. ( r = [ { arg synth; var t; // rhythm + sine, based on example // 'making rhythms out of sampled voice' t = LFPulse.ar(8); // use a pulse wave as a trigger Mix.arFill(8, { var pat,freq; freq = Plug.kr(exprand(40, 250), 0); pat = `scramble([1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0]); synth.repeat(4, 4, { if (0.7.coin, { pat.value = pat.value.scramble; freq.source = exprand(40, 250); }); }); Pan2.ar( Decay2.ar( ImpulseSequencer.ar(pat, t), 0.009, 0.25, SinOsc.ar(freq, 0, 0.2) ), 1.0.rand2 ); }) } ]; Synth.scope({ XFadeTexture.ar({ arg spawn, i, synth; // get the args passed in // !!Pass the synth arg to your function!! : r.at(r.size.rand).value(synth) },10,5,2) }, 2); ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Tue, 6 Jul 1999 15:27:39 +0800 From: Mark Ballora <---@---.---> Subject: saving a list to a file Now, haven't I seen a way to do this? I can't seem to find an example of it. I want to move a slider around, save the values (OK, I got that far), and then save the list of values as a file. Like so: ( // Poll the slider, save the results into a list var sliderValues, nBox, vSlider, arrayValues; var w; sliderValues=List.new(0); w = GUIWindow.new("panel", Rect.newBy( 128, 64, 400, 400 )); vSlider=SliderView.new( w, Rect.newBy( 14, 19, 128, 20 ), "SliderView", 0.25, 0, 1, 0, 'linear'); nBox=NumericalView.new( w, Rect.newBy( 148, 19, 64, 20 ), "NumericalView", 0.25, -1e+10, 1e+10, 0, 'linear'); vSlider.action = { nBox.value = vSlider.value }; nBox.action = { vSlider.value = nBox.value }; Synth.play({ arg synth; synth.trepeat(0.1, 0.1, { var currentValue; currentValue = vSlider.poll; sliderValues.add(currentValue); }); // Add a silent Ugen as a placeholder, so the .play method // works properly SinOsc.ar(0,0,0); }); arrayValues=sliderValues.asArray; sliderValues.putFile; // HOW DO I DO THIS PROPERLY? w.close; ) ------------------------------ Date: Tue, 06 Jul 1999 16:31:15 +0200 From: julian rohrhuber <---@---.---> Subject: Re: time in patterns exactly what I needed to understand, thank you! I have added the method asTSpawn to Patterns.sc, but I seem not to know how to use it now... asTSpawn { arg protoEvent, channels, trig; var stream; stream = this.asEventStream(protoEvent); ^TSpawn.ar({ arg spawn, i, innersynth; var event; event = stream.next; if (event.isNil, { spawn.stop; nil },{ event.use({ var freqs; freqs = ~freq; if ( freqs.isKindOf(Symbol), { nil },{ innersynth.releaseTime = ~sustain; innersynth.channelOffset = ~chanOffset; if (freqs.isKindOf(SequenceableCollection), { // mix chords Mix.arFill(freqs.size, { arg i; var freq; ~freq = freqs.at(i); ~ugenFunc.valueEnvir; }); },{ ~ugenFunc.valueEnvir; }); }); }); }); }, 2, nil, trig // trigger ); } >Patterns are inherently sequential. >What exactly do you want to do? Give me a scenario. >You can easily put a pattern inside a TSpawn. ------------------------------ Date: Tue, 06 Jul 1999 18:33:18 +0200 From: Staffan Liljegren <---@---.---> Subject: Re: where to put synth arg James, Is this a good way of having individual duration envelopes on the partials in additive synthesis ? I know You have touted "put the Env outside....", but I couldn't think of any other way of doing it. I started out with a cheap Klang version (yes I should move the envelope outside the bell instrument ...) and then I did a Mix of FSinOsc's with individual duration envelopes on the partials. It seems to sound right (and it works in patterns), but it seems a bit expensive in CPU. - -Staffan // Additive synthesis of bells // ( var bell, pattern1, pattern2, pattern3; // a church bell (by Risset, described in Dodge 1997) bell = {arg freq=440, amp=0.1, dur=4.0; var pamps, pdurs, pfreqs, cpfreqs,e; e = Env.perc(0.01, dur, 1, -4); //non-harmonic partials pfreqs = freq * [0.56, 0.56, 0.92, 0.92, 1.25, 1.7, 2, 2.74, 3, 3.76, 4.07] + // add slow beating on lower partials [0, 1, 0, 1.7, 0, 0, 0, 0, 0, 0, 0]; pamps = amp/11 * [1, 0.67, 1, 1.8, 2.67, 1.67, 1.46, 1.33, 1.33, 1, 1.33]; pdurs = dur * [1, 0.9, 0.65, 0.55, 0.325, 0.35, 0.25, 0.2, 0.15, 0.1, 0.075]; // Try these for a tubular bell! cpfreqs = freq * [0.24, 0.64, 1.23, 2, 2.91, 3.96, 5.12, 6.37]; // 1st try: "cheat" with same duration envelope for all partials //Klang.ar(`[ pfreqs ,pamps, 0],1,0,EnvGen.ar(e)); // 2nd try: individual duration envelopes per partial Mix.arFill(pfreqs.size, {arg i; EnvGen.ar(Env.perc(0.01, pdurs@i, 1,-4), FSinOsc.ar( pfreqs @ i,pamps @ i))}) }; //Synth.play({ // bell.value(220+440.rand,0.2+0.6.rand, 5) //}) pattern1 = Pbind( // bind names to value patterns \ugenFunc, bell, \octave, 6, \dur, Prand([ Pseq(#[2],4), Pseq(#[4],2), 8], inf), \degree, Pseq(#[0, 4, 7, 5, 2], inf), \amp, Prand([0.1,0.3], inf); ); pattern2 = Pbind( // bind names to value patterns \ugenFunc, bell, \octave, 5, \dur, Prand([ Pseq(#[4],4), 16], inf), \degree, Pseq(#[0, 7, 6, 5, 4,3,2,1], inf), \amp, Prand([0.1,0.3], inf); ); pattern3 = Ptpar([0.0, pattern2, 1.0, pattern1], inf); pattern3.play( Event.protoEvent, // make a prototype event 2 // two channels ); ) ------------------------------ Date: Tue, 6 Jul 1999 12:18:37 -0600 From: James McCartney <---@---.---> Subject: Re: time in patterns At 8:31 AM -0600 7/6/99, julian rohrhuber wrote: >exactly what I needed to understand, thank you! >I have added the method asTSpawn to Patterns.sc, but I seem not to know how >to use it now... Use it where ever you would use a TSpawn. myPat = Pblah( ... ); protoEvent = Event.protoEvent; Synth.play({ trig = ...; myPat.asTSpawn(protoEvent, 2, trig); }); --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Tue, 6 Jul 1999 12:46:03 -0600 From: James McCartney <---@---.---> Subject: Re: where to put synth arg At 10:33 AM -0600 7/6/99, Staffan Liljegren wrote: >James, > >Is this a good way of having individual duration envelopes on the >partials in additive synthesis ? I know You have touted "put the >Env outside....", but I couldn't think of any other way of doing it. > >I started out with a cheap Klang version (yes I should move the >envelope outside the bell instrument ...) and then I did a Mix of >FSinOsc's with individual duration envelopes on the partials. > >It seems to sound right (and it works in patterns), but it seems a bit >expensive in CPU. This saves some CPU. I moved as much as possible out of the instrument and used a kr envelope. // Additive synthesis of bells // ( var bell, pattern1, pattern2, pattern3; var pamps, pdurs, pfreqs, pdetune, cpfreqs; pfreqs = #[0.56, 0.56, 0.92, 0.92, 1.25, 1.7, 2, 2.74, 3, 3.76, 4.07]; // add slow beating on lower partials pdetune = #[0, 1, 0, 1.7, 0, 0, 0, 0, 0, 0, 0]; pamps = #[1, 0.67, 1, 1.8, 2.67, 1.67, 1.46, 1.33, 1.33, 1, 1.33]; pdurs = #[1, 0.9, 0.65, 0.55, 0.325, 0.35, 0.25, 0.2, 0.15, 0.1, 0.075]; // Try these for a tubular bell! cpfreqs = #[0.24, 0.64, 1.23, 2, 2.91, 3.96, 5.12, 6.37]; // a church bell (by Risset, described in Dodge 1997) bell = { arg freq=440, amp=0.1, dur=4.0, pan=0.0; var out; // 2nd try: individual duration envelopes per partial out = Mix.arFill(pfreqs.size, { arg i; FSinOsc.ar( pfreqs.at(i) * freq + pdetune.at(i), EnvGen.kr( Env.perc(0.01, pdurs.at(i) * dur, 1,-4), pamps.at(i) * (amp/11) ) ) }); Pan2.ar(out, pan); }; pattern1 = Pbind( // bind names to value patterns \ugenFunc, bell, \octave, 6, \dur, Prand([ Pseq(#[2],4), Pseq(#[4],2), 8], inf), \degree, Pseq(#[0, 4, 7, 5, 2], inf), \amp, Prand([0.1,0.3], inf), \pan, -1 ); pattern2 = Pbind( // bind names to value patterns \ugenFunc, bell, \octave, 5, \dur, Prand([ Pseq(#[4],4), 16], inf), \degree, Pseq(#[0, 7, 6, 5, 4,3,2,1], inf), \amp, Prand([0.1,0.3], inf), \pan, 1 ); pattern3 = Ptpar([0.0, pattern2, 1.0, pattern1], inf); pattern3.play( Event.protoEvent, // make a prototype event 2 // two channels ); ) --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: < ------------------------------ Date: Wed, 7 Jul 1999 11:05:57 +0800 From: Mark Ballora <---@---.---> Subject: saving a list to a file Mark Ballora wrote: >Now, haven't I seen a way to do this? I can't seem to find an example of it. > >I want to move a slider around, save the values (OK, I got that far), and >then >save the list of values as a file. Like so: Mark -- Try looking at UDFile in GUIUtils. It does exactly what you're asking about. Mark ------------------------------ Date: Wed, 7 Jul 1999 23:08:58 -0600 From: James McCartney <---@---.---> Subject: out of town. I will be in San Francisco for a few days, then back here for a few days and then back in San Francisco. I will still be checking email, but will not be able to reply with my usual code examples... Reminder: on July 19th begins the SuperCollider nite skool at CNMAT. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 7 Jul 1999 22:19:36 -0700 From: M Stevens <---@---.---> Subject: apparently I'm missing something here... I'm having trouble getting pitch bend to work with Voicer. The closest I can get is this; { var bend; bend = MIDIPitchBend.kr( 1, -3, 3 ); Voicer.ar( { arg voicer, i, synth, deltaTime, channel, note, velocity; var ampenv; ampenv = Env.asr(0.02, 0.5, 0.5, 1, -6); EnvGen.ar ( ampenv, SinOsc.ar( ( note.midicps + bend ), 0, 0.25, 0 ) ); }, 1, 1, 12) }.play which doesn't output the correct pitches. From looking at code examples, it looks like the way to do this should be; EnvGen.ar ( ampenv, SinOsc.ar( ( note + bend ).midicps, 0, 0.25, 0 ) ); however, this doesn't make any sound at all. What am I failing to grasp here? Also, I can't find any documentation on how to play non-looping or stereo samples. If somebody could mail me examples, that would be appreciated. + M Stevens + M@solipsist.org + www.solipsist.org + ------------------------------ Date: Thu, 08 Jul 1999 10:27:10 +0100 From: Martin Robinson <---@---.---> Subject: Re: apparently I'm missing something here... I haven't got any MIDI gear sround me at present so I didn't look at the Voicer thing but.. This will play mono, stereo, multi-channel, whatever-the-file-is! ( // normal playback at same speed of recording // multi channel version var filename, sound, signal; //filename = ":Sounds:floating_1"; filename = ":Sounds:atmos1.8"; sound = SoundFile.new; if (sound.read(filename), { // put sound's data array into signal signal = sound.data; Synth.scope({ PlayBuf.ar(signal, sound.sampleRate, 1, 0, 0, // get the size of chan 1 signal.at(0).size-2) }); },{ (filename ++ " not found.\n").post }); ) And this plays non-looping samples triggered by mouse movement ( // normal playback at same speed of recording // multi channel version // non-looping triggered by mouse // moving to the right of the screen // speed by mouse y var filename, sound, signal; filename = ":Sounds:floating_1"; //filename = ":Sounds:atmos1.8"; sound = SoundFile.new; if (sound.read(filename), { // put sound's data array into signal signal = sound.data; Synth.scope({ var e, sigSize, my; sigSize = signal.at(0).size-2; e = Env.linen(0.001, 0.998, 0.001); my = MouseY.kr(0.1, 10, 'exponential'); TSpawn.ar({ var env, speed; speed = my.poll; env = EnvGen.kr(e, timeScale: sigSize* sound.sampleRate.reciprocal* speed.reciprocal ); PlayBuf.ar(signal, sound.sampleRate, speed, 0, 0, sigSize, env ) }, signal.size, nil, MouseX.kr(0,1) > 0.5); }); },{ (filename ++ " not found.\n").post }); ) >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || ------------------------------ Date: Thu, 8 Jul 1999 13:57:02 -0500 From: Michael Klingbeil <---@---.---> Subject: Re: apparently I'm missing something here... >I'm having trouble getting pitch bend to work with Voicer. The closest I Here is a solution to the pitch bend problem: { var bend; bend = MIDIPitchBend.kr( 1, -3/128, 3/128 ); Voicer.ar( { arg voicer, i, synth, deltaTime, channel, note, velocity; var ampenv; ampenv = Env.asr(0.02, 0.5, 0.5, 1, -6); EnvGen.ar ( ampenv, SinOsc.ar( ( note + bend).midicps, 0, 0.25, 0 ) ); }, 1, 1, 12) }.play Apparently the scaling for MIDI control sources expects 7 bit values (0 to 127). Pitch bend is a 14 bit value. Dividing the scalar by 128 will put the control values back in the expected range. Michael ------------------------------ Date: Thu, 8 Jul 1999 17:54:32 -0500 From: Michael Klingbeil <---@---.---> Subject: stealing from released synths In working with the voicer ugen, I came upon what seems to be a troubling limitation: Voicer does not steal from currently running synths if the envelopes have entered their release stage. If I have envelopes with release times of a few seconds, it is easy to overtax the CPU. The following is a simple example with an envelope release time of 8 seconds. Arepeggiating a large chord up and down many times rapidly (or trilling between 2 notes) will eventually consume all CPU. ( e = Env.new([0, 1, 0], [0.005, 8.0], [1.0, -6.0], 1); Synth.play({ Voicer.ar({ arg voicer, i, synth, deltaTime, channel, note, velocity; var dynrange; var amp; var exciter, spec, s, maxdel; var p, f; dynrange = -30; // dyn range of 30dB amp = (1.0 - (velocity / 127.0)) * dynrange; amp = amp.dbamp; f = note.midicps * 2; f = f + (f * 0.006.rand2); p = 0.9.rand2; s = SinOsc.ar(f,0,amp) * EnvGen.kr(e); Pan2.ar(s, p) }, 2, // stereo 1, // channel 4, // max voices 0.25 // amp ) }) ) Voicer appears to keep track of the currently running synths in an array called runningSynths. This is set to maxVoices + 1. Presumably when there are maxVoices synths running, the maxSynth + 1th synth is spawned, and then the synth with the oldest starting time is sent the "steal" message. However given the noted behavior runningSynths must only contain synths that are executing from noteOn to noteOff? Yet, when the envelope enters the release stage, presumably the synth is still running? It seems that this could be fixed if the runningSynth array was updated from noteOn to envelope release rather than from noteOn to noteOff. However, I have no idea how to actually make this happen. Does any one have any suggestions or workarounds? Thanks. Michael ------------------------------ Date: Fri, 09 Jul 1999 11:30:48 +0100 From: Martin Robinson <---@---.---> Subject: Ambisonics Does anyone know how one might go about decoding the output of PanB (ambisonic B format panner) for an array of speakers? Since I haven't the cash for a black box decoder, can it be done in SC? >>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ <><><>__this.liveElectronics.interFaces.diffusion ____ || ------------------------------ Date: Fri, 9 Jul 1999 18:55:29 +0800 From: Mark Ballora <---@---.---> Subject: Re: Ambisonics Have you seen the Winter 96 CMJ, in which they describe Ambisonics and give Csound examples of its use? If you already have encoded files, here's a Csound example from that article to decode an encoded quad file. This would be easy enough to translate to SC. Mark ; panexpdecode.orc ; decodes the file saved in panexp sr = 44100 kr = 441 ksmps = 100 nchnls = 4 instr 1 ax, ay, az, aw soundin "test" a1 = aw + (ax*0.707) + (ay*0.707) a2 = aw + (ax*0.707) - (ay*0.707) a3 = aw - (ax*0.707) - (ay*0.707) a4 = aw - (ax*0.707) + (ay*0.707) outq a1, a2, a3, a4 endin >Does anyone know how one might go about decoding the output of PanB >(ambisonic B format panner) for an array of speakers? Since I haven't the >cash for a black box decoder, can it be done in SC? > > >>>>>>>Martin Robinson :: (Ex)tractor :: && ________ >>>><<<_sonicArts.at(middlesexUniversity.london.uk); ______ ><><><>__this.liveElectronics.interFaces.diffusion ____ > > || ------------------------------ Date: Fri, 09 Jul 1999 16:52:19 +0200 From: julian rohrhuber <---@---.---> Subject: sequencerGUI for patterns anyone knows whatīs wrong? I was trying to make a slidersequencer similar to the seq303 program. it seems I havenīt understood something correctly - a Pfunc within a Pseq should work, shouldnīt it? /////////sequencer should count through gui, but doesnīt ( var w, n, pat, a; n = 8; w = GUIWindow.new("seq", Rect.newBy( 55, 409, 28 * n, 193 )); n.do({ arg i; SliderView.new( w, Rect.newBy( 27*i+21, 12, 21, 131 ), "SliderView", 0, 0, 1, 0, 'linear'); NumericalView.new( w, Rect.newBy( 27*i+19, 156, 25, 17 ), "NumericalView", 0, -1e+10, 1e+10, 0, 'linear'); w.at(i).action ={ w.at(i+1).value = w.at(i).value.trunc(0.1) }; }); pat = Array.fill(n, { arg i; Pfunc({ w.at(2*i).value }) }); pat = Pbind( \tempo, 3, \freq, Pseq(pat, inf) * 40 + 200 ); pat.play; ) ------------------------------ Date: Sat, 10 Jul 1999 13:04:08 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: stealing from released synths I cannot check this at present. Voicer tries to steal voices in a logical manner. If there has been no note off for a voice then it will prefer to steal something else first. On Thu, 8 Jul 1999, Michael Klingbeil wrote: > In working with the voicer ugen, I came upon what seems to be a troubling > limitation: Voicer does not steal from currently running synths if the > envelopes have entered their release stage. If I have envelopes with > release times of a few seconds, it is easy to overtax the CPU. > > The following is a simple example with an envelope release time of 8 > seconds. Arepeggiating a large chord up and down many times rapidly (or > trilling between 2 notes) will eventually consume all CPU. > > ( > e = Env.new([0, 1, 0], [0.005, 8.0], [1.0, -6.0], 1); > Synth.play({ > Voicer.ar({ arg voicer, i, synth, deltaTime, channel, note, velocity; > var dynrange; > var amp; > var exciter, spec, s, maxdel; > var p, f; > > dynrange = -30; // dyn range of 30dB > > amp = (1.0 - (velocity / 127.0)) * dynrange; > amp = amp.dbamp; > > f = note.midicps * 2; > f = f + (f * 0.006.rand2); > p = 0.9.rand2; > > s = SinOsc.ar(f,0,amp) * EnvGen.kr(e); > Pan2.ar(s, p) > }, > 2, // stereo > 1, // channel > 4, // max voices > 0.25 // amp > ) > }) > ) > > Voicer appears to keep track of the currently running synths in an array > called runningSynths. This is set to maxVoices + 1. Presumably when there > are maxVoices synths running, the maxSynth + 1th synth is spawned, and then > the synth with the oldest starting time is sent the "steal" message. > However given the noted behavior runningSynths must only contain synths > that are executing from noteOn to noteOff? Yet, when the envelope enters > the release stage, presumably the synth is still running? > > It seems that this could be fixed if the runningSynth array was updated > from noteOn to envelope release rather than from noteOn to noteOff. > However, I have no idea how to actually make this happen. > > Does any one have any suggestions or workarounds? Thanks. > > > Michael > > ------------------------------ Date: Sat, 10 Jul 1999 13:11:45 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: sequencerGUI for patterns On Fri, 9 Jul 1999, julian rohrhuber wrote: > anyone knows whatīs wrong? I was trying to make a slidersequencer similar > to the seq303 program. it seems I havenīt understood something correctly - > a Pfunc within a Pseq should work, shouldnīt it? A pattern must return nil at some point or the Pseq will never move to the next pattern. Your Pfunc keeps returning a value every time it is called. Prout({ w.at(2*i).value.yield }) will return a value the first time and then nil subsequently. > > > /////////sequencer should count through gui, but doesnīt > ( > var w, n, pat, a; > > n = 8; > w = GUIWindow.new("seq", Rect.newBy( 55, 409, 28 * n, 193 )); > > n.do({ arg i; > SliderView.new( w, Rect.newBy( 27*i+21, 12, 21, 131 ), "SliderView", 0, > 0, 1, 0, 'linear'); > NumericalView.new( w, Rect.newBy( 27*i+19, 156, 25, 17 ), > "NumericalView", 0, -1e+10, 1e+10, 0, 'linear'); > w.at(i).action ={ w.at(i+1).value = w.at(i).value.trunc(0.1) }; > }); > > > > pat = Array.fill(n, { arg i; Pfunc({ w.at(2*i).value }) }); > > pat = Pbind( > \tempo, 3, > \freq, Pseq(pat, inf) * 40 + 200 > ); > pat.play; > ) > > ------------------------------ Date: Sat, 10 Jul 1999 20:56:29 -0500 (CDT) From: "AUDIOSYNTH.COM" <---@---.---> Subject: Re: sequencerGUI for patterns Actually the best way to do what you want is: ... \freq, Prout({ loop({ n.do({ arg i; (w.at(2*i).value * 40 + 200).yield; }) }) }) ); ... This has much less overhead than using a Prout inside a Pseq. ------------------------------ Date: Sun, 11 Jul 1999 12:00:06 +0100 From: "richard.d.james" <---@---.---> Subject: unsubscribe unsubscribe ------------------------------ Date: Mon, 12 Jul 1999 16:41:51 +0000 From: the hafler trio <---@---.---> Subject: Re: Music Technology Site what's the status of the http://141.20.150.214:88/MusicTechnology site? I can't access it..... best andrew mckenzie ------------------------------ Date: Tue, 13 Jul 1999 15:50:18 -0400 From: "crucial" <---@---.---> Subject: .gc->numGrey crash James, I caught some info regarding the .gc crash. Today it is happening repeatedly. I was working on a class, had an error involving a misnamed method not being found. Corrected the error and recompiled.... .gc->numGrey 1, but none found grey count off 1 2 3 etc. etc. 11 tot 12 bgwfr 52 38 the above paragraph many times repeated which is usually when it locks up. I did a user interrupt and it hung Mac error 10 with this left on the screen : (sorry if there are some typos, but i scribbled it down) USER INTERRUPT in method Integer : do this = 64 var i = 4 Meta_Arrayed Collection : series size 64 start 5 step 1 array [*4] MetaSynth:normalRouting Main:hardwareSetup Every time I compile now it is doing it, I'll hunt for something in my classes, but it was functioning fine earlier. This is with 2.16 with the Main.sc as supplied with that update. __________________________________________ :\\_______ http://crucial-systems.com __________________________________________ :\\_______ ------------------------------ Date: Wed, 14 Jul 1999 09:34:42 +1000 From: ggerrard <---@---.---> Subject: Is this an interface bug or something else? Whenever I stop a patch with cmd + . the whole of the script window gets highlighted and the window scrolls down to the end. The insertion point gets changed to the end of the window. Anyone else getting this behaviour. Very irritating! Mac OS 8.6, SC2.1.6. Graeme ------------------------------ Date: Tue, 13 Jul 1999 18:57:26 -0600 From: James McCartney <---@---.---> Subject: Re: Is this an interface bug or something else? At 5:34 PM -0600 7/13/99, ggerrard wrote: >Whenever I stop a patch with cmd + . the whole of the script window >gets highlighted and the window scrolls down to the end. >The insertion point gets changed to the end of the window. > >Anyone else getting this behaviour. Very irritating! > >Mac OS 8.6, SC2.1.6. > >Graeme I haven't seen this. Does this always happen or only on a particular piece of code? --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ Date: Wed, 14 Jul 1999 13:18:07 -0400 From: "Michael Rees" <---@---.---> Subject: Re: Is this an interface bug or something else? > Whenever I stop a patch with cmd + . the whole of the script window > gets highlighted and the window scrolls down to the end. > The insertion point gets changed to the end of the window. > > Anyone else getting this behaviour. Very irritating! > > Mac OS 8.6, SC2.1.6. happens to me, too. it has always happened, so i assumed it was just something else to learn to live with. m. - -- Michael Rees Composer &c. I prefer Hostess Fruit Pies to Pop-Tarts because they require less cooking. ------------------------------ Date: Wed, 14 Jul 1999 13:51:17 -0600 From: James McCartney <---@---.---> Subject: Re: Is this an interface bug or something else? At 11:18 AM -0600 7/14/99, Michael Rees wrote: >> Whenever I stop a patch with cmd + . the whole of the script window >> gets highlighted and the window scrolls down to the end. >> The insertion point gets changed to the end of the window. >> >> Anyone else getting this behaviour. Very irritating! >> >> Mac OS 8.6, SC2.1.6. > >happens to me, too. it has always happened, so i assumed it was just >something else to learn to live with. I'm not sure what is being described. If the entire text is highlighted, then the insertion point is not at the end.. If on the other hand *you* are selecting the entire file then you will see the cursor move to the end of the file. The insertion point is placed at the end of whatever selection you have made when execution begins. If it did not do this, then any printing your program did would wipe out whatever text was selected. --- james mccartney james@audiosynth.com http://www.audiosynth.com If you have a PowerMac check out SuperCollider2, a real time synth program: ------------------------------ End of sc-users-digest V1 #50 *****************************