writing to and accessing control bus for timing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

writing to and accessing control bus for timing

Patrick McGraw
I must be missing something basic, because I swear I had something very similar to this working a few days ago before my graphics card burned out and I was unable to save my work. I am trying to create a continuously running timer that writes to a control bus, so that I can get a currently updated time value from within another block of code.  Why isn't the following working?  (the getSynchronous just keeps returning 0 instead of the updated time.)  I can't figure out what I'm doing differently from before I lost my work:
 

(
SynthDef.new(\TimeControl,
        {
                // Output running time to a control bus
                arg outbus;
                var timer = Sweep.kr(1);
                Out.kr(outbus,timer);
        };
).add;
)
// Test the timer
c = Bus.control(s,1);
z=Synth(\TimeControl,c);
c.getSynchronous; // Why is this giving 0 and not the time since the TimeControl synth was created?
Reply | Threaded
Open this post in threaded view
|

Re: writing to and accessing control bus for timing

spluta
Try changing this line:

z=Synth(\TimeControl,[\outbus, c]);

Sam

> On May 13, 2017, at 2:52 PM, [hidden email] wrote:
>
> I must be missing something basic, because I swear I had something very
> similar to this working a few days ago before my graphics card burned out
> and I was unable to save my work. I am trying to create a continuously
> running timer that writes to a control bus, so that I can get a currently
> updated time value from within another block of code.  Why isn't the
> following working?  (the getSynchronous just keeps returning 0 instead of
> the updated time.)  I can't figure out what I'm doing differently from
> before I lost my work:
>
>
> (
> SynthDef.new(\TimeControl,
> {
> // Output running time to a control bus
> arg outbus;
> var timer = Sweep.kr(1);
> Out.kr(outbus,timer);
> };
> ).add;
> )
> // Test the timer
> c = Bus.control(s,1);
> z=Synth(\TimeControl,c);
> c.getSynchronous; // Why is this giving 0 and not the time since the
> TimeControl synth was created?
>
>
>
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/writing-to-and-accessing-control-bus-for-timing-tp7632345.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: writing to and accessing control bus for timing

Patrick McGraw
Oops!  Yeah, I figured it might be something basic that I was missing in my frustrated state of mind.  Thanks!