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

Thread: Settings waveform modulated phase.

  1. #1

    Settings waveform modulated phase.

    I am trying to implement oscillator sync into my synth. The waveform class supports the phase(angle) function which would have been pretty essential but the waveformMod class doesn't seem to. Is there a way i could go about adding the phase(angle) function to the waveformMod class? It would also be really useful if there was a way of reading the current phase of a waveform, if that was possible could something like this work if it was in the program code?
    if waveformA.readPhase() = 0, waveformB.phase(0)

  2. #2
    Senior Member
    Join Date
    Jul 2020
    The phase is modulated every sample from an AudioStream if you setup phaseModulation() - presumably that would
    fight with calls to phase() so it is dropped in the AudioSynthWaveformModulated class. Can you provide the phase
    as an AudioStream?

  3. #3
    I dont think so, because phaseModulation is relative to the current phase I can't see a way of it being useful for setting an absolute phase value without knowing the current phase. Also, I am using the FM input for portamento, pitch bend and LFO modulation of the pitch.

  4. #4
    Senior Member
    Join Date
    Jul 2020
    I guess you'd need to add a method that exposes the current phase (plus latest modulation value), to read it, and
    another method to write it, compensating for the latest modulation value.

    I'd see if its as simple as subclassing the AudioSynthWaveformModulated class and adding those methods?

  5. #5
    I'm quite new to c++, so I dont fully understand a lot of the code in waveformMod. I can't see a simple variable for the unmodulated phase, the only thing i was really able to identify was phasedata, which appears to store the current phase (including modulation). I don't really know how to go about compensating for the modulation value when reading or writing to it though. Thanks for all the help, but I think i might be a bit out of my depth here

Posting Permissions

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