Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Waveform sync question

  1. #1

    Waveform sync question

    Hello, I'm creating a synth and am considering how to implement oscillator sync.
    Are the waveforms already in sync (start from zero amplitude) when the frequency is set for a new note?
    Would I set phase(angle) to zero for each waveform to set them in sync or have I misunderstood what sync is?

    Thanks for any replies.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,319
    Quote Originally Posted by UHF View Post
    Would I set phase(angle) to zero for each waveform to set them in sync or have I misunderstood what sync is?
    Yes, that's correct.

    Also make sure you use AudioNoInterrupts(), as documented here, and also mentioned in the waveform docs in the design tool.

    https://www.pjrc.com/teensy/td_libs_...ssorUsage.html

    This is needed to prevent the slim chance that the audio library might run during the brief time between multiple waveform.phase(angle) lines in your code. When you call AudioInterrupts() after changing all the settings, you can be sure all will take effect on the next update.

  3. #3
    Many thanks for everything Paul!

    I should mention for anyone wanting to implement sync, the above method produces a form of 'soft sync' (I think - read this for more explanation as I'm just learning about it myself: https://en.wikipedia.org/wiki/Oscillator_sync
    Last edited by UHF; 04-24-2019 at 01:06 PM. Reason: Added note about sync type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •