Nibble has eight configurable FM-Synthesized audio channels.
An example configuration for the first channel would be:
-- We are configuring the first channel channel(CH1) -- Operator frequency = note played freqs(1.0, 1.0, 1.0, 1.0) -- First operator, a simple sine wave sounding for one second envelope(OP1, 0, 1, 0, 1.0, 0.9, 0.0, 0) -- Route the operator to the output at full volume route(OP1, OUT, 1.0)
And notes could be played with:
-- MIDI note number, MIDI volume noteon(48, 255)
To stop a sustained note:
-- MIDI note number noteoff(48)
Specify which channel should the next commands be executed on.
Nibble has eight channels:
(fop1, fop2, fop3, fop4)
Sets the relative frequencies of each operator in the current channel.
The note frequency will be multiplied by the value specified for each operator.
-- Exact note frequency in all operators freqs(1.0, 1.0, 1.0, 1.0) -- Custom frequencies freqs(0.5, 0.83, 1.3, 17.2)
(op, use_sustain, volume, a, d, s, r, wave)
Sets the envelope for an operator in the current channel.
op can be one of:
use_sustain is either 0 or 1, if 0 the note won't be sustained, if 1 it will.
WARNING: sustained notes required a
noteoff() call to stop sounding.
volume is a number between 0 and 1, 1 being the maximum volume.
r are the envelope values,
r are in seconds,
is between 0 and 1.
wave is the kind of wave:
- 0: sine
- 1: square
- 2: triangle
- 3: saw
(op_from, op_to, volume)
This can be used to route operators to the input of other operators (or themselves) and to route them to the speakers.
op_to, with a volume of
In the case of operator-to-operator routing, the volume is the amount of influence the
op_fromwill have in
route(OP1, OP2, 0.5) route(OP2, OUT, 1.0)
route(OP1, OP1, 0.5) route(OP1, OP2, 0.5) route(OP2, OP1, 8.5) route(OP1, OUT, 0.3) route(OP2, OUT, 0.8)
Plays the MIDI
note with an
Intensity is between 0-255.
Triggers the release envelope of a sustained note.
note is a MIDI note number.
WARNING: if you want give the delay in seconds, multiply it by 44100. The maximum supported delay is around 33ms
Enables the delay filter in the current channel.
delay is the amount of samples to delay.
feedback is between 0-1 for 0% to 100% feedback.