Creating Modulation EnvelopeAs 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. 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. Envelope
Using envelopes to create an FM Wavetable Envelope
Function 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 FUNCexample.m
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 FuncEnv.m
FM
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. LFOSin.m
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.
|