This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vividshaper_reference_manual [2024/06/09 09:04] – [A simple example] lars | vividshaper_reference_manual [2025/09/13 15:47] (current) – [API] lars | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== VividShaper Reference Manual ====== | ====== VividShaper Reference Manual ====== | ||
- | VividShaper is a wavetable AUv3 plugin synthesizer, | + | VividShaper is a wavetable AUv3 plugin synthesizer, |
- | The Lua-code is called many times per second. Default is 93.75 times/ | + | The Lua-code is called many times per second. This allows the waves to be programmatically changed in realtime. Default is 93.75 times/ |
There are up to eight generators for polyphony (the number of generators can be set from 1 to 8). Each generator has in turn up to eight oscillators. Each oscillator has the following states that can be manipulated in Lua-code: | There are up to eight generators for polyphony (the number of generators can be set from 1 to 8). Each generator has in turn up to eight oscillators. Each oscillator has the following states that can be manipulated in Lua-code: | ||
Line 12: | Line 12: | ||
* left-right panning | * left-right panning | ||
* note (including cent note) | * note (including cent note) | ||
+ | * pitch bend information | ||
* A wave table array containing 128 samples | * A wave table array containing 128 samples | ||
Line 28: | Line 29: | ||
vol[1] = VSADSRE(1, | vol[1] = VSADSRE(1, | ||
active = vol[1] > 0.00001 | active = vol[1] > 0.00001 | ||
+ | pitchbend = pitchbend*2 | ||
</ | </ | ||
- | This example | + | This example |
This is not the playback frequency of the note (i.e. which note that is being played). The speed of the 128 samples is determined by note[1] for oscillator 1. We don't have to set note[1] explicitly, it is already set by the note you are playing on the keyboard. However, if we do wish to change it, for instance transposing one octave, we can do so by setting: **note[1] = notein+12**. Alternatively, | This is not the playback frequency of the note (i.e. which note that is being played). The speed of the 128 samples is determined by note[1] for oscillator 1. We don't have to set note[1] explicitly, it is already set by the note you are playing on the keyboard. However, if we do wish to change it, for instance transposing one octave, we can do so by setting: **note[1] = notein+12**. Alternatively, | ||
+ | |||
+ | The pitch bend value comes from your keyboard and will be added to the note value for each oscillator after the Lua code has finished. This value is stored in the variable pitchbend, which goes from -2 to +2 (i.e. 2 semi-notes). If note[1] == 40 for oscillator 1 and pitchbend == 0.53, the final note value used to play the note will be 43.53. If you want to turn off pitch bend, you can set pitchbend = 0 anywhere in your code. if you want to pitch bend from -4 to +4, you can just multiply it by 2 (pitchbend = pitchbend *2). This is done in the example above. You can also use the pitch bend value to modulate e.g. something else first, then set it to zero if you don't want it to also bend the notes. | ||
The volume will then be set to an exponential volume ADSR envelope, with attack=1 sec, decay=1 sec, sustain=0.8, | The volume will then be set to an exponential volume ADSR envelope, with attack=1 sec, decay=1 sec, sustain=0.8, | ||
Line 48: | Line 52: | ||
-- Input information | -- Input information | ||
notein | notein | ||
+ | pitchbend | ||
tempo -- Current tempo (beats per second, e.g. 120). | tempo -- Current tempo (beats per second, e.g. 120). | ||
timesignnum | timesignnum | ||
Line 56: | Line 61: | ||
gate -- Either 1 or 0 depending on if gate is on or off. | gate -- Either 1 or 0 depending on if gate is on or off. | ||
gatetimeon | gatetimeon | ||
+ | gon -- Same as gatetimeon (coming in v1.4) (short version name) | ||
gatetimeoff | gatetimeoff | ||
+ | goff -- Same as gatetimeoff (coming in v1.4) (short version name) | ||
timeon | timeon | ||
gtimeon | gtimeon | ||
Line 68: | Line 75: | ||
-- Output information | -- Output information | ||
+ | pitchbend | ||
wave[x] | wave[x] | ||
panning[x] | panning[x] | ||
Line 79: | Line 87: | ||
active | active | ||
midigenerator | midigenerator | ||
+ | legato | ||
+ | portamento[x] | ||
+ | portamentotype -- 0 for linear, 1 for exponential | ||
+ | |||
+ | -- Coming soon in a future version (v1.5 probably) | ||
+ | sample[x] | ||
+ | loopstart[x] | ||
+ | loopend[x] | ||
+ | sxfade[x] | ||
+ | svol[x] | ||
+ | |||
+ | -- Delay output information | ||
+ | delay1[x] | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | delay2[x] | ||
+ | d1vol[x] | ||
+ | d2vol[x] | ||
+ | |||
+ | -- Reverb output information | ||
+ | reverb1[x] | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | reverb2[x] | ||
+ | rrvol -- Amplification of reberb2 output | ||
+ | |||
+ | -- Other routes of sound | ||
+ | mvol[x] | ||
+ | mrvol -- Amplification on main route | ||
+ | avol[x] | ||
+ | apanning[x] | ||
+ | arvol -- Amplification on alternative route | ||
+ | |||
+ | |||
-- Views settings | -- Views settings | ||
Line 122: | Line 174: | ||
lfo = VSLFOSquare(frequency, | lfo = VSLFOSquare(frequency, | ||
- | -- Helper | + | -- Helper |
output = VSRect(input) | output = VSRect(input) | ||
wave[x] = VSRect(wave[x]) -- Input is a wave array | wave[x] = VSRect(wave[x]) -- Input is a wave array | ||
+ | |||
+ | -- Helper functions for delays | ||
+ | VSPingPong(feedback, | ||
+ | VSStereoDelay(feedback, | ||
+ | VSMonoDelay(feedback, | ||
+ | |||
+ | |||
-- Envelopes | -- Envelopes | ||
-- The level is the initial volume. Normally, it would start at zero, but could also be initiated to | -- The level is the initial volume. Normally, it would start at zero, but could also be initiated to | ||
- | -- start higher. | + | -- start higher. You can also call the function without level as argument (v1.4). It will then be zero. |
- | vol[x] = VSADSR(attack, | + | vol[x] = VSADSR(attack, |
- | vol[x] = VSADSRE(attack, | + | vol[x] = VSADSR(attack, |
+ | vol[x] = VSADSRE(attack, | ||
+ | vol[x] = VSADSR(attack, | ||
Line 145: | Line 206: | ||
wave[x] = VSBiquad(wave[x], | wave[x] = VSBiquad(wave[x], | ||
- | -- MIDI output | + | -- MIDI output |
-- VSTick is a help function to determine if the beat position crosses a certain time interval. | -- VSTick is a help function to determine if the beat position crosses a certain time interval. | ||
-- For instance, if length=1/4 (corresponding to a quarter note), VSTick will return true every time | -- For instance, if length=1/4 (corresponding to a quarter note), VSTick will return true every time |