Author Topic: Feature request: modulate operator waveform "width"  (Read 2475 times)

matrix12x

  • Team Member
  • ***
  • Posts: 188
    • View Profile
Feature request: modulate operator waveform "width"
« on: August 16, 2022, 03:15:10 AM »
I have a feature request.
It would be cool if we could modulate the "width" of the operator waveforms. Almost like modulating a pulse width of a square wave. So for example, per cycle, a sine wave would complete 360 degrees faster and the remainder of the period could be a DC signal of zero. At 50% the sine would complete within the time it used to take to do 180 degrees and the remaining 180 degrees would be an amplitude of zero (it could look like W5 for the TX81z). Having this as a modulation target would be cool. This is great for making some modern sounds.


Xavier

  • Administrator
  • Hero Member
  • *
  • Posts: 2257
    • View Profile
Re: Feature request: modulate operator waveform "width"
« Reply #1 on: August 23, 2022, 08:46:02 AM »

Not sure how it would sound.

If someone wants to give a try. The code to modify is here.
https://github.com/Ixox/preenfm3/blob/master/firmware/Src/synth/Osc.h?ts=4#L60
(And the function bellow that is an optimized version when to retrieve 32 values in one call (usefull for top level operator that are not modulated by others).

2 problems i can see:
. This part of the code is really optimized to avoid any useless memory access and any branch condition.
  This is the function the most called in by the audio thread.
. when the waveform goes from anything different from 0 to 0 that will make high frequency noise which does not suit FM modulation.

As any idea, it's of course worth trying :)

matrix12x

  • Team Member
  • ***
  • Posts: 188
    • View Profile
Re: Feature request: modulate operator waveform "width"
« Reply #2 on: August 24, 2022, 05:01:12 AM »
Thank you for pointing to the section of code. It is helpful. I'll see what I can do to try and knock together an attempt.

You have some good points regarding optimization.

Regarding sound, the most recent example I can think of is the Korg op six has this exact feature. I'll see if I can find a good sample of it.