Signal Rate oscillator vs. "snapshot convertet rate"

Leon Aviles's icon

Hey guys,

I'm trying to figure out how I can achieve 2 oscillators which are exactly the same with 2 different methods:

My approach could be a bit strange, but I'm feeding a cycle into a change~ then scale it 0-1 and output it directly to the dac. I wanted to "simulate" the logic of analog circuit square waves, which also only work with "Hi and low". So I want an oscillator that works with 0 and 1 basically. (Of course I can't simulate the analog circuit 100% but the idea is clear I think)

For my project however I also need a non signal rate oscillator (for controlling a sequencer), which has to be exactly the same as the signal rate one. (I like the idea of having "the same" oscillator for the sequencing and the sound:))

I tested it with a conversion via snapshot with the vector size at 1. To hear it I of course have to convert it back to the signal world (sig~), which at low frequencies of the oscillator works, but at higher frequencies distorts.

My question:

Why does that happen?

Could it be because the sig~ object isn't fast enough to match the speed of the signal rate oscillator?

Is there another approach to my idea?

TFL's icon

I tested it with a conversion via snapshot with the vector size at 1

Not sure if you mean you changed the Signal Vector Size to 1 in the Audio preferences of Max, or/and if you tried using a [snapshot~ 1], but in either case, what you hear is expected, given that the fastest snapshot can do is to output a value every 1ms, which is about 44 times slower than "audio rate" (at 44.1KHz).

For my project however I also need a non signal rate oscillator (for controlling a sequencer), which has to be exactly the same as the signal rate one.

This is in essence impossible, given that data rate is slower than signal rate, the former will necessarily be an approximation of the latter.

But you can build a signal-rate sequencer if you want. Although builtin objects are enough, you can also use some packages. Rhytm and Time Toolkit from Philip Meyer is perfect for that.

Leon Aviles's icon

Thanks for the reply!

Yeah I figured that signal rate wouldn't be "fast enough":(

Roman Thilenius's icon

what you can do is to use a [counter] or [line] as data rate "phase accumulator" which is "in rythm" i.e. of a value resolution which allows you to hit the center in the right moment.

for integer that means to use an odd number of steps:

that 10 ms metro resolution could relate to 120 BPM, and at another BPM you would change its rate likewise.

the value resolution will now, regardless the the song tempo, always be the same - for this "square wave", but also for cosines or whatever you do with the phase.

accumulator -> function in its simplest form.

Source Audio's icon

to create gate signal you use cycle~ + change~ + scale~ and who knows what else ?

I don't know why this complication, and you don't tell enough

to judge if one should pick signal or data based sequencer.

but if it is step sequencer - counter or whatever else based

you can allways % or something else to flip 0 1 to sig~ and out.

Any latency between that 2 outputs is anyway present

depending if you maybe run this in lame Live or not, if it has to sync to

something else and so on.

In max itself, all that is controllable.

here simplest form