From: owner-sc-users-digest@lists.io.com (sc-users-digest) To: sc-users-digest@lists.io.com Subject: sc-users-digest V1 #300 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 Thursday, June 7 2001 Volume 01 : Number 300 ---------------------------------------------------------------------- Date: Tue, 5 Jun 2001 13:03:14 -0500 (CDT) From: "Jeremiah T. Isaacs" <---@---.---> Subject: recording patterns aka pattern.record so i need to record to disk some music ive done with patterns, which could be modeled by the first example in "Pattern examples" (but usingt Ppars, see below..) i know sc3 has live recording, should I spend my time taking my code to sc3? or is there a simple method in sc2? i _have_ been searching the mailing list archives (thank you bbedit!) without finding a simple example. am i searching the mailing list in vain? the closest i could find was at the end of Streams-Patterns-Events 4.. stream = pattern.asEventStream(Event.new); Synth.play({ ... where in the example you can put Synth.record, add some paramaters, and it records. but it fails with a Ppar. "Primitive '_Event_Delta' failed." should i move on to sc3? i would do that already, but it appears my work doesnt port as quickly as just wrapping it in {...}.send;. should i just record on another mac connected with an audio cable? should i run away and join the circus? still searching...thanks - j - -- I don't care how sick you say its gonna get my big ass bubble has not busted yet because i feel, i feel fine. i feel fine. BV3G ------------------------------ Date: Tue, 05 Jun 2001 13:45:02 -0500 From: James McCartney <---@---.---> Subject: Re: recording patterns aka pattern.record on 6/5/01 1:03 PM, Jeremiah T. Isaacs at jti@io.com wrote: > > so i need to record to disk some music ive done with patterns, which could > be modeled by the first example in "Pattern examples" (but usingt Ppars, > see below..) > > i know sc3 has live recording, should I spend my time taking my code to > sc3? or is there a simple method in sc2? > > i _have_ been searching the mailing list archives (thank you bbedit!) > without finding a simple example. am i searching the mailing list in > vain? > > the closest i could find was at the end of Streams-Patterns-Events 4.. > > stream = pattern.asEventStream(Event.new); > > Synth.play({ ... > > where in the example you can put Synth.record, add some paramaters, and it > records. but it fails with a Ppar. "Primitive '_Event_Delta' failed." Because that patch is setup to use a value pattern that returns Functions, and a Ppar is an event pattern that returns Events. > > should i move on to sc3? i would do that already, but it appears my work > doesnt port as quickly as just wrapping it in {...}.send;. > > should i just record on another mac connected with an audio cable? > should i run away and join the circus? > > still searching...thanks - j asUGenFunc is what you are looking for. ( var p; p = Ppar([ Pbind(\dur, 0.2, \midinote, Pseq([62, 65, 69, 72], inf)), Pbind(\dur, 0.4, \midinote, Pseq([50, 45], inf)) ]); Synth.record( p.asUGenFunc( nil, 2 ), 10, "mysoundfile.aiff" ); ) - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Tue, 05 Jun 2001 18:07:35 -0400 From: "crucial" <---@---.---> Subject: Re: recording patterns aka pattern.record Synth.record({ // a good time to put on a Limiter, compressor, reverb etc. yourPattern.asSpawn(protoEvent,numChannels) },nil // nil duration lasts for ever..... or until you hit control . ,"pathname.aiff" ) _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Tue, 05 Jun 2001 20:28:09 -0400 From: christian adam hresko <---@---.---> Subject: video manip james, do you have any future plans of incorporating realtime video manipulation into SC? i realize your plate is more than full, but i was just curious where the whole image warp/image synthesis idea was going. or is this type of thing going to be left to third parties, like NAT0? (streaming video/DVD...) cheers, christian ------------------------------ Date: Tue, 5 Jun 2001 20:44:26 -0400 From: "bsom@bsom.org" <---@---.---> Subject: RE: video manip Good question, Christian. I have just started dabbling in video manipulation stuff myself and have just purchased a few programs for this purpose. I was looking at NATO, and it seems well suited, but what's with that webpage? It's impossible to navigate and read?!? Contact me off of the list if you want to discuss this more... //bsom Original Message: - ----------------- From: christian adam hresko godpup@ix.netcom.com Date: Tue, 05 Jun 2001 20:28:09 -0400 To: sc-users@lists.io.com Subject: video manip james, do you have any future plans of incorporating realtime video manipulation into SC? i realize your plate is more than full, but i was just curious where the whole image warp/image synthesis idea was going. or is this type of thing going to be left to third parties, like NAT0? (streaming video/DVD...) cheers, christian - -------------------------------------------------------------------- Mail2Web - Check your email from the web at http://www.mail2web.com/ . ------------------------------ Date: Tue, 5 Jun 2001 18:53:21 -0700 (PDT) From: Arne Hanna <---@---.---> Subject: PLazy Hi Folks. James' recent post re Michael Theodore's pattern question produces a parse error. This would seem to suggest that SC2.2.10 seems not to know anything of PLazy. Is this not part of the standard lib? Cheers Arne __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ ------------------------------ Date: Wed, 6 Jun 2001 05:04:33 +0200 (CEST) From: integer@www.god-emil.dk Subject: RE: kr!!!!ket manip >Good question, Christian. I have just started dabbling in video >manipulation stuff myself and have just purchased a few programs for >this purpose. I was looking at NATO, and it seems well suited, but >what's with that webpage? It's impossible to navigate and read?!? peut etre = its skope to selekt life forms at 01 remarkable distance keep. - - repeat aftr m! - - this is totally amazing - tonight i am a hydra. stream through me. - - m9ndfukc.macht.fre! _||- ee d c b a rr q p o n m l k j i h g f e d c b a 0 0 0 || KORPORAT KR!EG MACHT 3k0R KUNST N[>] IMF - the International Meme Fund - shear pathway to the core. - promoting meme development. lokomotion. + reinvestment. - meme sekurity + meme transaktions. [>] ||||||||||||||||||||| rekurrent exc!tat!on || ||||||||eusocial.com – – – – – – – – – – – – Ò – – – – – – – – – – – – – – – – – pro satisfacer le metro – – Ò – – – – – – – – – – – – – – – – – – – – – < 0\ zve!te[z]!ztem \1 > ------------------------------ Date: Tue, 05 Jun 2001 22:09:48 -0500 From: James McCartney <---@---.---> Subject: Re: PLazy on 6/5/01 8:53 PM, Arne Hanna at mogambo1.geo@yahoo.com wrote: > Hi Folks. James' recent post re Michael Theodore's > pattern question produces a parse error. This would > seem to suggest that SC2.2.10 seems not to know > anything of PLazy. Is this not part of the standard > lib? > > Cheers > Arne You're right, sorry about that.. Plazy : Pattern { var <>function; *new { arg function; ^super.new.function_(function); } asStream { ^function.value.asStream; } } Plazy is a Pattern that, when asStream is called, calls a function to create the Pattern from which a stream is made. Thus it is a way of creating and using patterns dynamically. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 6 Jun 2001 00:50:56 EDT From: JoJoBuBu@aol.com Subject: OpenAL - --part1_3c.cb0a4e2.284f10b0_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Has anyone used this SDK for anything? I've been considering plowing through the docs but wouldn't mind getting some feedback on whether its worth the effort. Just from my brief exposure the examples look pretty cool. Doesn't look nearly as versatile as SC, but it might be a way to add some audio support to programs without huge difficulty... Any thoughts...??? Difficult? incomplete? Great? Thanks in advance, Andy - --part1_3c.cb0a4e2.284f10b0_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit Has anyone used this SDK for anything? I've been considering plowing through
the docs but wouldn't mind getting some feedback on whether its worth the
effort.  

Just from my brief exposure the examples look pretty cool. Doesn't look
nearly as versatile as SC, but it might be a way to add some audio support to
programs without huge difficulty...

Any thoughts...??? Difficult? incomplete? Great?

Thanks in advance,

Andy

- --part1_3c.cb0a4e2.284f10b0_boundary-- ------------------------------ Date: Tue, 05 Jun 2001 22:20:47 -0700 From: cramakrishnan@acm.org Subject: Re: OpenAL JoJoBuBu@aol.com writes: > Has anyone used this SDK for anything? I've been considering plowing through > the docs but wouldn't mind getting some feedback on whether its worth the > effort. Isn't OpenAL primarily for doing specialized audio? Is it suitable for doing realtime composition/processing? As far as software out there to that might nicely augment SuperCollider, the old NeXT MusicKit looks like a possibility (thanks for mentioning that, Jeff Shell). Unfortunately, none of the DSP ugens run on Apple hardware, but it could be fun to try to implement them. I hope to take a look into this sometime soon... - - sekhar - -- C. Ramakrishnan cramakrishnan@acm.org ------------------------------ Date: Tue, 05 Jun 2001 22:30:08 -0700 From: cramakrishnan@acm.org Subject: Re: OpenAL cramakrishnan@acm.org writes: > Isn't OpenAL primarily for doing specialized audio? Is it suitable ^^^^^^^^^^^ I meant "spatialized". - - sekhar - -- C. Ramakrishnan cramakrishnan@acm.org ------------------------------ Date: Wed, 6 Jun 2001 01:34:07 EDT From: JoJoBuBu@aol.com Subject: Re: OpenAL - --part1_50.16bfad69.284f1acf_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 1:22:51 AM Eastern Daylight Time, cramakrishnan@acm.org writes: > > JoJoBuBu@aol.com writes: > > Has anyone used this SDK for anything? I've been considering plowing > through > > the docs but wouldn't mind getting some feedback on whether its worth the > > effort. > > Isn't OpenAL primarily for doing specialized audio? Is it suitable > for doing realtime composition/processing? > > As far as software out there to that might nicely augment > SuperCollider, the old NeXT MusicKit looks like a possibility (thanks > for mentioning that, Jeff Shell). > > Unfortunately, none of the DSP ugens run on Apple hardware, but it > could be fun to try to implement them. I hope to take a look into > this sometime soon... > > No I dont think openAL is for real time composition. My guess from briefly perrusing the examples and reading a little is that it will play around with spatialized audio, play soundiles, and bla bla. I was thinking of it as a way to use sound support on PC, although the SDK is cross platform, C++ programs without digging through directX docs, (which I've heard is a real pain). Looking back at my post I should have mentioned that that is what I was looking to do, not really for real time audio. SC is Where is the Next MusicKit located? Is it a C++ SDK? (I must have missed that post) Thanks for the quick response, Andy - --part1_50.16bfad69.284f1acf_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 1:22:51 AM Eastern Daylight Time,
cramakrishnan@acm.org writes:



JoJoBuBu@aol.com writes:
> Has anyone used this SDK for anything? I've been considering plowing
through
> the docs but wouldn't mind getting some feedback on whether its worth the
> effort.  

Isn't OpenAL primarily for doing specialized audio?  Is it suitable
for doing realtime composition/processing?

As far as software out there to that might nicely augment
SuperCollider, the old NeXT MusicKit looks like a possibility (thanks
for mentioning that, Jeff Shell).

Unfortunately, none of the DSP ugens run on Apple hardware, but it
could be fun to try to implement them.  I hope to take a look into
this sometime soon...

- sekhar


No I dont think openAL is for real time composition. My guess from briefly
perrusing the examples and reading a little is that it will play around with
spatialized audio, play soundiles, and bla bla. I was thinking of it as a way
to use sound support on PC, although the SDK is cross platform, C++ programs
without digging through directX docs, (which I've heard is a real pain).
Looking back at my post I should have mentioned that that is what I was
looking to do, not really for real time audio. SC is Where is the Next
MusicKit located? Is it a C++ SDK?  (I must have missed that post)

Thanks for the quick response,

Andy
- --part1_50.16bfad69.284f1acf_boundary-- ------------------------------ Date: Wed, 6 Jun 2001 01:39:01 EDT From: JoJoBuBu@aol.com Subject: Re: OpenAL - --part1_a4.15111e67.284f1bf5_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 1:36:23 AM Eastern Daylight Time, JoJoBuBu@aol.com writes: > Looking back at my post I should have mentioned that that is what I was > Ack I meant to say SC is what I will use for real time stuff, but I'm kind of looking for an SDK to add audio to C++ programs and I was thinking of openAL... Andy - --part1_a4.15111e67.284f1bf5_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 1:36:23 AM Eastern Daylight Time,
JoJoBuBu@aol.com writes:


Looking back at my post I should have mentioned that that is what I was
looking to do, not really for real time audio. SC is


Ack I meant to say SC is what I will use for real time stuff, but I'm kind of
looking for an SDK to add audio to C++ programs and I was thinking of
openAL...

Andy
- --part1_a4.15111e67.284f1bf5_boundary-- ------------------------------ Date: Wed, 06 Jun 2001 09:56:31 +0200 From: "Joachim Gossmann" <---@---.---> Subject: [OT] OpenAL OpenAL (http://www.openal.org) is an API that was developed to complement OpenGL (Open Graphics Library) for the Audio world. Its main focus is to provide a low-level API for virtual reality audio rendering. That means the focus is audio for games. It is a powerful standard though and supported by a large portion of the industry. It is in no way comparable to SuperCollider in terms of functionality for doing realtime electronic music though. Are there people who use SuperCollider for room simulation and/or HRTF-convolution? (* curious *) jo ------------------------------ Date: Wed, 06 Jun 2001 01:16:05 -0700 From: tyamasa@haywire.csuhayward.edu Subject: [OT] HRTF I found a set of "impulse responce" of HRTF, done by somebody at some university. that was lots of files, big files. (like, combination of direction, azimth, and head type.) To do HRTF, you can do it either: 1. impulse responce or 2. filter based on approximated graph (less data, I guess.) Sound hack use #2 I guess (you choose direction and height, or draw a graph) SC has Azimth panner no? can we hack it? for the filter, you must use some sort of impulse responce, maybe by direction, and simulate azimth... don't trust me. ------------------------------ Date: Wed, 06 Jun 2001 14:23:59 +0100 From: "Fabrice Mogini" <---@---.---> Subject: First question: Sequencing. How can I record MIDI IN data in S.C.? Pitch values are easy to print out by writing (note.midicps).post inside the Voicer object. It seems more tricky to store other data like durations values as Delta time is 0. Second question: Real-time programming. Does ayone know if it is possible to write some code in real time (while the main synth's code is already running) for instance using a pause object with its own synth that would only be activated when the new code is ready? Cheers Fabrice end ------------------------------ Date: Wed, 06 Jun 2001 14:58:22 +0100 From: Martin Robinson <---@---.---> Subject: Re: > > Second question: > Real-time programming. > Does ayone know if it is possible to write some code in real time > (while the main synth's code is already running) > for instance using a pause object with its own synth that would only be > activated > when the new code is ready? > You could send a function to a TSpawn via extra arguments (or modify the TrigXFade class to take extra args). You could then modify the function and resend it to the TSpawn to dispose the old function and install the new one. Martin - -- ..>>>>Martin Robinson :: (Ex)tractor :: && ________ >>><<<_[sonic arts]_[middlesex university]_[en4 8ht] ______ ________________________________________________________________ ________________________________________________________________ >><<>>___t.+44 [0] 7970 405 903 // f.+44 [0] 7970 702 976 __ >><><>____e. _ ------------------------------ Date: Wed, 06 Jun 2001 17:02:21 +0200 From: Hairi <---@---.---> Subject: sc3 patching ugens hi james and everybody. i am recently getting into understanding SC3 but i could not figure out the following: how can i pass the output of an ugen to the input of another ugen that has been started inside a closed function sent to the RTVM at a different time ? i managed to use common variables for different closed functions (in the RTVM) , they accept to point to an ugen , but when i use setInput and the source is not in the same function as the destination is, a 'notEnclosingGroup' error occurs . I alspo tried using Plug and it's .source method , but same result (of course). a word about topSpawner , groups , transferring synths from one spawn to the other (why?), would be of great help. Thanks Hairi ------------------------------ Date: Wed, 6 Jun 2001 11:42:44 -0500 From: "t. krakowiak" <---@---.---> Subject: sc3 hi! is there a way to downlaod and use sc3 ? just to look at it. ------------------------------ Date: Wed, 06 Jun 2001 10:48:45 -0500 From: James McCartney <---@---.---> Subject: Re: sc3 patching ugens on 6/6/01 10:02 AM, Hairi at hvogel@tin.it wrote: > how can i pass the output of an ugen to the input of another ugen that > has been started inside a > closed function sent to the RTVM at a different time ? You can't at this time. You set Plugs as in version 2. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Wed, 06 Jun 2001 09:07:29 -0700 From: cramakrishnan@acm.org Subject: Re: OpenAL JoJoBuBu@aol.com writes: > In a message dated 6/6/2001 1:22:51 AM Eastern Daylight Time, > cramakrishnan@acm.org writes: > looking to do, not really for real time audio. SC is Where is the Next > MusicKit located? Is it a C++ SDK? (I must have missed that post) Here are two links: http://ccrma-www.stanford.edu/CCRMA/Software/MusicKit/MusicKit.html http://musickit.sourceforge.net/ You can d/l it from the second. They also explain what they are trying to do with the MusicKit on OS X. The MusicKit is written Objective-C and runs against OpenStep/Cocoa. They say that there is a Python/Objective-C bridge that can be used to access the MusicKit from Python. - - sekhar - -- C. Ramakrishnan cramakrishnan@acm.org ------------------------------ Date: Wed, 6 Jun 2001 12:23:12 EDT From: JoJoBuBu@aol.com Subject: Re: [OT] OpenAL - --part1_b7.ef0ca6a.284fb2f0_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 3:55:43 AM Eastern Daylight Time, jo@shoko.calarts.edu writes: > OpenAL (http://www.openal.org) is an API that was developed to complement > OpenGL (Open Graphics Library) for the Audio world. Its main focus is to > provide a low-level API for virtual reality audio rendering. That means the > focus is audio for games. It is a powerful standard though and supported by > a large portion of the industry. > It is in no way comparable to SuperCollider in terms of functionality for > doing realtime electronic music though. > > Are there people who use SuperCollider for room simulation and/or > HRTF-convolution? > (* curious *) > > jo > Hmm ok cool. I was aware it wasn't really for composition, but I didn't know how standardized it was getting, although I knew creative labs supports it. Thanks for the info. Andy - --part1_b7.ef0ca6a.284fb2f0_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 6/6/2001 3:55:43 AM Eastern Daylight Time,
jo@shoko.calarts.edu writes:


OpenAL (http://www.openal.org) is an API that was developed to complement
OpenGL (Open Graphics Library) for the Audio world. Its main focus is to
provide a low-level API for virtual reality audio rendering. That means the
focus is audio for games. It is a powerful standard though and supported by
a large portion of the industry.
It is in no way comparable to SuperCollider in terms of functionality for
doing realtime electronic music though.

Are there people who use SuperCollider for room simulation and/or
HRTF-convolution?
(* curious *)

jo


Hmm ok cool. I was aware it wasn't really for composition, but I didn't know
how standardized it was getting, although I knew creative labs supports it.
Thanks for the info.

Andy
- --part1_b7.ef0ca6a.284fb2f0_boundary-- ------------------------------ Date: Wed, 6 Jun 2001 12:45:38 EDT From: JoJoBuBu@aol.com Subject: Re: OpenAL - --part1_91.b9ff566.284fb832_boundary Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Great thanks Sekhar thats very helpful!! In a message dated 6/6/2001 12:20:08 PM Eastern Daylight Time, cramakrishnan@acm.org writes: > JoJoBuBu@aol.com writes: > > In a message dated 6/6/2001 1:22:51 AM Eastern Daylight Time, > > cramakrishnan@acm.org writes: > > looking to do, not really for real time audio. SC is Where is the Next > > MusicKit located? Is it a C++ SDK? (I must have missed that post) > > Here are two links: > > http://ccrma-www.stanford.edu/CCRMA/Software/MusicKit/MusicKit.html > http://musickit.sourceforge.net/ > > You can d/l it from the second. They also explain what they are > trying to do with the MusicKit on OS X. > > The MusicKit is written Objective-C and runs against OpenStep/Cocoa. > They say that there is a Python/Objective-C bridge that can be used to > access the MusicKit from Python. > > - sekhar > > -- > C. Ramakrishnan cramakrishnan@acm.org > - --part1_91.b9ff566.284fb832_boundary Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: 7bit Great thanks Sekhar thats very helpful!!


In a message dated 6/6/2001 12:20:08 PM Eastern Daylight Time,
cramakrishnan@acm.org writes:


JoJoBuBu@aol.com writes:
> In a message dated 6/6/2001 1:22:51 AM Eastern Daylight Time,
> cramakrishnan@acm.org writes:
> looking to do, not really for real time audio. SC is Where is the Next
> MusicKit located? Is it a C++ SDK?  (I must have missed that post)

Here are two links:

 http://ccrma-www.stanford.edu/CCRMA/Software/MusicKit/MusicKit.html
 http://musickit.sourceforge.net/

You can d/l it from the second.  They also explain what they are
trying to do with the MusicKit on OS X.

The MusicKit is written Objective-C and runs against OpenStep/Cocoa.
They say that there is a Python/Objective-C bridge that can be used to
access the MusicKit from Python.

- sekhar

--
C. Ramakrishnan        cramakrishnan@acm.org

- --part1_91.b9ff566.284fb832_boundary-- ------------------------------ Date: Wed, 06 Jun 2001 14:17:21 -0400 From: "crucial" <---@---.---> Subject: recording events/ m1d1 in etc. > >First question: >Sequencing. >How can I record MIDI IN data in S.C.? >Pitch values are easy to print out by writing (note.midicps).post inside the >Voicer object. >It seems more tricky to store other data like durations values as Delta time >is 0. Part of what I'm doing right now opens up a nice way to record events of any sort. (I have a previous event recorder, but the implementation is messy.) This is part of the Player system I will be posting soon. briefly: Patch - can play an Instrument SFP - can play a sound file EventStreamPlayer - can play a pattern for recording time-specified events of any sort, I will do a PriorityQueue based event player. normal patterns use a delta based system (each event determines when the next event will happen). so the time-specified event recorder could be written to by midi, wacom tablet or mouse clicks. the delta time zero problem you have is because you are checking the synth inside the Voicer ? check the synth immediately outside the voicer (if that makes sense) schedSynth = thisSynth; Voicer.ar({ schedSynth.beats.postln; ... }) _____(( http://crucial-systems.com _________________))_______ ------------------------------ Date: Wed, 06 Jun 2001 20:48:50 -0400 From: christian adam hresko <---@---.---> Subject: Re: [OT] HRTF tyamasa@haywire.csuhayward.edu wrote: > I found a set of "impulse responce" of HRTF, done by somebody at some > university. that was lots of files, big files. (like, combination of > direction, azimth, and head type.) To do HRTF, you can do it either: 1. > impulse responce or 2. filter based on approximated graph (less data, I > guess.) Sound hack use #2 I guess (you choose direction and height, or draw > a graph) SC has Azimth panner no? can we hack it? > > for the filter, you must use some sort of impulse responce, maybe by > direction, and simulate azimth... don't trust me. errr... i worked with tucker-davis machines (DSP modules...) when i was contracted by the DOD. the physicist i worked with did most of the work, since he knew what he was doing. anyway... we worked with MatLab and did a buttload of little projects involving HRTFs. if anyone would like, i can contact him and snag the MatLab code. not that hard to go from MatLab (well, there were some calls to another program he wrote in Pascal... i can try and get that as well) to SuperCollider. mainly research that involved normalization and some 'tricky' FIR/IIR mathematics. very cool stuff though. cheers, christian ------------------------------ Date: Wed, 6 Jun 2001 21:54:05 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: text file i/o I have a large array of literals, e.g. z = [1,2.123, 44, "text", [2,3,1]]; that I want to simply read in from a file each time rather than include in the SC file. I see how to read it in as a string, but I don't see how to read it in as an array of literals, or convert it to such. Is it necessary to first write it as a binary file, and then read it in that way? thanks paul lansky ------------------------------ Date: Wed, 6 Jun 2001 22:40:36 -0400 (EDT) From: Paul Lansky <---@---.---> Subject: Re: text file i/o of course I meant z = #[1,2.123, 44, "text", [2,3,1]]; pl ------------------------------ Date: Wed, 06 Jun 2001 21:49:47 -0500 From: James McCartney <---@---.---> Subject: Re: text file i/o on 6/6/01 9:40 PM, Paul Lansky at paul@silvertone.Princeton.EDU wrote: > of course I meant > z = #[1,2.123, 44, "text", [2,3,1]]; > > pl > You can have a text file containing #[1,2.123, 44, "text", [2,3,1]] and then do this: z = thisProcess.interpreter.executeFile("myFileName"); z.postln; - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ Date: Thu, 07 Jun 2001 12:13:41 +0100 From: "fabs mogini" <---@---.---> Subject: > THIS MESSAGE IS IN MIME FORMAT. Since your mail reader does not understand this format, some or all of this message may not be legible. - --MS_Mac_OE_3074760821_55640_MIME_Part Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Hi, This is a question about collections in S.C with a bit of Maths. First, what I am trying to do: Since I have discovered Pswitch, I use it live to change patterns with a GuiWindow. It is very useful since it waits until the normal end of the current pattern before starting the next pattern that I have selected manualy (so all my new patterns start in perfect rhythm). I have prepared a few duration patterns (in beats) tochoose from, in a live situation: Pseq([2,3,1,1],1) Pseq([3,3,2],1) Pseq([5,3],1) etc... The queestion: I would like to have the option of selecting random patterns, with (7.rand+1) elements in the array and whose sum of elements always gives 8(which stands for 8 beats). I want indeed to make sure I get this result of 8 beats because when I will call a new pattern with Pswitch,this new pattern will for sure start on a strong beat (as the previous one had itself 8 beats). I would like as well this random pattern to keep on generating patterns (instead of repeating the same one) every time it as created a complete one (one whose sum of elements is 8). I don't really know if I should look for a result in an array [] to then place in a Pseq() to obtain: Pseq([])....or if maybe I need to do that in a Pfunc({}) but then, how can I get new results depending on the last ones? Anyway, here are a few attempts to write the code: Does anyone know how to debug it or even write it in a simpler way? Cheers Fabs ( Synth.play({ var randomarray; var counter; var randompattern; randomarray = {var n; n = (7.rand+1); if (n = 1; {p = [8]; };); //this part should be ok if (n = 2; { a = 6.rand+1; b = 8-a; p = [a,b].scramble; }; ); if (n = 3; { a = 5.rand+1; b = (6-a).rand+1; c = 8-(a+b); p = [a,b,c].scramble; }; ); if (n = 4; { a = 4.rand+1; b = (5-a).rand+1; c = (6-(a+b)).rand+1; d = 8-(a+b+c+d); p = [a,b,c,d].scramble; }; ); if (n = 5; { a = 3.rand+1; b = (4-a).rand+1; c = (5-(a+b)).rand+1; d = (6-(a+b+c)).rand+1; e = 8-(a+b+c+d); p = [a,b,c,d,e].scramble; }; ); if (n = 6; {a = [3,2].choose; b = 4-a; p = [1,1,1,1,a,b].scramble;};); if (n = 7; { p = [1,1,1,1,1,1,1,2].scramble;};); if (n = 8; { p = [1,1,1,1,1,1,1,1];};); //maybe this needs to be outside the function? counter=0; randomarray.value; //maybe I need to write randomarray.asStream and call randomarray.next? }; randompattern = Pfunc({ var output; if( (counter==p.size),{randomarray.value; counter=0; output=p.at(counter); counter=counter+1; output }); }); Pbind( \dur,a, \ugenFunc, { arg dur; SinOsc.ar(200,0, EnvGen.kr(Env.linen(0,dur,0,0.2),1)); }; ).asSpawn(channels: 1); }) ) end - --MS_Mac_OE_3074760821_55640_MIME_Part Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable <no subject> Hi,
This is a question about collections in S.C with a bit of Maths.
 
First, what I am trying to do:

Since I have discovered Pswitch, I use it live to change patterns with a Gu= iWindow.
It is very useful since it waits until the normal end of the current patter= n before
starting the next pattern that I have selected manualy (so all my new patte= rns start in perfect rhythm).


I have prepared a few duration patterns (in beats) tochoose from, in a live= situation:
 Pseq([2,3,1,1],1)
 Pseq([3,3,2],1)
 Pseq([5,3],1) etc...

The queestion:

I would like to have the option of selecting  random patterns,
with (7.rand+1) elements in the array and whose sum of elements
 always gives 8
(which stands for 8 beats).

I want indeed to make sure I get this result of 8 beats because when I will= call a new pattern with Pswitch,this new pattern will for sure start
on a strong beat (as the previous one had itself 8 beats).
I would like as well this random pattern to keep on generating patterns (in= stead of repeating the same one) every time it as created
a complete one (one whose sum of elements is 8).

I don't really know if I should look for a result in an array [] to then pl= ace in a Pseq()
to obtain: Pseq([])....or if maybe I need to do that in a Pfunc({}) but the= n, how can I get new
results depending on the last ones?

Anyway, here are a few attempts to write the code:
Does anyone know how to debug it or even write it in a simpler way?
 
Cheers
  Fabs

(
Synth.play({

var randomarray;
var counter;
var randompattern;

randomarray =3D {var n; n =3D (7.rand+1);

if (n =3D 1; {p =3D [8]; };);    //this part should be ok
if (n =3D 2; { a =3D 6.rand+1;
    b =3D 8-a;
   p =3D [a,b].scramble; }; );

if (n =3D 3; { a =3D 5.rand+1;
    b =3D (6-a).rand+1;
    c =3D 8-(a+b);
   p =3D [a,b,c].scramble; }; );

if (n =3D 4; { a =3D 4.rand+1;
    b =3D (5-a).rand+1;
    c =3D (6-(a+b)).rand+1;
    d =3D 8-(a+b+c+d);
   p =3D [a,b,c,d].scramble; }; );

if (n =3D 5; { a =3D 3.rand+1;
    b =3D (4-a).rand+1;
    c =3D (5-(a+b)).rand+1;
    d =3D (6-(a+b+c)).rand+1;
    e =3D 8-(a+b+c+d);
   p =3D [a,b,c,d,e].scramble; }; );
   
if (n =3D 6; {a =3D [3,2].choose; b =3D 4-a; p =3D [1,1,1,1,a,b].scramble;};);

if (n =3D 7; { p =3D [1,1,1,1,1,1,1,2].scramble;};);

if (n =3D 8; { p =3D [1,1,1,1,1,1,1,1];};);

   //maybe this needs to be outside the function?
counter=3D0;
randomarray.value;
   //maybe I need to write randomarray.asStream and call ran= domarray.next?
};
     
randompattern =3D Pfunc({ var output;
     if(   (counter=3D=3Dp.size),{randomarra= y.value;
          counter=3D0;
          output=3Dp.at(cou= nter);
          counter=3Dcounter= +1;
          output
          });

    });


Pbind(
\dur,a,
\ugenFunc, {  arg dur;  SinOsc.ar(200,0, EnvGen.kr(Env.linen(0,du= r,0,0.2),1)); };
 
 ).asSpawn(channels: 1);

})
)

end
- --MS_Mac_OE_3074760821_55640_MIME_Part-- ------------------------------ Date: Thu, 07 Jun 2001 09:03:58 -0500 From: James McCartney <---@---.---> Subject: Re: random duration patterns ( var randomPatternFunc; randomPatternFunc = { arg totalDur, numEvents; var attacks; attacks = Array.series(totalDur - 1,1,1).scramble.copyFromStart(numEvents - 2).add(0).sort; attacks.rotate(-1).put(numEvents - 1, totalDur) - attacks; }; p = Pn(Plazy({ Pseq( randomPatternFunc.value(8, 7.rand + 1).postln, 1); }), inf); Ppar([ Pbind(\tempo, 5, \dur, p, \note, Pwhite(0,12,inf)), Pbind(\tempo, 5, \dur, 8, \note, Pwhite(-16,-8,inf)) ]).play; ) Two main points. The randomPattern function can be written much more simply. Use Plazy to create patterns dynamically. How randomPatternFunc works: It takes two arguments, the total duration of the list and the number of events in the list. It returns a list of durations. The first step is to create a list of N random attack points in the measure. First it creates a series from 1 to the totalDur - 1. For 8 beat duration this would be [1, 2, 3, 4, 5, 6, 7]. It then scrambles the list and takes the first numEvents - 1 of them which is indices (0 .. numEvents - 2). (If numEvents is 1 then the result of this is the empty list []). Then we add 0 to the list and sort what we have left. This gives us the list of random attack points in the measure. In order to generate durations from these we need to subtract each from its right neighbor and subtract the last one from the total duration. We do this by rotating the list left by one, replacing the last value with the totalDuration and subtracting the original from this shifted list. The result is a list of durations that sum to the total duration. - --- james mccartney james@audiosynth.com SuperCollider - a real time synthesis programming language for the PowerMac. ------------------------------ End of sc-users-digest V1 #300 ******************************