Forums > MaxMSP

Sync trigger for cycle~ object

November 14, 2011 | 8:16 pm

Hello. I am trying to make a multi-wave oscillator.

Most of the standard features I have figured out (tuning, PW, etc.)

The one feature I haven’t quite figured is Sync control of a sine wave. (i.e. the wave of one sine wave controls the reset of another.)

I know the [tri~], [saw~], and [rect~] all have the sync input (sync trigger) and they seem to be working fine. my only issue is getting the sine wave [cycle~] to sync.

http://cycling74.com/forums/topic.php?id=16454
^^ The above thread is the closest I’ve seen it come, but the issue is that it resets to a value of 1, so when you have another oscillator driving your main, there’s clicks and pops all over.

I’d paste what i have so far, but A)I don’t know how to do it for the forums B) what I have isn’t much, and it’s not needed to solve the issue.. I don’t think.

Thanks all!


November 14, 2011 | 8:32 pm

if you want to do band-limited hard sync with sinusoids, you need to look into making an external with minBLEP. You can pull the source code from the GPL TAL-noisemaker synth.

Alternatively, you can do Casio CZ style "windowed" hard sync like this…

– Pasted Max Patch, click to expand. –

November 14, 2011 | 8:45 pm

I think your reset to a value of 1 is to do with the cycle object outputs a cosine wave rather than a sine, so you’d have to have a phase offset of 0.75 for the cycle object relative to the other wave shapes. As for waveform discontinuities you’d need to work out a change in phase over time (say 50ms or so maybe) using line~


November 14, 2011 | 8:55 pm

Thanks for the response Oli.

The patch you posted is not quite what i"m looking for. I’m not even sure if i fully understand everything going on in that patch. Here’s a look at what I’m trying to accomplish.

The two pairs on the right are syncing fine, but two cycle waves I can’t get to sync.

Also, I looked into minBLEP, and it seemed a little confusing.

– Pasted Max Patch, click to expand. –

November 14, 2011 | 8:57 pm

Hey Terry. Thanks for the response.

I wouldn’t say I’m a MaxMSP noob, but I will say I know very little about all the math functions throughout the software. Would you mind pasting an example?

thanks!


November 14, 2011 | 10:50 pm

This is adapted from the example posted in the thread you referred to before:

– Pasted Max Patch, click to expand. –

The patch you posted just before is not an example of synching using phase, but actually an example of phase distortion.


November 14, 2011 | 11:32 pm

Here you go, hope it makes sense:

– Pasted Max Patch, click to expand. –

November 14, 2011 | 11:58 pm

here is a non-bandlimited hard synced sine… perhaps more what the OP was after

– Pasted Max Patch, click to expand. –

>The patch you posted just before is not an example of synching using phase, but actually an example of phase distortion.

not really. true it is used on a synth famous for being a PD synth (the "resonant" waveforms), but this is actually hard sync…. windowed to smooth out the discontinuities and hence the aliasing. The other waveforms on the CZ synths are actually more "phase distortion", since there the phase accumulator is being warped.

Here is a similar version of the first patch i posted without the windowing

– Pasted Max Patch, click to expand. –

November 15, 2011 | 3:42 am

you guys rock. however, I don’t think we’ve quite achieved what I’m looking for. i’m trying to emulate an analog synth (in the most basic way) by connecting the output of one oscillator to the ‘sync’ input of another oscillator to have them in sync. (note: Not trying to emulate the "unstable" sound of analog circuitry, but rather the overall experience.)

So. having said that, Oli, I think you are on a different page than the rest of us. I’m not sure how to translate your patches into what I’m trying to do. see the patch below, which is what I’m trying to do.

(note: the gate represents connecting/disconnecting the output of one oscillator to another)

– Pasted Max Patch, click to expand. –

Sorry I’m being so confusing.

Terry, i think we’re getting closer, but I’m not so much interested in getting oscillators in phase. It’s more important to figure out how to get that value of .75 (in your adapted version of the patch from the previous thread) to be triggered each time an external oscillator makes its cycle.

I hope that makes sense.

Thanks again for your help!
- Argee.


November 15, 2011 | 8:57 am

I think Oli’s non-bandlimited patch did what you want.

– Pasted Max Patch, click to expand. –

November 15, 2011 | 11:40 am

Would I be right in thinking Oli’s windowed patch is almost Vosim?
I’ve been trying to create a little Vosim patch recently, and would welcome any input. I suspect there’s more to it, but it’s interesting in itself anyway.
I must admit, I’d missed the +~ .75 trick, but it doesn’t seem to make any audible difference,
cheers
Roger

– Pasted Max Patch, click to expand. –

November 15, 2011 | 8:52 pm

Chris! What you have posted seems to work, audibly, but I’m not sure if it is *exactly* what I want….My only concern for it is that, according to the scope, it appears to be all positive values, which I’m okay with, as long as there’s no damage done to headphones/speakers/etc. I wonder how this would compare with an analog system. But, it produces the desired result, so I believe I’ll be alright with it for now!

My only concern for it is that, according to the scope, it appears to be all positive values, which I’m okay with, as long as there’s no damage done to headphones/speakers/etc. I wonder how this would compare with an analog system.

Since I am using this for a school project, I don’t want to turn this in and say "viola! a sync’d sinewave oscillator!!!" I’d like to be able to explain how it’s working. Chris (or oli), would you mind explaining what is going on inside that patcher?

Thanks again guys!


November 16, 2011 | 12:11 am

"Since I am using this for a school project, I don’t want to turn this in and say "viola! a sync’d sinewave oscillator!!!" I’d like to be able to explain how it’s working. Chris (or oli), would you mind explaining what is going on inside that patcher?"

I suggest you figure that out for yourself; otherwise you haven’t necessarily learned anything. There’s plenty of resources (help files, tutes etc) to look at.


November 16, 2011 | 1:51 am

THe reason it’s all positive is because that’s what you’re asking it to do. You are syncing the sine at twice its rate. This means that it goes through the first half of its cycle, then gets synced, and starts to do it again.


November 16, 2011 | 2:36 pm

Ahh.. Well that makes sense. I suppose at different frequencies, it’d look differently. Thanks everyone!

check out my oscillator here:

http://cycling74.com/forums/topic.php?id=36325&replies=4#post-176460

I also have posted an LFO. I’m sorta modeling these after the euromax objects (sorry I don’t have a link to those). I may or may not continue these series as my graduate thesis work, but it’s a good start. I may continue for fun.


November 16, 2011 | 2:43 pm

if you want to play a "waveform" (== a cycle~ buffer) once, and then another one after the first one
has finished, i think you could just use index~ play~ and buffer~ instead.

you, the programmer, know how long a sinewave or a tri wave will last when played at note number
60 (or when played at rate*2 or at 5 Khz) and so you could use index~to play one after another.


November 16, 2011 | 2:57 pm

@roger, concerning vosim, this could be a model to work with.

– Pasted Max Patch, click to expand. –

November 17, 2011 | 9:33 am

Thanks, that makes much more sense!
Cheers
Roger



pid
November 17, 2011 | 2:32 pm

@jvkr
beautiful, fantastic, generous and supremely pedagogical example.
thanks.


November 17, 2011 | 5:01 pm

here’s a gen~ version, I think.

– Pasted Max Patch, click to expand. –

November 18, 2011 | 8:50 am

nice… but a bit glitchy. maybe the parameter changes need to be done at the beginning of each pulse?


November 18, 2011 | 3:03 pm

The more charitable man might have concluded or wondered whether or not it was done *on purpose* because I liked the way it sounds, and also because it’s always interesting and useful to leave things in a state where other people can feel as though they can "contribute" by making a few judicious changes (otherwise you’re just doing people’s homework for them). Feel free to make those mods and it’ll be um… "perfect."


November 18, 2011 | 3:23 pm

sorry if I offended your ego somehow. When i have time to investigate more and learn gen~ i may well try and add said mods to the nice patch you posted.

Regarding doing peoples homework for them… the OP didn’t say it was a homework question initially. If he had I and others would likely have been more careful about just providing the solution. But anyhow phase reseting a sine wave in Max at sample-rate is a fiddly business – easiest shown with the solution imho.



pid
November 18, 2011 | 7:02 pm

ooh, those are fun the last few comments…

anyhow, i had some fun with this this afternoon. in gregory’s spirit of "it might not be very good though", here it is…

@oli, "phase reseting a sine wave in Max at sample-rate" – actually remarkably easy with [gen~]. although i might have misunderstood…

i decided to sync to the phasor, although this means parameter jumps from slow/low (long phasor freq times) to high are a bit lame. it is non-glitchy, although in the spirit of those who like it glitchy, i provided a "mode" toggle so you can choose between them.

[codebox]‘s in the [gen~] are just for patch cleanliness (as we still have no encapsulation in [gen~]), nothing more.

and one more thing i changed: personally, i do not think using [param] is much cop for signal rate controls.

please mod away…

thanks all!

– Pasted Max Patch, click to expand. –

November 18, 2011 | 7:47 pm

IMO, ArgeeBrobot seemed to be making a real effort to do something, unlike some of the other "my assignment is…" sort of posters.


November 19, 2011 | 2:22 am

That looks nice, pid. Sounds pretty good, too. Thanks for getting the obvious tell about using messages not being the best fit.

When the next version of Max is released, you’ll find my considerably more traditional values approach – I wanted to keep it really simple [gen~ for the other N% and all. :-) ]. But I’m sure you’ll notice the similarities.

The *other* reason for doing the VOSIM patch is personal. Stan Tempelaars (VOSIM’s daddy) was one of my teachers, once upon a time. Nice guy, and a great teacher. May his name be for a blessing.


Viewing 26 posts - 1 through 26 (of 26 total)