Quantcast

creating a NodeProxy on server boot

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

creating a NodeProxy on server boot

5tefan
Hi all,

I'm trying to automatically create a NodeProxy as soon as the server is
booted. If boot the server manually ahead from the s.bind {...} part in
the following code things work fine. However if I wrap that part in a
s.waitForBoot {...} the NodeProxy doesn't get initialized correctly and
no synth's being created on the server.
Does anyone have an idea how to make this work?

Thanks, Stefan

s.waitForBoot {
        s.bind {
                "s is running: %\n".postf(s.serverRunning);
                b = Buffer.allocConsecutive(5, s, s.sampleRate.asInteger);
                s.sync;
                r = NodeProxy.audio(s, 1).quant_([4, 0, 0, 1]);
                r[0] = {
                        var soundIn = SoundIn.ar(\in.kr(0)).scope("sampler in");
                        BufWr.ar(soundIn, \bufnum.kr(0), Phasor.ar(
                                0, BufRateScale.kr(\bufnum.kr(0), 1), 0, BufFrames.kr(\bufnum.kr(0))
                        ));
                        // play silently
                        Silent.ar;
                };
                "r is playing: %\n".postf(r.isPlaying);
        }
}

_______________________________________________
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
|  
Report Content as Inappropriate

Re: creating a NodeProxy on server boot

Kuivila, Ronald
Try

 r = NodeProxy.audio(s, 1).quant_([4, 0, 0, 1]); s.sync;

to give the server time to do its stuff.....

RJK

> On May 9, 2017, at 8:03 AM, [hidden email] wrote:
>
> Hi all,
>
> I'm trying to automatically create a NodeProxy as soon as the server is
> booted. If boot the server manually ahead from the s.bind {...} part in
> the following code things work fine. However if I wrap that part in a
> s.waitForBoot {...} the NodeProxy doesn't get initialized correctly and
> no synth's being created on the server.
> Does anyone have an idea how to make this work?
>
> Thanks, Stefan
>
> s.waitForBoot {
> s.bind {
> "s is running: %\n".postf(s.serverRunning);
> b = Buffer.allocConsecutive(5, s, s.sampleRate.asInteger);
> s.sync;
> r = NodeProxy.audio(s, 1).quant_([4, 0, 0, 1]);
> r[0] = {
> var soundIn = SoundIn.ar(\in.kr(0)).scope("sampler in");
> BufWr.ar(soundIn, \bufnum.kr(0), Phasor.ar(
> 0, BufRateScale.kr(\bufnum.kr(0), 1), 0, BufFrames.kr(\bufnum.kr(0))
> ));
> // play silently
> Silent.ar;
> };
> "r is playing: %\n".postf(r.isPlaying);
> }
> }
>
> _______________________________________________
> 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
|  
Report Content as Inappropriate

Re: creating a NodeProxy on server boot

5tefan


Am 2017-05-09 um 14:15 schrieb Kuivila, Ronald:
> Try
>
>  r = NodeProxy.audio(s, 1).quant_([4, 0, 0, 1]); s.sync;
>
> to give the server time to do its stuff...

Thanks Ronald. I already tried that but it didn't help. As I already
said, if I boot the server manually, ahead from executing the
s.bind{...} block everything works fine (even without s.sync after
initializing the NodeProxy).
It's a hard to debug this: r.isPlaying reports 'true', r.group reports a
node id - yet, if I dump the node tree I see that group doesn't exist on
the server. It is somehow related to .waitForBoot - dunno, is
.waitForBoot not quite doing what it is expected to do? Additionally to
's.sync' I've added a little wait time. But no matter how long I wait
things refuse to work properly if the code is executed within a
waitForBoot block (even if the server is already booted).
(fyi: I'm using SC 3.9dev - maybe this works on SC < 3.9?)

thanks, Stefan



_______________________________________________
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/
Loading...