From sc-users-owner@bga.com Thu Feb 6 08:38:00 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id IAA05215 for sc-users-outgoing; Thu, 6 Feb 1997 08:38:00 -0600 Received: from tango.create.ucsb.edu (create.ucsb.edu [128.111.92.40]) by zoom.bga.com (8.6.12/8.6.12) with SMTP id IAA05204 for ; Thu, 6 Feb 1997 08:37:58 -0600 Received: by tango.create.ucsb.edu (4.1/SMI-4.1) id AA16545; Thu, 6 Feb 97 06:27:57 PST From: stp@create.ucsb.edu (Stephen Travis Pope) Message-Id: <9702061427.AA16545@tango.create.ucsb.edu> Date: Thursday, 06 Feb 97 6:03:09 am Subject: Creating a reference To: sc-users@bga.com Fonts: 706 1 Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hello all, I have another simple question about scheduling and scores. I'd like to be able to read in a score (note list) from an external file, but can't figure out how to convert a string instrument name into an instrument function reference. If I have a Music-N-like score file with something like, # start instr dur freq amp ... 0 fm_instr 0.25 54 1.0 ... and a SuperCollider function that reads this in a loop with freadlist(), then I get a list like, [ 0.000000 "fm_instr" 0.250000 54 1.000000 ... ] which is just fine. Now how can I turn the instrument name string "fm_instr" into a reference to an instrument function (`fm_instr) defined in my program? ...any reply appreciated... stp Stephen Travis Pope, Center for Research in Electronic Art Technology (CREATE), Department of Music, U. of California, Santa Barbara (UCSB) Editor--Computer Music Journal, MIT Press stp@create.ucsb.edu, http://www.create.ucsb.edu/~stp/ From sc-users-owner@bga.com Thu Feb 6 09:08:18 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id JAA11754 for sc-users-outgoing; Thu, 6 Feb 1997 09:08:18 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id JAA11730 for ; Thu, 6 Feb 1997 09:08:16 -0600 Received: from [128.83.254.166] (slip-79-6.ots.utexas.edu [128.83.254.166]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id JAA07813 for ; Thu, 6 Feb 1997 09:09:41 -0600 Message-Id: In-Reply-To: <9702061427.AA16545@tango.create.ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 6 Feb 1997 09:08:33 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Creating a reference Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 6:03 AM +0000 2/6/97, Stephen Travis Pope wrote: >Hello all, > >I have another simple question about scheduling and scores. > >I'd like to be able to read in a score (note list) from an external file, >but >can't figure out how to convert a string instrument name into an >instrument >function reference. If I have a Music-N-like score file with >something like, > > # start instr dur freq amp ... > 0 fm_instr 0.25 54 1.0 ... > >and a SuperCollider function that reads this in a loop with freadlist(), >then >I get a list like, > > [ 0.000000 "fm_instr" 0.250000 54 1.000000 ... ] > >which is just fine. Now how can I turn the instrument name string "fm_instr" >into a reference to an instrument function (`fm_instr) defined in my program? > >...any reply appreciated... > If you put the token in single quotes in your score file, then freadlist() and parse() will return it as a symbol. You can then do resolveName() and it will return the function. Try this: myfunc { arg a b c; ["hello there", a, b, c].post; } init { event = "'myfunc' 1.0 2.0 3.0".parse.post; #funName ... args = event; funRef = funName.resolveName.post; funRef.valueList(args); } --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Thu Feb 6 09:55:13 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id JAA12638 for sc-users-outgoing; Thu, 6 Feb 1997 09:11:54 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id JAA12625 for ; Thu, 6 Feb 1997 09:11:52 -0600 Received: from [128.83.254.166] (slip-79-6.ots.utexas.edu [128.83.254.166]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id JAA07833 for ; Thu, 6 Feb 1997 09:13:12 -0600 Message-Id: In-Reply-To: <9702061427.AA16545@tango.create.ucsb.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 6 Feb 1997 09:12:05 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Creating a reference Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Also a note: freadlist() breaks for lines over 1023 chars. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Sun Feb 9 17:08:23 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id RAA06152 for sc-users-outgoing; Sun, 9 Feb 1997 17:08:23 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id RAA06136 for ; Sun, 9 Feb 1997 17:08:17 -0600 Received: from vixen.Dartmouth.EDU (vixen.dartmouth.edu [129.170.208.15]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id RAA36731 for ; Sun, 9 Feb 1997 17:43:24 -0500 Message-id: <28047652@vixen.Dartmouth.EDU> Date: 09 Feb 97 17:43:24 EST From: Colby.N.Leider@Dartmouth.EDU (Colby N. Leider) Subject: list question To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hello all, I am trying to pass a list to a function and then have that function pick a random member from the list. Does anybody see what is wrong with this code? For some reason, the line "foo = myList.choose" works fine in 'start' but barfs in 'voice1'. Thank you, Colby Leider Dartmouth College -------------- defaudioout L R; defaudiobuf x207a; deftable env1, tabl1; defdelay dly1; init { loadAllAudio(); } start { a = 4.expran; b = 4.expran; c = 4.expran; myList = [a b c]; foo = myList.choose; foo.post; voice1(myList); } voice1 {arg myList; ch = [L R].choose; myList.post; foo = myList.choose; x = Alooprd(x207a, 1, 1); amp1 = Atransient(env1, 0.07, 1, 0, `dspRemove); { (x.value *! amp1.value).value.out(ch); }.dspAdd(1); [0.12, thisFunc].sched; } From sc-users-owner@bga.com Sun Feb 9 20:14:08 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id UAA05665 for sc-users-outgoing; Sun, 9 Feb 1997 20:14:08 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id UAA05652 for ; Sun, 9 Feb 1997 20:14:06 -0600 Received: from [128.83.219.2] (slip-80-2.ots.utexas.edu [128.83.219.2]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id UAA18354 for ; Sun, 9 Feb 1997 20:15:34 -0600 Message-Id: In-Reply-To: <28047652@vixen.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sun, 9 Feb 1997 20:14:33 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: list question Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 5:43 PM -0500 2/9/97, Colby N. Leider wrote: >Hello all, > >I am trying to pass a list to a function and then have that function pick a >random member from the list. Does anybody see what is wrong with this code? >For some reason, the line "foo = myList.choose" works fine in 'start' but >barfs >in 'voice1'. The reason is that when you reschedule the function you are not passing it any parameters: [0.12, thisFunc].sched; What the above line does is call voice1 again in 0.12 seconds with no parameters so the argument myList is nil. You can either call it as follows: [0.12, thisFunc, myList].sched Or you might want to wrap the rescheduling function in voice1's context so that the value passed in is always available to the resceduling function. Here's how you would write that. voice1 {arg myList; value({ ch = [L R].choose; myList.post; foo = myList.choose; x = Alooprd(x207a, 1, 1); amp1 = Atransient(env1, 0.07, 1, 0, `dspRemove); { (x.value *! amp1.value).value.out(ch); }.dspAdd(1); [0.12, thisFunc].sched; }); } However in both of the above cases the function is called with the same parameters for each event. I'm not sure if that's what you want but it is how your original was. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Mon Feb 10 15:17:05 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id PAA25451 for sc-users-outgoing; Mon, 10 Feb 1997 15:17:05 -0600 Received: from tango.create.ucsb.edu (create.ucsb.edu [128.111.92.40]) by zoom.bga.com (8.6.12/8.6.12) with SMTP id PAA25429 for ; Mon, 10 Feb 1997 15:17:01 -0600 Received: by tango (4.1/SMI-4.1) id AA26194; Mon, 10 Feb 97 08:23:27 PST From: stp@create.ucsb.edu (Stephen Travis Pope) Message-Id: <9702101623.AA26194@tango> Date: Monday, 10 Feb 97 8:31:58 am Subject: ADSR Envelopes? To: sc-users@bga.com Fonts: 397 1 Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hello all, Do any of you have simple code showing the construction of a simple ADSR envelope--or any other envelope where one can set the attack or decay times independent of the note duration? I've looked over break-point functions and transients, but can't seem to figure out how to do it without resorting to a collection of exponential line segments. ...any assistance appreciated... stp Stephen Travis Pope, Center for Research in Electronic Art Technology (CREATE), Department of Music, U. of California, Santa Barbara (UCSB) Editor--Computer Music Journal, MIT Press stp@create.ucsb.edu, http://www.create.ucsb.edu/~stp/ From sc-users-owner@bga.com Mon Feb 10 18:11:03 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id RAA20064 for sc-users-outgoing; Mon, 10 Feb 1997 17:14:47 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id RAA19844 for ; Mon, 10 Feb 1997 17:13:38 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id RAA57882 for ; Mon, 10 Feb 1997 17:07:41 -0500 Message-id: <29936117@cupid.Dartmouth.EDU> Date: 10 Feb 97 17:07:41 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: Apgrain question To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com hello sc-users, how do i turn off the looping feature of Apgrain and Alooprd? instr3 below goes on infintely... i just want it to do granular synthesis on different files sequentially, so that when one file is finished being read through, i can pass it another set of parameters. thanks, -kp-- -----------------cut here---------- instr3 {arg mySample, incrementFactor, sampleRateFactor, grainDuration, grainAmp, reschedRate; var stuff, f chan; sampleDuration = timeOf(mySample); grains = Apgrain(mySample, now/incrementFactor, sampleRateFactor, grainDuration, grainAmp, `dspRemove); { (grains.value).out(L).out(R); }.dspAdd; [reschedRate, thisFunc, mySample, incrementFactor, sampleRateFactor, grainDuration, grainAmp, reschedRate].sched; } -----------------cut here---------- From sc-users-owner@bga.com Mon Feb 10 19:12:20 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id TAA13709 for sc-users-outgoing; Mon, 10 Feb 1997 19:12:20 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id TAA13690 for ; Mon, 10 Feb 1997 19:12:18 -0600 Received: from [128.83.204.139] (slip-9-11.ots.utexas.edu [128.83.204.139]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id TAA22066 for ; Mon, 10 Feb 1997 19:13:45 -0600 Message-Id: In-Reply-To: <9702101623.AA26194@tango> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 10 Feb 1997 19:12:46 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: ADSR Envelopes? Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 8:31 AM +0000 2/10/97, Stephen Travis Pope wrote: >Hello all, > >Do any of you have simple code showing the construction of a simple ADSR >envelope--or any other envelope where one can set the attack or decay times >independent of the note duration? Try the following : --- defenvelope e1; init { e1.dump(2); } --- This shows that a break point envelope is just a list as follows: [ [ level0, level1, ... levelN ], [ duration1, ... durationN ], ] So you can do something like: myList = [[ (*levels*) ][ (*durations*) ] susNodeIndex, -1]; envgen = Abpenv(myList, scale, bias, timeScale, compFunc); --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Tue Feb 11 11:07:30 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id KAA23699 for sc-users-outgoing; Tue, 11 Feb 1997 10:04:43 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id KAA23613 for ; Tue, 11 Feb 1997 10:04:24 -0600 Received: from [128.83.204.169] (slip-11-9.ots.utexas.edu [128.83.204.169]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id KAA23573 for ; Tue, 11 Feb 1997 10:05:48 -0600 Message-Id: In-Reply-To: <29936117@cupid.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 11 Feb 1997 10:04:51 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Apgrain question Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 5:07 PM -0500 2/10/97, Kevin P. Parks wrote: >hello sc-users, > >how do i turn off the looping feature of Apgrain and Alooprd? instr3 below >goes on infintely... i just want it to do granular synthesis on different >files >sequentially, so that when one file is finished being read through, i can pass >it another set of parameters. Abufrd is the nonlooping version of Alooprd. If you want to stop granulating at a certain point in the file you should keep track of your position in the file and stop the rescheduling loop. I create a separate function to do the rescheduling so that the values persist over multiple invocations of the scheduling loop function. instr3 {arg mySample, stepTime, sampleRateFactor, grainDuration, grainAmp, reschedRate; var curPosition=0, endTime; endTime = mySample.timeOf - grainDuration; -- evaluate the loop function in the instrument function's context -- so that curPosition persists over multiple invocations due to -- rescheduling. value({ sampleDuration = timeOf(mySample); grains = Apgrain(mySample, curPosition, sampleRateFactor, grainDuration, grainAmp, `dspRemove); { (grains.value).out(L).out(R); }.dspAdd; curPosition = curPosition + stepTime if curPosition <= endTime then -- now that we are in a subcontext we do not need to pass the -- parameters as they are available in an outer scope [reschedRate, thisFunc].sched; end.if }); } >-----------------cut here---------- >instr3 {arg mySample, incrementFactor, sampleRateFactor, grainDuration, >grainAmp, reschedRate; > var stuff, f chan; > > sampleDuration = timeOf(mySample); > > grains = Apgrain(mySample, now/incrementFactor, sampleRateFactor, >grainDuration, grainAmp, `dspRemove); > { > (grains.value).out(L).out(R); > }.dspAdd; > [reschedRate, thisFunc, mySample, incrementFactor, sampleRateFactor, >grainDuration, grainAmp, reschedRate].sched; >} >-----------------cut here---------- --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Wed Feb 12 16:17:18 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id QAA05855 for sc-users-outgoing; Wed, 12 Feb 1997 16:17:18 -0600 Received: from sound.music.mcgill.ca (sound.Music.McGill.CA [132.206.141.11]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id QAA05836 for ; Wed, 12 Feb 1997 16:17:12 -0600 Received: from [198.168.183.64] (F-04.DAS.McGill.CA [198.168.183.64]) by sound.music.mcgill.ca (8.6.10/8.6.6) with ESMTP id RAA18498 for ; Wed, 12 Feb 1997 17:10:55 -0500 Message-Id: In-Reply-To: References: <9702101623.AA26194@tango> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Wed, 12 Feb 1997 17:20:10 -0500 To: sc-users@bga.com From: pennycook <---@---.---> Subject: Files, Data Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com I have four related questions: 1) is there a limit to the number of list elements? I would like to read files with about 500 lists of up to 10 floats per list. I got some errors trying to load large files (but my prog. could be the problem). If there are limits, how does one increase the size of the symbol/list storage?? 2) has anyone developed routines to read Standard MIDI files and/or large external score files ala csound input where the instruments are interleaved chronologically? I have a reasonable solution nearly done but it is not completely generalized. 3) I am trying to make a func which wills allow me to address data[i,j,k]. It is not clear to me how to declare, fill, and address such a thing. Could it be filled using nested for/while loops?? Anyone have an example of making/filling/using n-dimensional arrays (lists of lists)?? Finally, Could someone post some examples of functions called by list manipulators such as forEach(list, func) and reduce1(list, func)? I get them to work sort of but it is not clear to me how the args (a,b) for example in forEach(list, myfunc(a,b)) operate in each case. While element appears to be the starting element, is index addressable? Can one say in the function: if element.at(index - 1) != element.at(index) (didn't work for me....). Thanks Bruce Pennycook McGill University From sc-users-owner@bga.com Wed Feb 12 23:50:53 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id XAA06458 for sc-users-outgoing; Wed, 12 Feb 1997 23:50:53 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id XAA06432 for ; Wed, 12 Feb 1997 23:50:48 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id AAA16866 for ; Thu, 13 Feb 1997 00:29:07 -0500 Message-id: <30082497@cupid.Dartmouth.EDU> Date: 13 Feb 97 00:29:07 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: grains, grains and mo' grains To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com greetings supercollidingheads! firstly, thanx to james mccartney for taking the time to answer my previous query, but as you might have guessed, i haven't quite arrived at where i am trying to go yet. below are two implementations of a grain instrument, both of which should output identical sounds if given the same parameter values with the exception that the haegumMaster instrument should stop after it reads one pass of the sample and the heagum2 instrument should just keep on looping. Yet the instruments yield different sonic results. wassup with that?! what am i doing wrong? anyone . . . ? anyone . . .? anyway, i am new to this supercollider thing and am already getting in over my head, but it is just too cool to be able do this stuff in real time! It has been a nice alternative to Csound (which would insist that my tables be a power of two! I hate having to zero pad my tables!) Ultimately i am trying to have a grain instrument that will choose a new sample before it loops around again after the window finishes scanning the first one it should choose then next sample and "grain" that. i have a bunch of smallish fun samples that i want to "grain" through sequentially (algorhythmically actually). I have incorporated the solution which was posted earlier, but I think I must still be doing something wrong. cheers, kevin parks dartmouth college-music dept. -------------------------------- cut here ------------------------------------------- defaudiobuf x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b; defaudioout L R; init { loadAllAudio; } start { mySampleList = [x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b]; mySample = x207a; --mySample = mySampleList.choose; --mySample.post; sampleTime = mySample.timeOf; sampleTime.post; --stepTime = 1.getItemValue; stepTime = 0.25; grainDuration = 0.005; grainAmp = 1.0; reschedRate = 0.1; -- is this formula correct? haegumMasterTime = sampleTime / stepTime * reschedRate; haegumMasterTime.post; --haegum2; haegumMaster(mySample, stepTime, grainDuration, grainAmp, reschedRate); -- should i reschedule haegumMaster here? } haegumMaster {arg mySample, stepTime, grainDuration, grainAmp, reschedRate; var curPosition = 0, endTime; endTime = mySample.timeOf - grainDuration; value({ grains = Apgrain(mySample, curPosition, 1.0, grainDuration, grainAmp, `dspRemove); { grains.value.out(L).out(R); }.dspAdd; curPosition = curPosition + stepTime if curPosition <= endTime then [reschedRate, thisFunc].sched; end.if }); } haegum2 { grain = Apgrain(x207a, now * 0.25, 1.0, 0.005, 1.0, `dspRemove); { grain.value.out(L).out(R); }.dspAdd; [0.001, thisFunc].sched; } -------------------------------- cut here ------------------------------------------- From sc-users-owner@bga.com Thu Feb 13 01:03:38 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id BAA18038 for sc-users-outgoing; Thu, 13 Feb 1997 01:03:38 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id BAA18029 for ; Thu, 13 Feb 1997 01:03:36 -0600 Received: from [128.83.112.4] (slip-34-4.ots.utexas.edu [128.83.112.4]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id BAA29356 for ; Thu, 13 Feb 1997 01:05:02 -0600 Message-Id: In-Reply-To: <30082497@cupid.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Feb 1997 01:04:08 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: grains, grains and mo' grains Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 12:29 AM -0500 2/13/97, Kevin P. Parks wrote: >greetings supercollidingheads! > >firstly, thanx to james mccartney for taking the time >to answer my previous query, but as you might have >guessed, i haven't quite arrived at where i am trying >to go yet. > >below are two implementations of a grain instrument, >both of which should output identical sounds if given the >same parameter values with the exception that the >haegumMaster instrument should stop after it reads >one pass of the sample and the heagum2 instrument >should just keep on looping. > >Yet the instruments yield different sonic results. wassup >with that?! what am i doing wrong? anyone . . . ? >anyone . . .? But you aren't giving them the same parameters: > reschedRate = 0.1; ... > [reschedRate, thisFunc].sched; vs.: > [0.001, thisFunc].sched; The first one produces a new grain each 100 milliseconds and the second one produces a new grain each millisecond >Ultimately i am trying to have a grain instrument that >will choose a new sample before it loops around again >after the window finishes scanning the first one it should >choose then next sample and "grain" that. >i have a bunch of smallish fun samples that i want >to "grain" through sequentially (algorhythmically actually). >I have incorporated the solution which >was posted earlier, but I think I must still be doing something >wrong. Check this out: (I haven't tested it) This has two functions, one which granulates files one at a time at random running indefinitely, and another which granulates each file once in a random order and stops when done. defaudiobuf x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b; defaudioout L R; init { loadAllAudio; } start { mySampleList = [x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b]; stepTime = 0.25; grainDuration = 0.005; grainAmp = 1.0; reschedRate = 0.1; haegumMaster(mySampleList, stepTime, grainDuration, grainAmp, reschedRate); } haegumMaster1 {arg aSampleList, stepTime, grainDuration, grainAmp, reschedRate; -- runs indefinitely granulating samples at random curSample = aSampleList.choose; curPosition = 0; endTime = curSample.timeOf - grainDuration; value({ grains = Apgrain(curSample, curPosition, 1.0, grainDuration, grainAmp, `dspRemove); { grains.value.out(L).out(R); }.dspAdd; curPosition = curPosition + stepTime; if curPosition > endTime then -- choose a new sample at random each time one finishes curSample = aSampleList.choose; curPosition = 0; -- set position to zero endTime = curSample.timeOf - grainDuration; end.if [reschedRate, thisFunc].sched; }); } haegumMaster2 {arg aSampleList, stepTime, grainDuration, grainAmp, reschedRate; -- granulates all samples once in a random order aSampleList.scramble; -- scramble the list sampleIndex = 0; -- set list index to zero curSample = aSampleList @ sampleIndex; -- get a sample curPosition = 0; endTime = curSample.timeOf - grainDuration; runFlag = 1; -- flag will be cleared when all samples have finished value({ grains = Apgrain(curSample, curPosition, 1.0, grainDuration, grainAmp, `dspRemove); { grains.value.out(L).out(R); }.dspAdd; curPosition = curPosition + stepTime; if curPosition > endTime then -- step to next in list sampleIndex = sampleIndex + 1; if sampleIndex >= aSampleList.size then runFlag = 0; -- we've done them all, so stop else -- go to next sample curSample = aSampleList @ sampleIndex; curPosition = 0; -- set position to zero endTime = curSample.timeOf - grainDuration; end.if end.if if runFlag then [reschedRate, thisFunc].sched; end.if }); } --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Thu Feb 13 01:30:24 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id BAA20645 for sc-users-outgoing; Thu, 13 Feb 1997 01:30:24 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id BAA20631 for ; Thu, 13 Feb 1997 01:30:18 -0600 Received: from [128.83.112.4] (slip-34-4.ots.utexas.edu [128.83.112.4]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id BAA29399 for ; Thu, 13 Feb 1997 01:31:47 -0600 Message-Id: In-Reply-To: References: <9702101623.AA26194@tango> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Feb 1997 01:30:55 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Files, Data Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 5:20 PM -0500 2/12/97, pennycook wrote: >I have four related questions: > >1) is there a limit to the number of list elements? I would > like to read files with about 500 lists of up to 10 floats per > list. I got some errors trying to load large files (but my > prog. could be the problem). If there are limits, how does > one increase the size of the symbol/list storage?? There is a limit of 32767 elements in a list. freadlist() has a limit of 1023 chars per line. 500 lines of 10 floats should not be a problem. If you do have a problem I'd like to see what you're trying to read. >3) I am trying to make a func which wills allow me to address > data[i,j,k]. It is not clear to me how to declare, fill, > and address such a thing. Could it be filled using nested > for/while loops?? Anyone have an example of making/filling/using > n-dimensional arrays (lists of lists)?? data @ i @ j @ k is how you would index into a 3D array (list of list of list of elems) Here's one way you could create a 3D array: make3DArray { arg dim1, dim2, dim3, fillVal=0.0; array3D = []; dim1.timesRepeat({ plane2D = []; array3D.add(plane2D); dim2.timesRepeat({ row = [].fill(fillVal, dim3); plane2D.add(row); }); }); ^array3D } > >Finally, > >Could someone post some examples of functions called by >list manipulators such as forEach(list, func) and reduce1(list, func)? > >I get them to work sort of but it is not clear to me how the args >(a,b) for example in forEach(list, myfunc(a,b)) operate in each >case. While element appears to be the starting element, is index >addressable? Can one say in the function: > >if element.at(index - 1) != element.at(index) > >(didn't work for me....). If element is itself a list then you can do that. But that's not what I think you mean. "element" is an object in the list. "index" is the index of that object in the list. (If you need to do things where you want to access two objects in the list inside the loop then you might rather use a for loop.) forEach() calls the loop function once for each element in the list and passed the element and its index to the function. You can then so whatever you want to do with that list element inside your function. -- assume chord is a list of pitches. -- the following calls myInstrument for each pitch in the chord. playChord { arg chord, amplitude; forEach(chord, { arg pitch, index; myInstrument(pitch, amplitude); }); } The list iterators are inspired by those in Smalltalk. Books on Smalltalk have good examples for these. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Thu Feb 13 01:48:10 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id BAA22127 for sc-users-outgoing; Thu, 13 Feb 1997 01:48:10 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id BAA22118 for ; Thu, 13 Feb 1997 01:48:08 -0600 Received: from [128.83.112.4] (slip-34-4.ots.utexas.edu [128.83.112.4]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id BAA29435 for ; Thu, 13 Feb 1997 01:49:39 -0600 Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Feb 1997 01:48:46 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Files, Data Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com >make3DArray { arg dim1, dim2, dim3, fillVal=0.0; > array3D = []; > dim1.timesRepeat({ > plane2D = []; > array3D.add(plane2D); > dim2.timesRepeat({ > row = [].fill(fillVal, dim3); > plane2D.add(row); > }); > }); > ^array3D >} ooh fill() seems to have a bug! instead of: row = [].fill(fillVal, dim3); try this: row = []; dim3.timesRepeat({ row.add(fillVal) }); I'll fix this. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Thu Feb 13 10:03:11 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id KAA15189 for sc-users-outgoing; Thu, 13 Feb 1997 10:03:11 -0600 Received: from sound.music.mcgill.ca (sound.Music.McGill.CA [132.206.141.11]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id KAA15175 for ; Thu, 13 Feb 1997 10:03:09 -0600 Received: from [198.168.189.208] (S-08.DAS.McGill.CA [198.168.189.208]) by sound.music.mcgill.ca (8.6.10/8.6.6) with ESMTP id KAA23511 for ; Thu, 13 Feb 1997 10:56:46 -0500 Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Feb 1997 11:06:06 -0500 To: sc-users@bga.com From: pennycook <---@---.---> Subject: Re: Files, Data Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Many thanks to James for his useful comments on all my files/data questions. I see now that for loops would be best for incremental addressing of elements in a list. (that is what I was doing originally). Some interesting examples there and I will look again at Smalltalk (many years since Smalltalk V ran on my pc-at 286!). Bruce Pennycook McGill From sc-users-owner@bga.com Sat Feb 15 04:39:31 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id EAA13979 for sc-users-outgoing; Sat, 15 Feb 1997 04:39:31 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id EAA13969 for ; Sat, 15 Feb 1997 04:39:29 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id FAA26723 for ; Sat, 15 Feb 1997 05:30:10 -0500 Message-id: <30204817@cupid.Dartmouth.EDU> Date: 15 Feb 97 05:30:09 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: I dream of Alinseg To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com greetings fellow air molecule wigglers! is there something a little fancier than Aline? It would be nice to have an "Alinseg" function that you could use to make something with many points, beyond what Aline and Atrienv can do. I know that you could do this with Atransient, but i really hate trying to draw amplitude envs. with a mouse! (though the Alter menu does have some stuff to make this much easier than it is in most other programs) It would be really nice to have the option of just calling a function that says: from time 0 to 1/4 of the duration move from 0 to 1. stay at 1 for 1/2 dur and then move back to 0 over 1/4 of the dur. Something like: Alinseg(value1, dur1, value2, dur1, value3, dur3...); so that (this will look funny if your font isn't monospaced!): 1 _________________1 / \ / \ / \ 0/ \0 might be coded as: Alinseg(0, 0.01, 1, eventdur - 0.02, 1, 0.01, 0, bias, `dspRemove); is there a workaround to simulate this? Is there some way to type in the values for Atransient? (A curmudgeon might ponder: Why is it called Atransient anyway?) cheers, kevin parks the bregman electronic music studio - dartmouth college From sc-users-owner@bga.com Sat Feb 15 09:49:12 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id JAA04721 for sc-users-outgoing; Sat, 15 Feb 1997 09:49:12 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id JAA04708 for ; Sat, 15 Feb 1997 09:49:11 -0600 Received: from [128.83.177.144] (slip-108-48.ots.utexas.edu [128.83.177.144]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id JAA07288 for ; Sat, 15 Feb 1997 09:50:43 -0600 Message-Id: In-Reply-To: <30204817@cupid.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 15 Feb 1997 09:49:54 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: I dream of Alinseg Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com What about defenvelope / Abpenv() ? As many line segments as you want. You can create envelopes yourself with lists as I showed in a recent message. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Sat Feb 15 09:54:27 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id JAA05180 for sc-users-outgoing; Sat, 15 Feb 1997 09:54:27 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id JAA05170 for ; Sat, 15 Feb 1997 09:54:25 -0600 Received: from [128.83.177.144] (slip-108-48.ots.utexas.edu [128.83.177.144]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id JAA07313 for ; Sat, 15 Feb 1997 09:55:58 -0600 Message-Id: In-Reply-To: <30204817@cupid.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 15 Feb 1997 09:55:09 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: I dream of Alinseg Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 5:30 AM -0500 2/15/97, Kevin P. Parks wrote: >(A curmudgeon might ponder: Why is it called Atransient anyway?) Because it is a one shot without sustain. Maybe Aoneshot would've been better. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Sat Feb 15 13:39:25 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id NAA02338 for sc-users-outgoing; Sat, 15 Feb 1997 13:39:25 -0600 Received: from tango.create.ucsb.edu (create.ucsb.edu [128.111.92.40]) by zoom.bga.com (8.6.12/8.6.12) with SMTP id NAA02310 for ; Sat, 15 Feb 1997 13:39:18 -0600 Received: by tango.create.ucsb.edu (4.1/SMI-4.1) id AA10495; Sat, 15 Feb 97 11:29:03 PST From: stp@create.ucsb.edu (Stephen Travis Pope) Message-Id: <9702151929.AA10495@tango.create.ucsb.edu> Date: Saturday, 15 Feb 97 11:38:03 am Subject: Re: I dream of Alinseg In-Reply-To: James McCartney 's letter of: 97 Feb 15 To: sc-users@bga.com Fonts: 2961 1 Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com > You can create envelopes yourself with lists as I showed in a recent > message. One addition to your note, though, James, the first element in the list for a BP envelope created "on-the-fly" *must* be a symbol, so that the data looks like, [ \symbol -- ignored but required [ list of N amplitudes ] [ list of N-1 durations ] -1 -- or index of "sustain" segment -- (I'm still not sure how to use this, but haven't experimented) -1 -- unused ] For a note with variable attack and decay, try the following example (taken from a SuperCollider tutorial I'm writing). -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -- Example 15b. Creating Instruments with Attack/Decay Controls -- Single-oscillator instrument with attack/decay variables -- This uses the technique of creating the envelope "on the fly" -- from a 2-D list of amplitude values and durations. defaudioout L R; deftable tabl1; start { -- The start function will demonstrate it. var start, dur, freq, att, dec; -- Set up starting conditions start = 0; dur = 0.5; freq = 200 + 40.rand; att = 0.25; -- start with att = dec = (dur / 2) dec = 0.25; -- (triangle envelope) -- Play 15 notes that go from triangle envelope to very sharp att/dec 15.timesRepeat({ -- play a note [start, `note, dur, freq, att, dec].sched; start = start + dur; att = att / 2; -- halve the attack time dec = dec / 1.5; freq = 200 + 40.rand; -- pick a new frequency }); -- Turn off the DSP loop when done with the demo [(start + dur + 0.1), `dspKill].sched } -- -- Chorussing oscillator instrument with att/dec parameters -- note { arg dur, freq, att, dec; var osc, b_points, env; -- Instantiate a chorussing oscillator osc = Acoscili(tabl1, freq, 3); -- Create the list of [[values][durations]] for the envelope b_points = [\name, -- name of function (symbol, ignored) [0, 1, 0.7, 0], -- amplitudes (4 values), decrease to 0.7 -- during "steady state" portion of note. -- Next, the durations of the 3 segments; -- these add up to "dur" [att, (dur - (att + dec)), dec], -- 2 magic "-1"s (required) -1, -1]; -- Instantiate a control envelope that uses the list created above -- args = (table, amp, bias, timescale, completionFunction) env = Kbpenv(b_points, 0.25, 0, 1, `dspRemove); -- Apply the envelope in the DSP loop { (osc.value *! env.value).out(L).out(R) }.dspAdd; } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- stp Stephen Travis Pope, Center for Research in Electronic Art Technology (CREATE), Department of Music, U. of California, Santa Barbara (UCSB) Editor--Computer Music Journal, MIT Press stp@create.ucsb.edu, http://www.create.ucsb.edu/~stp/ From sc-users-owner@bga.com Sun Feb 16 00:11:34 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id AAA12566 for sc-users-outgoing; Sun, 16 Feb 1997 00:11:34 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id AAA12557 for ; Sun, 16 Feb 1997 00:11:31 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id BAA15619 for ; Sun, 16 Feb 1997 01:03:25 -0500 Message-id: <30241881@cupid.Dartmouth.EDU> Date: 16 Feb 97 01:03:25 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: grain-o-rama To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hi all. I am trying to get the grain parameters in this instrument to change dynamically over the course of a "grain event" (i don't mean each grain i mean each event wich results from the processing of a sample from the list) I put the reschedual rate, the grain duration, and the offset on envelopes. This is turning out to be a bit of a brain teaser. 1. I tried getting the envelopes to cycle using the restartFlag feature of Ktransient (e.g., reschedRate = reschedRateUgen.value(1)) below, but they won't cycle 'round for some reason. What am i doing wrong? or am i missunderstanding what is meant by "restartFlag" 2. The Ktransient durations seem to last longer than what is specified (i.e., grainAmpUgen = Ktransient(ampshape1, 15, 1, 0, `dspRemove) seems to last closer to 16 or 17 seconds. 3. How could the duration field of the Ktransient generators be calculated dynamically for each sample, so that, instead of having the ugens being "global" for all of the samples and having a hard-wired envelope duration, they could apply to each sample alone? Ideally, this instrument would apply these control functions to each sample independently and then call itself with a new sample chosen at random from the list, perhaps even having the envelope parameters changed for each new grain event as well (plugged in from a list or whatever). i am not sure that i stated my questions clearly (hope you can get my meaning anyhow) many thanks to all who have helped ths far!!!! kevin parks the bregman electro-acoustic music studio dartmouth college ------ cut here ------- (* This patch granulates each file once in a random order and stops when done. *) defaudiobuf x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b; defaudioout L R; deftable schedshape1, durshape1, ampshape1, stepTimeshape1; init { loadAllAudio; } start { mySampleList = [x207a x233a x262 x311 x350a x414c x466g x525f x622c x700a x829b]; --stepTime = 0.001; --grainDuration = 0.05; --grainAmp = 1.0; haegumMaster(mySampleList); } -- -- this function granulates samples indefinitely in a random order -- haegumMaster {arg aSampleList; -- set up initial values var reschedRate = 0.1, grainDuration = 0.05, grainAmp = 0, stepTime = 2; curSample = aSampleList.choose; curPosition = 0; endTime = timeOf(curSample) - grainDuration; ----------------------------- -- reschedRate generator -- goes from .2 to .5 in 15 secs reschedRateUgen = Ktransient(schedshape1, 15, 1, 0.01, `dspRemove); { reschedRate = reschedRateUgen.value; }.dspAdd(0); ----------------------------- ----------------------------- -- grainDuration generator grainDurationUgen = Ktransient(durshape1, 15, 1, 0.001, `dspRemove); { grainDuration = grainDurationUgen.value; }.dspAdd(0); ----------------------------- ----------------------------- -- grainAmp generator grainAmpUgen = Ktransient(ampshape1, 15, 1, 0, `dspRemove); { grainAmp = grainAmpUgen.value; }.dspAdd(0); ----------------------------- ----------------------------- -- stepTime unit generator stepTimeUgen = Ktransient(stepTimeshape1, 15, 1, 0.5, `dspRemove); { stepTime = stepTimeUgen.value; }.dspAdd(0); ----------------------------- value({ grain = Apgrain(curSample, curPosition, 1.0, grainDuration, grainAmp, `dspRemove); { grain.value.out(L).out(R); }.dspAdd; curPosition = curPosition + stepTime; if curPosition > endTime then -- choose a new sample at random each time one finishes curSample = aSampleList.choose; curPosition = 0; -- set position to zero endTime = curSample.timeOf - grainDuration; end.if [reschedRate, thisFunc].sched; }); } ------ cut here ------- From sc-users-owner@bga.com Thu Feb 20 06:02:03 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id GAA22118 for sc-users-outgoing; Thu, 20 Feb 1997 06:02:03 -0600 Received: from december.real.net.au (root@december.real.net.au [203.25.56.1]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id GAA22102 for ; Thu, 20 Feb 1997 06:01:56 -0600 Received: from [203.25.59.111] (sydney11.real.net.au [203.25.59.111]) by december.real.net.au (8.6.12/8.6.9) with SMTP id XAA01363 for ; Thu, 20 Feb 1997 23:01:43 +1100 X-Sender: mogambo@pop.real.net.au (Unverified) Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Feb 1997 22:57:59 +1000 To: sc-users@bga.com From: mogambo@real.net.au (Arne Hanna) Subject: new boy Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hithere. My only experience with software synthesis has been with the Mills ppc version of csound, so having recently aquired SC, I'm experiencing an expected degree of bewilderment. I shall commit to the necessary gruntlng and sweating over the manual before I unleash a torrent of stupid questions, but one thing I would like to know, and that is how lists are implemented. None of the examples seem to contain any relevant code, nor do the tutorials. Cheers Arne From sc-users-owner@bga.com Thu Feb 20 06:40:09 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id GAA24845 for sc-users-outgoing; Thu, 20 Feb 1997 06:40:09 -0600 Received: from postbote.smb.spk-berlin.de (postbote.smb.spk-berlin.de [194.94.135.11]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id GAA24834 for ; Thu, 20 Feb 1997 06:40:06 -0600 Received: (from uucp@localhost) by postbote.smb.spk-berlin.de (8.8.5/8.8.3) id NAA18689 for ; Thu, 20 Feb 1997 13:39:53 +0100 Received: from sim-spk.sim.spk-berlin.de(194.94.135.144) by postbote.smb.spk-berlin.de via smap (V2.0beta) id xma018687; Thu, 20 Feb 97 13:39:34 +0100 Received: from 194.94.135.126 ([194.94.135.126]) by sim-spk.sim.spk-berlin.de with SMTP (1.39.111.2/16.2) id AA019542370; Thu, 20 Feb 1997 13:39:30 +0100 Message-Id: <330C462D.7AF7@sim.spk-berlin.de> Date: Thu, 20 Feb 1997 13:40:13 +0100 From: iani <---@---.---> Organization: Staatliches Institut fuer Musikforschung X-Mailer: Mozilla 3.0 (Macintosh; I; PPC) Mime-Version: 1.0 To: sc-users@bga.com Subject: Re: new boy References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Arne Hanna wrote: > = > Hithere. My only experience with software synthesis has been with the M= ills > ppc version of csound, so having recently aquired SC, I'm experiencing = an > expected degree of bewilderment. I shall commit to the necessary grunt= lng > and sweating over the manual before I unleash a torrent of stupid > questions, but one thing I would like to know, and that is how lists ar= e > implemented. None of the examples seem to contain any relevant code, no= r do > the tutorials. > Cheers > Arne > but one thing I would like to know, and that is how lists are > implemented How they are implemented in the system, or how they are used? For the user, anything inside square brackets [] can be used as a list (dynamic change of size, cutting segments from the list, inserting elements, embedding other lists as elements) or as an array (access of the elements by index). I think the list functions listed in the = manual or the online help are sufficient to learn how to use lists in SC. For implementation details wait for James McCartneys answer. = Ioannis Zannos Staatliches Institut f=FCr Musikforschung Tiergartenstr. 1, D-10785 Berlin email: iani@sim.spk-berlin.de Tel: +49 30 25481140 Fax: +49 30 25481172 From sc-users-owner@bga.com Thu Feb 20 09:09:21 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id JAA17244 for sc-users-outgoing; Thu, 20 Feb 1997 09:09:21 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id JAA17231 for ; Thu, 20 Feb 1997 09:09:19 -0600 Received: from [128.83.112.37] (slip-36-5.ots.utexas.edu [128.83.112.37]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id JAA22133 for ; Thu, 20 Feb 1997 09:10:54 -0600 Message-Id: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 20 Feb 1997 09:10:15 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: new boy Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 10:57 PM +1000 2/20/97, Arne Hanna wrote: >Hithere. My only experience with software synthesis has been with the Mills >ppc version of csound, so having recently aquired SC, I'm experiencing an >expected degree of bewilderment. I shall commit to the necessary gruntlng >and sweating over the manual before I unleash a torrent of stupid >questions, but one thing I would like to know, and that is how lists are >implemented. None of the examples seem to contain any relevant code, nor do >the tutorials. I'm not sure what you are asking exactly. Lists are dynamically sizeable vectors. They can have up to 32767 elements. You create a list by using square brackets. [] is an empty list. [1, 2, 3] is a list of three numbers. x = ["abc", 1, 2, 3]; -- x now holds a list. y = x @ 0; -- get zeroth element of list y.post; -- prints "abc" x.reverse.post; -- prints [3 2 1 "abc"] There are short one line examples for many of the list functions in the manual. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Fri Feb 21 13:25:31 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id NAA23514 for sc-users-outgoing; Fri, 21 Feb 1997 13:25:31 -0600 Received: from multimedia.edu (root@griffin.multimedia.edu [199.175.7.180]) by zoom.bga.com (8.6.12/8.6.12) with SMTP id NAA23495 for ; Fri, 21 Feb 1997 13:25:27 -0600 Received: from 207.6.129.52 by multimedia.edu with smtp (Smail3.1.29.0 #1) id m0vy1bt-0002amC; Fri, 21 Feb 97 12:30 PST Message-ID: <330D8663.2FF6@multimedia.edu> Date: Fri, 21 Feb 1997 11:26:47 +0000 From: Gary Alan Bourgeois <---@---.---> Organization: VFS Multimedia X-Mailer: Mozilla 3.0 (Macintosh; I; PPC) MIME-Version: 1.0 To: "sc-users@bga.com" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com index sc-users From sc-users-owner@bga.com Fri Feb 21 14:07:54 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id OAA02721 for sc-users-outgoing; Fri, 21 Feb 1997 14:07:54 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id OAA02710 for ; Fri, 21 Feb 1997 14:07:52 -0600 Received: from [128.83.204.129] (slip-9-1.ots.utexas.edu [128.83.204.129]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id OAA26302 for ; Fri, 21 Feb 1997 14:09:29 -0600 Message-Id: In-Reply-To: <330D8663.2FF6@multimedia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Fri, 21 Feb 1997 14:08:53 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 11:26 AM +0000 2/21/97, Gary Alan Bourgeois wrote: >index sc-users You need to send this to "majordomo@bga.com" --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Sat Feb 22 18:13:51 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id SAA19629 for sc-users-outgoing; Sat, 22 Feb 1997 18:13:51 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id SAA19610 for ; Sat, 22 Feb 1997 18:13:47 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id SAA33827 for ; Sat, 22 Feb 1997 18:59:14 -0500 Message-id: <30598848@cupid.Dartmouth.EDU> Date: 22 Feb 97 18:59:14 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: ktransient with a restart flag To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com howdy SuperCollider Hackers! does anyone have any examples of how to use ktransient with a restart flag? I am trying to put some of my parameters on evelopes and i want the Ktransient to wrap around continuously if the Ktransient duration is less then the event duration. so that if my instrument runs for 2 hours and my Ktransient has a dur of 18 secs. it just goes back to the begining of the table after reading the last value and just keeps on doing that over and over. for instance i am not sure how i would get the Ktransient func below to loop over and over. ----------------------------- -- dynamic stepTime value generator stepTimeUgen = Ktransient(stepTimeshape1, 18, 0.01, 0.0005, `dspRemove); { stepTime = stepTimeUgen.value; }.dspAdd(0); ----------------------------- also are there any neat-o ways to make the last value and the first value of the table the same so as to make it all smooth? i have been eye-balling it so far. cheers, kevin parks the bregman electro-acoustic music studio dartmouth college From sc-users-owner@bga.com Sat Feb 22 20:56:28 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id UAA26385 for sc-users-outgoing; Sat, 22 Feb 1997 20:56:28 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id UAA26365 for ; Sat, 22 Feb 1997 20:56:26 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id VAA31459 for ; Sat, 22 Feb 1997 21:50:50 -0500 Message-id: <30603672@cupid.Dartmouth.EDU> Date: 22 Feb 97 21:50:49 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: seed question To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com oohh, i forgot to ask on that last one: is there any way to "seed" a patch so that you can replicate randomly generated numerical list function values, ordering operations, and numbers? cheers, kevin parks the bregman electro-acoustic music studio dartmouth college From sc-users-owner@bga.com Sat Feb 22 20:57:39 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id UAA26687 for sc-users-outgoing; Sat, 22 Feb 1997 20:57:39 -0600 Received: from caligari.dartmouth.edu (caligari.dartmouth.edu [129.170.16.38]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id UAA26673 for ; Sat, 22 Feb 1997 20:57:37 -0600 Received: from cupid.Dartmouth.EDU (cupid.dartmouth.edu [129.170.208.8]) by caligari.dartmouth.edu (8.8.5/8.8.5) with SMTP id VAA52977 for ; Sat, 22 Feb 1997 21:41:43 -0500 Message-id: <30603402@cupid.Dartmouth.EDU> Date: 22 Feb 97 21:41:42 EST From: Kevin.P.Parks@Dartmouth.EDU (Kevin P. Parks) Subject: returning ints from random numerical list functions To: sc-users@bga.com Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com how might i get the brown, pink and white numerical list functions to return integers instead of floats. for example (the only thing i could think of off the top of my head): test = pink(12, 1, 12); test.post; returns a list of 12 floats values (can't copy them from the "Message" window so you'll have to take my word on that or try it yourself). i could just take the absolute value (with abs or asInt), but would the result of that still be characterized as 1/f (in the case of pink)? Itwould seem to me that the "1/f-ness" would be destroyed by such an operation. cheers, kevin parks the bregman electro-acoustic music studio dartmouth college From sc-users-owner@bga.com Sat Feb 22 23:39:40 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id XAA28123 for sc-users-outgoing; Sat, 22 Feb 1997 23:39:40 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id XAA28107 for ; Sat, 22 Feb 1997 23:39:37 -0600 Received: from [128.83.128.89] (slip-17-9.ots.utexas.edu [128.83.128.89]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id XAA00691 for ; Sat, 22 Feb 1997 23:41:14 -0600 Message-Id: In-Reply-To: <30603402@cupid.Dartmouth.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Sat, 22 Feb 1997 23:40:40 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: returning ints from random numerical list functions Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 9:41 PM -0500 2/22/97, Kevin P. Parks wrote: >how might i get the brown, pink and white numerical >list functions to return integers instead of floats. > >for example (the only thing i could think of off the >top of my head): > > test = pink(12, 1, 12); > test.post; > >returns a list of 12 floats values >(can't copy them from the "Message" >window so you'll have to take my word on that >or try it yourself). > >i could just take the absolute value (with abs or asInt), but >would the result of that still be characterized as >1/f (in the case of pink)? Itwould seem to me that the >"1/f-ness" would be destroyed by such an operation. Yes it would be destroyed, but over a long enough evaluation period any series of integers whose limits are bounded will not be pink since being integers they have inherent quantization noise (white). To answer your other question, the random number generators are not seedable. --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Mon Feb 24 13:26:43 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id NAA10722 for sc-users-outgoing; Mon, 24 Feb 1997 13:26:43 -0600 Received: from smtp1.xs4all.nl (smtp1.xs4all.nl [194.109.6.51]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id NAA10662 for ; Mon, 24 Feb 1997 13:26:23 -0600 Received: from magigimmix.xs4all.nl (magigimmix.xs4all.nl [194.109.6.25]) by smtp1.xs4all.nl (8.7.6/XS4ALL) with ESMTP id UAA01235 for ; Mon, 24 Feb 1997 20:25:26 +0100 (MET) Received: from xs2.xs4all.nl (xs2.xs4all.nl [194.109.6.43]) by magigimmix.xs4all.nl (8.7.6/XS4ALL) with ESMTP id UAA28758 for ; Mon, 24 Feb 1997 20:25:24 +0100 (MET) Received: (from jr@localhost) by xs2.xs4all.nl (8.7.6/XS4ALL) id UAA04073 for sc-users@bga.com; Mon, 24 Feb 1997 20:25:23 +0100 (MET) Date: Mon, 24 Feb 1997 20:25:23 +0100 (MET) From: jr <---@---.---> Message-Id: <199702241925.UAA04073@xs2.xs4all.nl> To: sc-users@bga.com Subject: list iterators Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Folks, I'm having problems with List Iterators. I want to apply a function to a list of numbers and I have been trying to use "change" to do an in place list modification. It seemed so simple but I'm getting nowhere e.g. trying to convert my existing lists of cents scale tunings to ratios for use in tuning sample-rate params in buffer players like Acpgrain init { -- placing tests in the "init" section for rapid debugging tuning = [ 197 341 495 703 853 1009]; tuning.change( { arg cents; ^ (2.0 ** (cents/1200.0)) }); -- OR change( [ tuning, ccc ); -- OR tuning.change( ccc); tuning.post; -- posts [ nil nil nil nil nil ] } ccc { arg cents; ^ (2.0 ** (cents/1200.0)) } ddd { arg cents; cents } -- degenerate case All the above versions results in a list of [ nil nil nil nil nil ] or the message type unknown doesn't understand / or some other math function or lots of serious crashes (unusual in my experience with SC.) while fooling around with this code. If I substitute the degenerate function "ddd" the list is left unchanged I usually think I have a problem with function references but I get the results with both implicit and explicit functions. Perhaps I need to make an instance of the "ccc" or ".value" it? The crashes suggest I'm confusing the iterator as to the size of the list. -- this does what I need but is not too fun to type -- and writing out a "do loop" is too easy ratrow = [ (2**(197/1200)) (2**(341/1200)) (2**(495/1200)) (2**(703/1200)) (2**(853/1200)) (2**(1009/1200))]; Thanks Joel Ryan * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Joel Ryan +31 (020) 624-3886 jr@xs4all.nl * Frankfurt Ballet Institute of Sonology * * STEIM Studio for Electro-Instrumental Music * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * From sc-users-owner@bga.com Mon Feb 24 16:27:14 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id QAA18348 for sc-users-outgoing; Mon, 24 Feb 1997 16:21:32 -0600 Received: from clyde.as.utexas.edu (clyde.as.utexas.edu [128.83.129.156]) by zoom.bga.com (8.6.12/8.6.12) with ESMTP id QAA18242 for ; Mon, 24 Feb 1997 16:20:58 -0600 Received: from [128.83.249.132] (slip-99-4.ots.utexas.edu [128.83.249.132]) by clyde.as.utexas.edu (8.6.11/2.01) with ESMTP id QAA05398 for ; Mon, 24 Feb 1997 16:22:35 -0600 Message-Id: In-Reply-To: <199702241925.UAA04073@xs2.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 24 Feb 1997 16:22:04 -0700 To: sc-users@bga.com From: James McCartney <---@---.---> Subject: Re: list iterators Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com At 8:25 PM +0100 2/24/97, jr wrote: >Folks, > >I'm having problems with List Iterators. >I want to apply a function to a list of numbers >and I have been trying to use "change" to do an in place list modification. >It seemed so simple but I'm getting nowhere > >e.g. >trying to convert my existing lists of cents scale tunings to ratios >for use in tuning sample-rate params in buffer players like Acpgrain > > >init { -- placing tests in the "init" section for rapid debugging > tuning = [ 197 341 495 703 853 1009]; > > tuning.change( { arg cents; ^ (2.0 ** (cents/1200.0)) }); > -- OR change( [ tuning, ccc ); > -- OR tuning.change( ccc); > > tuning.post; -- posts [ nil nil nil nil nil ] > } Yup, its a bug. Use 'collect' instead until I upload a fix. I promise to get one up this week. tuning = tuning.collect( { arg cents; ^ (2.0 ** (cents/1200.0)) }) --- james mccartney james@clyde.as.utexas.edu james@lcsaudio.com If you have a PowerMac check out SuperCollider, a real time synth program: ftp://mirror.apple.com//mirrors/Info-Mac.Archive/gst/snd/super-collider-demo.hqx From sc-users-owner@bga.com Mon Feb 24 18:11:58 1997 Received: (from daemon@localhost) by zoom.bga.com (8.6.12/8.6.12) id RAA27880 for sc-users-outgoing; Mon, 24 Feb 1997 17:14:39 -0600 Received: from tango.create.ucsb.edu (create.ucsb.edu [128.111.92.40]) by zoom.bga.com (8.6.12/8.6.12) with SMTP id RAA27865 for ; Mon, 24 Feb 1997 17:14:36 -0600 Received: by tango.create.ucsb.edu (4.1/SMI-4.1) id AA03808; Mon, 24 Feb 97 15:03:31 PST From: stp@create.ucsb.edu (Stephen Travis Pope) Message-Id: <9702242303.AA03808@tango.create.ucsb.edu> Date: Monday, 24 Feb 97 3:09:35 pm Subject: Re: list iterators In-Reply-To: jr 's letter of: 97 Feb 24 To: sc-users@bga.com Fonts: 151 1 Sender: owner-sc-users@bga.com Precedence: bulk Reply-To: sc-users@bga.com Hi Joel! I think you simply need to use a different list iterator, try newTuning = tuning.collect({ arg cents; ^ (2.0 ** (cents/1200.0)) }); stp _Stephen Travis Pope, Center for Research in Electronic Art Technology _(CREATE), Dept. of Music, U. of California, Santa Barbara (UCSB) _Editor, Computer Music Journal (CMJ), MIT Press _stp@create.ucsb.edu http://www.create.ucsb.edu/~stp/