SuperCollider Forum
May 19, 2013, 02:44:03 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The SuperCollider forum is currently experiencing a rash of spambot registrations. New user requests may not be approved quickly as a result -- and if your email address looks like spam, it might not be approved at all. We are working to improve the security of the registration process, and to provide alternate means to contact the administrators to get a new account. Thanks for your patience.
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Simple question  (Read 2658 times)
0 Members and 1 Guest are viewing this topic.
deerwolf
Newbie
*

Karma: 0
Posts: 1


View Profile
« on: September 02, 2006, 09:04:13 PM »

Could anybody help me wtih this? Why can't I dynamically change an argument from a single value to an array without killing the audio? I'm sure I am making a simple mistake here:

x = {arg freqs = 800; SinOsc.ar(freqs, 0, 0.5)}.play // works fine

x.set("freqs", 5000)    // pitch change is working
x.set("freqs", 4000)
x.set("freqs", 3000)

x.set("freqs",[6300, 4040, 2100].choose.postln) //select from array singly is OK...
x.set("freqs",[2000, 7000, 1200].choose.postln)
x.set("freqs",[1230, 3000, 1000].choose.postln)

//BUT....

x.set("freqs",[6000, 4000, 1000].postln) //change to array ("multi-chann expansion") kills it!

// BOOM setting new single pitch at this point blows up filter

x.free


Thanks in advance...


 
Logged
joshp
AdminGroup
Full Member
*

Karma: 5
Posts: 121



View Profile WWW
« Reply #1 on: September 02, 2006, 09:28:53 PM »

You can't multi-channel expand values in a SynthDef dynamically. SynthDefs are precompiled, and the number of UGens inside of them are setp. multi channel expansion is used inside a SynthDef to create more UGens... so, once the SynthDef is compiled, you can't change that.

I suggest creating a simple synthdef, then calling it multiple times if you want multiple values. OR... take a look at the Control help file to see how you can send a number of values into a SynthDef that is already able to handle a number of values.

Hope that helps,

Josh
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!