RE: bbcut2 effects set value

View: New views
4 Messages — Rating Filter:   Alert me  

RE: bbcut2 effects set value

by Marinos Koutsomichalis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just repost it in case sb who can help hasn't noticed it...

.....................

Hello,

I have a gui that adds effects to a BBcut synth that runs.

f.e. 

var gr,bits;
gr=CutGroup(....);

gr.add(CutBit1.new(bits))


*where bits shall be avariable whose value depends over a slider

The last line adds a CutBit1 with first arg  set at bits. My problem is that it gets bits value when created and then it fails to adjust if I change that value.

If I had a synthdef I would just make a slider with .action_(|val| xxx.set(val.value))

How can I change CutBit1 first arg value after it is initiated??


_______________________________________________ 
sc-users mailing list 


Re: RE: bbcut2 effects set value

by Fredrik Olofsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

if you study the many bbcut examples more carefully, you'll see how a  
function often is used as an argument.  the cutbit1 class is no  
exception.
so then instead of function {x} below, you can do {slider.value} (and  
probably you also need a {}.defer around it)

(
var sf, clock;
clock= ExternalClock(TempoClock(2.5));
clock.play;
Routine.run({
sf= BBCutBuffer("sounds/break",8);
s.sync; //this forces a wait for the Buffer to load
g=CutGroup(CutBuf1(sf));
a=BBCut2(g, BBCutProc11.new).play(clock);
});
)

x= 4; y= 8192; z= 1;
g.add(CutBit1({x}, {y}, srmult:{z}));
x= 2
x= 8
y= 4096
y= 1024
z= 0.05
y= 8192


_f


1 jul 2008 kl. 15.14 skrev Marinos Koutsomichalis:

> I just repost it in case sb who can help hasn't noticed it...
>
> .....................
>
> Hello,
>
> I have a gui that adds effects to a BBcut synth that runs.
>
> f.e.
>
> var gr,bits;
> gr=CutGroup(....);
>
> gr.add(CutBit1.new(bits))
>
> *where bits shall be avariable whose value depends over a slider
>
> The last line adds a CutBit1 with first arg  set at bits. My  
> problem is that it gets bits value when created and then it fails  
> to adjust if I change that value.
>
> If I had a synthdef I would just make a slider with .action_(|val|  
> xxx.set(val.value))
>
> How can I change CutBit1 first arg value after it is initiated??


   #|
      fredrikolofsson.com     klippav.org     musicalfieldsforever.com
   |#


_______________________________________________
sc-users mailing list


info (subscribe and unsubscribe): http://swiki.hfbk-hamburg.de:8888/MusicTechnology/880
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: RE: bbcut2 effects set value

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 1, 2008, at 3:39 AM, Fredrik Olofsson wrote:

if you study the many bbcut examples more carefully, you'll see how a function often is used as an argument.  the cutbit1 class is no exception.
so then instead of function {x} below, you can do {slider.value} (and probably you also need a {}.defer around it)

Once you defer the function, its execution becomes asynchronous so the slider value will not be available to the CutBit.

Better to set the slider's action to set an external variable to the new slider value (and probably map the value onto a range other than 0..1 using a ControlSpec), and then refer to the variable instead.

hjh


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



Re: RE: bbcut2 effects set value

by Fredrik Olofsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yes.  you're right.  variable better.
thanks james.
_f

1 jul 2008 kl. 21.15 skrev James Harkins:

On Jul 1, 2008, at 3:39 AM, Fredrik Olofsson wrote:

if you study the many bbcut examples more carefully, you'll see how a function often is used as an argument.  the cutbit1 class is no exception.
so then instead of function {x} below, you can do {slider.value} (and probably you also need a {}.defer around it)

Once you defer the function, its execution becomes asynchronous so the slider value will not be available to the CutBit.

Better to set the slider's action to set an external variable to the new slider value (and probably map the value onto a range other than 0..1 using a ControlSpec), and then refer to the variable instead.

hjh


  #|
     fredrikolofsson.com     klippav.org     musicalfieldsforever.com
  |#

LightInTheBox - Buy quality products at wholesale price