Delaying Sine Waves by Milliseconds

wannabeafrog's icon

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

Roman Thilenius's icon

[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

wannabeafrog's icon

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!

Christopher Dobrian's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

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.

wannabeafrog's icon

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!