Forums > MaxMSP

Delaying Sine Waves by Milliseconds

December 5, 2013 | 8:28 am

Hello There!

It’s me again with my rookie questions. I would like to know how can I alter the phase of a Sine wave by measure of milliseconds rather than by angle. I tried doing this simple with a [delay~] object but it tells me the delay time is dependent on a sample rate, which I’m not sure what would it be for a [cycle~]…

I’m sorry if this is some dumb question, I’m still trying to figure out this whole phase and delay thing.

Thanks again in advance


December 5, 2013 | 9:52 am

[delay~] only does times of full samples, [tapout~] will allow you to use floating point values, for example in milliseconds.

but i believe you are looking for something else: search the forums for how to drive a [cycle~] by [phasor~].

-110


December 10, 2013 | 6:53 am

Hello Roman,

Thanks for your help,

Tapin~/tapout~ don’t seem to be working, whenever I switch the delay value the audio stops or clicks weirdly, I’m pretty sure there must be a simple way to just delay/change the phase of a signal by a matter of milliseconds, please someone help! I’m stuck :(

Thanks again!


December 10, 2013 | 7:40 am

A couple of suggestions for when you’re stuck:
1) Typing "samples milliseconds" into the Max Help search field yields six objects, one or two of which are relevant to your quest.
2) Looking up "millisecond" in the Object Thesaurus also will help.

mstosamps~ is one easy way to convert milliseconds to samples. To avoid clicks when you change the delay time, use linear interpolation to smooth the changes. See MSP Tutorial 2 for an example and explanation of that technique. I suggest to use delay~ rather than tapin~/tapout~ because the latter objects have a minimum delay time of one signal vector.

<code>

– Pasted Max Patch, click to expand. –

</code>


December 11, 2013 | 8:19 am

Christopher,

Thank you so much for your help, your advice is also very helpful, I will definitely try the max help search method… how dumb am I.

Anyway, thanks to you I think I solved this issue.

Best!


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