Timing issue between oscillators

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

Timing issue between oscillators

Ch4n
Hi there, I'm experiencing a temporal problem between oscillators, i want to use an LFNoise0 as a gate envelope on a sine but the oscillators are no synchronized for long time so the gate start to generate clicks on the sine and getting stronger and stronger.
I wonder to know how to fix it, this is my situation:

(play{

        x = LFNoise0.ar(8.8).abs.round;
       
        sin(LFSaw.ar(44*x).range(0,2pi))*x!2})

I try to create a sine oscillator to avoid the issues but the result is the same.
There is a way to obtain more stable oscillators?
Should i need to rewrite it with a pattern?
Thanks a lot

Gianmaria
Reply | Threaded
Open this post in threaded view
|

Re: Timing issue between oscillators

Nathan Ho
On 2017-05-07 14:46, [hidden email] wrote:
> Hi there, I'm experiencing a temporal problem between oscillators, i
> want to
> use an LFNoise0 as a gate envelope on a sine but the oscillators are no
> synchronized for long time so the gate start to generate clicks on the
> sine
> and getting stronger and stronger.

hi gianmaria,

easiest way would be to start with the SinOsc, use PulseDivider to get a
trigger for every fifth upward zero crossing, and use TIRand to randomly
generate 0/1:

(
{
     var osc, env;
     osc = SinOsc.ar(44);
     env = TIRand.ar(0, 1, PulseDivider.ar(osc, 5));
     osc * env
}.plot(1.0)
)



nathan

_______________________________________________
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: Timing issue between oscillators

Ch4n
Hi Nathan, this open to me a world, thanks for your amazing share!
GianMaria
Reply | Threaded
Open this post in threaded view
|

Re: Timing issue between oscillators

Ch4n
Hi there! may i ask how to calculate this "chain of methods" every time a trig (from non positive to positive signal) happens ? I need it for the same reasons, i built this sequencer and i want that it be synchronized to the controlled oscillator.
I think it can be done with Demand and Buffer but i ask my self if there is a structure for this purpose
Thanks
Gianmaria

( var seed=#[1,0,0,0,1,0,0,0], xor, rep, rot, trig;
t = Task({
    inf.do({ arg i;

                rot = seed.rotate(-1);      

                xor = bitXor(rot[0],rot[1]);  
               
                rep = rot.put(7,xor);

                seed = rep;

                trig= seed[0];

                trig.postln;

                Synth(\xy, [amp: trig]);
               
                (1/8.82).wait;
    });
});
)


Reply | Threaded
Open this post in threaded view
|

Re: Timing issue between oscillators

Nathan Ho
On 2017-05-18 22:43, [hidden email] wrote:

> Hi there! may i ask how to calculate this "chain of methods" every time
> a
> trig (from non positive to positive signal) happens ? I need it for the
> same
> reasons, i built this sequencer and i want that it be synchronized to
> the
> controlled oscillator.
> I think it can be done with Demand and Buffer but i ask my self if
> there is
> a structure for this purpose

hi gianmaria,

i'm too lazy to figure out exactly why this produces different output
from your code, but it should give you some ideas:

(
{
     var clock, buffer, phase;
     var newBit;
     clock = Impulse.ar(100);
     buffer = LocalBuf.newFrom([0, 0, 0, 1, 0, 0, 0, 1]);
     phase = Stepper.ar(clock, min: 0, max: 7);
     newBit = Dbufrd(buffer, (phase - 7) % 8) bitXor: Dbufrd(buffer,
(phase - 6) % 8);
     Demand.ar(clock, 0, Dbufwr(newBit, buffer, phase));
}.plot(0.2);
)

there are definitely other ways to do this. it's probably better to use
a size-1 LocalBuf containing the state as an integer, then do bitwise
ops to transform it. something along the lines of "buffer =
LocalBuf.newFrom([259]); state = Dbufrd(buffer); ... Dbufwr(newState,
buffer)".


nathan

_______________________________________________
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: Timing issue between oscillators

Ch4n
Hi Nathan, It's from 8 am thinking about your code, but i can't understand a line, could you comment this line:
newBit = Dbufrd(buffer, (phase - 7) % 8) bitXor: Dbufrd(buffer,
(phase - 6) % 8);
I can't understand, why bitXor is not declared? i don't understand what is and why there is not (,) between two Dbufrd.
Thanks a lot!
Gianmaria
Reply | Threaded
Open this post in threaded view
|

Re: Timing issue between oscillators

Nathan Ho
chanof wrote
Hi Nathan, It's from 8 am thinking about your code, but i can't understand a line, could you comment this line:
newBit = Dbufrd(buffer, (phase - 7) % 8) bitXor: Dbufrd(buffer,
(phase - 6) % 8);
I can't understand, why bitXor is not declared? i don't understand what is and why there is not (,) between two Dbufrd.
hi gianmaria,

this is the "key binary operator," covered in the Syntax Shortcuts helpfile. "foo.bar(baz)" can be written as an infix operator "foo bar: baz". arguably, it can help improve readability if the method feels like it should be written as an infix operator, e.g. "foo and: { bar }". not sure if it's really the best choice here.


nathan