Results 1 to 10 of 10

Thread: OSCulator in SuperCollider

  1. #1

    OSCulator in SuperCollider

    Dear all,hi, (this is my first thread to this list)
    I am using the example of the Osculator on Supercollider where I find it a bit slow concerning the motion and response, in relation of receiving the osc data from the OSCulator in SuperCollider with OSCResponderNodes, if any has any success of using the example and he is satisfied could pass any tips or experience.Let me know if in the whole discussion could help of uploading and sharing the SC doc + the .oscd
    Best
    \K.

  2. #2
    Hi Konstantinos,

    Normally, the reporting rate of the Wiimote should not be altered, this is a rather light process, so I suspect the problem lies on SuperCollider side. You can have a visual readout of what OSCulator processes by selecting a message and pressing the Space key, this will show a "Quick Look" like window with the signal sent from the Wiimote.

    You can also experiment with the smoothing parameter, which has an influence on the perceived latency. This is located in the Wiimote drawer on the right side of the application.

    And yes please, if you could attach the files to this thread that would be great, I will have a look.


    Best,
    Cam

  3. #3
    Hi Cam, first thing I am gonna check is other methods of messaging nodes which in various synthesis techniques are applied for example in granular synthesis is suggested. i.e as appear in the super collider help "In certain cases, such as for granular synthesis it is recommended to use messages directly, because there is no benefit to be gained from the node objects (i.e. no need to message them) and they add cpu load to the client side."
    Maybe that's the case as I am trying to control a granular synthesizer
    By the way how do I upload files here?
    Thanks
    Best
    \K.

  4. #4
    You can add file when you reply by clicking on the "Go Advanced" button, then scroll down and you will see a button to manage the attachments. Thanks!

  5. #5
    Thanks! As it seems now the major issues are solved, although a second opinion might worth.
    I am uploading the code through here as on attaching it returned to be invalid file.


    Best
    \K.
    Attached Files Attached Files
    Last edited by camille; 01-05-2012 at 08:55 AM.

  6. #6
    Hey Konstantinos,

    I am not an expert in SuperCollider, but here's a suggestion:

    You are setting different nodes values with OSC messages, which is fine, but each message only carries one information (rate, rateDev, etc.). You could perhaps optimize the OSC messaging by grouping values together. For example, instead of sending 2 messages from /wii/1/accel/pry, you could send only 1, same thing for /wii/1/nunchuk/accel/pry, you can group the 3 messages in only one.

    Of course, doing this makes the OSC file less flexible, because it seals the index of arguments to be routed.

    I honestly don't know if that will help regarding latency, but instead of sending about 500 messages per second, the rate will go down to 200 / second. If SuperCollider perform a state update on each OSC message received, then it could give a dramatic improvement.

    Honestly I prefer your version as I find it easier to work it, if you need to try other things. And also you could save your OSC routing definitions in a file and use them with other input controllers (click on the gear button to import / export routings) ...

    I'll be curious to know if you can see a difference.


    Best,
    Cam
    Attached Files Attached Files

  7. #7
    One last thing : I haven't tried the SC file, there is a reference to sounds that I don't have.
    I can see that you are doing a FFT with a buffer of 2048 points.

    That could also be the origin of the latency. Doing a FFT and then an inverse FFT introduces a delay by about the length of a buffer. So if you have a 2048 points FFT and you sample rate if 44.1 kHz, that's a (2048/44100) 46 ms delay introduced in the system.

    Add to this the latency of the audio interface (what are your settings ?), etc...

  8. #8
    Hi Cam, concerning the same patch slightly implemented in a different way works absolutely fine, maximum speed and no latency, works as a charm.
    (Average CPU 16 +-) a charm indeed(but there is an issue of synchronous-asynchronous access so I tried to do it otherwise)

    (
    ~myBuffs = SoundFile.collectIntoBuffers("/Users/admin/STUDIO/SCfold/Spec/*");
    a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    v = [0.10];
    ~bufferPointer = 0;
    b = Bus.control(s, 1);
    c = Bus.control(s, 1);
    d = Bus.control(s, 1);
    e = Bus.control(s, 1);
    f = Bus.control(s, 1);
    g = Bus.control(s, 1);
    h = Bus.control(s, 1);
    k = Bus.control(s, 1);
    o = Bus.control(s, 1);
    m = Buffer.alloc(s, 2048, 0);
    l = Buffer.alloc(s, 2048, 0);
    ~myrecBuff = Buffer.alloc(s, 44100 * 120, 1);

    (
    (s.bind
    {

    ~mySynth =
    SynthDef(\inst,
    {arg out = 0, bufnum, b_bufnum;

    var main, xfade, fftA, fftB, morph, x_morph, grains, b_grains, env, center, grainLen, density, rate, rateDev, dur, durDev;

    env = InterplEnv([0, 0.5, 0.8, 0.5, 0],
    [1, 1, 1, 1, ], [\welch, \welch, \welch]);
    density = In.kr(e, 1).linexp(0.25,1, 10, 10000.0).lag!2;
    rate = In.kr(b, 1).linexp(0,1, 0.01, 4.0);
    rateDev = In.kr(c, 1).linexp(0,1, 0.01, 1.0);
    dur = In.kr(g, 1).linexp(0.5,1, 0.02, 2.0);
    durDev = In.kr(d, 1).linexp(0,1, 0.0001, 2.0);
    grainLen = dur * rate;
    center = WhiteNoise.ar(0.5, 0.5).madd(BufDur.kr(bufnum) - grainLen, grainLen * 0.5);
    x_morph = In.kr(f, 1).linlin(0, 1, 0, 1);

    grains =
    TGrains.ar(2, Dust.ar(density),
    bufnum,
    WhiteNoise.ar(rateDev,rate),
    center,
    WhiteNoise.ar(durDev, dur),
    0,0,4,
    amp:0.8);
    b_grains =
    TGrains.ar(2, Dust.ar(density),
    b_bufnum,
    WhiteNoise.ar(rateDev,rate),
    center,
    WhiteNoise.ar(durDev, dur),
    0,0,4,
    amp:0.8);
    fftA = FFT(LocalBuf(2048), grains);
    fftB = FFT(LocalBuf(2048), b_grains);
    morph = PV_Morph(fftA, fftB, x_morph);
    main = Out.ar(out,
    PanB2.ar(
    IFFT(morph) *
    IEnvGen.kr(env, MouseX.kr(0, env.times.sum)) *
    EnvGen.kr(Env.asr(0.01, 1, 0.01))
    .dup),
    MouseX.kr(-1,1), 0.1)
    }).play(args: ([bufnum: (~myBuffs[v]), b_bufnum: (~myBuffs[a])]));


    ~wiiButton_B= OSCresponderNode(nil,'/wii/1/button/B', {arg t, r, msg;
    if(msg[1]==1){
    ~bufferPointer = ~bufferPointer + 1 % ~myBuffs.size;
    ~mySynth.set(\bufnum, ~myBuffs[~bufferPointer]);
    };
    msg.postln;
    }).add;
    ~wiiButton_A = OSCresponderNode(nil,'/wii/1/nunchuk/button/Z', {arg t, r, msg;
    if(msg[1]==1){
    ~bufferPointer = ~bufferPointer + 1 % ~myBuffs.size;
    ~mySynth.set(\b_bufnum, ~myBuffs[~bufferPointer]);
    };
    msg.postln;
    }).add;

    ~wii_Rate = OSCresponderNode(nil,'/wii/1/accel/pry/0',
    {arg t, r, msg;
    b.set(msg[1]);
    }).add;
    ~wii_RateDev = OSCresponderNode(nil,'/wii/1/accel/pry/1',
    {arg t, r, msg;
    c.set(msg[1]);
    }).add;
    ~wii_DurDev = OSCresponderNode(nil,'/wii/1/nunchuk/accel/pry/3', //wii nunchuk pitch
    {arg t, r, msg;
    d.set(msg[1]);
    }).add;
    ~wii_Density = OSCresponderNode(nil,'/wii/1/nunchuk/accel/pry/0',
    {arg t, r, msg;
    e.set(msg[1]);
    }).add;
    ~wii_x_morph = OSCresponderNode(nil,'/wii/1/nunchuk/joy/0',
    {arg t, r, msg;
    f.set(msg[1]);
    }).add;
    ~wii_Dur = OSCresponderNode(nil,'/wii/1/nunchuk/accel/pry/1',
    {arg t, r, msg;
    g.set(msg[1]);
    }).add;
    }))
    )
    Best
    \K.
    Attached Files Attached Files

  9. #9
    By the way you can drag and drop any folder with aiff or wav (probably mp's as well) files on your computer, just drag and drop the folder in the ~myBuffs = SoundFile.collectIntoBuffers("/Users/admin/STUDIO/SCfold/Spec/*"); so the path will appear on that way!

  10. #10
    I solved the problem, it seems that the root of it was in the order of execution, or at least by adopting this way it seems to work!
    Best
    \K.
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •