Creating Modulation Envelope
As in the previous creation of the FM-Wavetable the modulation changes were linear changes, in this chapter I will present a normal FM synth style envelope.
An envelope can be created by joining several linspace functions together. In the example, four lines are connected. The only caveat is that the adjacent lines must have the same number of values.
Using envelopes to create an FM Wavetable
It's a pain to write 5 lines of code to create an Envelope every time. So we will define the Code as a function.
You can use the function-end syntax to define your own functions.
More about Function
Save this file, defined as exmple, as FUNCexmple.m and you are done. Put this file in the same folder as the file to be executed.
Example of function
Script using Function
This is how to create an FM Wavetable using the Envelope.
You can also create LFOs using the sin function that you have been using as a sound source.
By changing the amplitude range of the sin function from 0 to 1, it can be used as an LFO. Of course, you can also modulate this waveform and use it as an LFO.