Both sides previous revisionPrevious revisionNext revision | Previous revision |
vividshaper_reference_manual [2025/01/06 19:23] – lars | vividshaper_reference_manual [2025/09/13 15:47] (current) – [API] lars |
---|
* 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 |
| |
vol[1] = VSADSRE(1,1,0.8,3,0,gatetimeon,gatetimeoff) | vol[1] = VSADSRE(1,1,0.8,3,0,gatetimeon,gatetimeoff) |
active = vol[1] > 0.00001 | active = vol[1] > 0.00001 |
| pitchbend = pitchbend*2 |
</code> | </code> |
| |
This example encapsulates the fundamental process of generating a wave and setting its volume envelope in VividShaper. The line **wave[1] = VSTriangle(1,0)** creates a triangle wave at the base frequency of 1 Hz and phase of 0 degrees (between 0-360 degrees). You need to provide both arguments even if you are not phase shifting the wave. The frequency here refers to the number of complete cycles of the Triangle wave form that fits within the sample (consisting of 128 sample points). A frequency of 1 Hz means one complete cycle of the triangle fits within the 128 samples. | This example shows the process of generating a wave and setting its volume envelope in VividShaper. The line **wave[1] = VSTriangle(1,0)** creates a triangle wave at the base frequency of 1 Hz and phase of 0 degrees (between 0-360 degrees). You need to provide both arguments even if you are not phase shifting the wave. The frequency here refers to the number of complete cycles of the Triangle wave form that fits within the sample (consisting of 128 sample points). A frequency of 1 Hz means one complete cycle of the triangle fits within the 128 samples. |
| |
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, if we wish to set it to a constant value, making it play back the same note even if play another note, we could do that as well: **note[1] = 40**. | 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, if we wish to set it to a constant value, making it play back the same note even if play another note, we could do that as well: **note[1] = 40**. |
| |
| 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, release=3 sec, startlevel=0. The name of the wave table will be "A simple example". | The volume will then be set to an exponential volume ADSR envelope, with attack=1 sec, decay=1 sec, sustain=0.8, release=3 sec, startlevel=0. The name of the wave table will be "A simple example". |
-- Input information | -- Input information |
notein -- The current input note for the active generator. | notein -- The current input note for the active generator. |
| pitchbend -- The pitch bend data, from -2 to 2. |
tempo -- Current tempo (beats per second, e.g. 120). | tempo -- Current tempo (beats per second, e.g. 120). |
timesignnum -- Time signature numerator, e.g. 3 for three beats per bar (3/4). (Next version) | timesignnum -- Time signature numerator, e.g. 3 for three beats per bar (3/4). (Next version) |
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 -- Time in seconds for how long the key was pressed. | gatetimeon -- Time in seconds for how long the key was pressed. |
| gon -- Same as gatetimeon (coming in v1.4) (short version name) |
gatetimeoff -- Time in seconds since the key was released. | gatetimeoff -- Time in seconds since the key was released. |
| goff -- Same as gatetimeoff (coming in v1.4) (short version name) |
timeon -- The number of seconds since the generator was turned on. Resets after parse. | timeon -- The number of seconds since the generator was turned on. Resets after parse. |
gtimeon -- Global time. The number of seconds since the first generator was turned on. Resets after parse. | gtimeon -- Global time. The number of seconds since the first generator was turned on. Resets after parse. |
| |
-- Output information | -- Output information |
| pitchbend -- The pitchbend is sent back as output information. Set it to zero if you don't want it to pitch bend the notes. |
wave[x] -- Wave array x (one array for each oscillator x, 128 elements). | wave[x] -- Wave array x (one array for each oscillator x, 128 elements). |
panning[x] -- Panning for oscillator x (between 0 - 1; 0 = left, 0.5 = middle, 1= right). | panning[x] -- Panning for oscillator x (between 0 - 1; 0 = left, 0.5 = middle, 1= right). |
active -- A value true/false. A false value turns off the generator until it is turned on again. | active -- A value true/false. A false value turns off the generator until it is turned on again. |
midigenerator -- A value true/false. A true value means only one generator will be running and it cannot turn off. | midigenerator -- A value true/false. A true value means only one generator will be running and it cannot turn off. |
| legato -- A value true/false. Turns on legato effect (currently only for monophonic, 1 generator) |
| portamento[x] -- Portamento for oscillator x (between 0 - 5, seconds per seminote where 0 = off) |
| portamentotype -- 0 for linear, 1 for exponential |
| |
-- Coming soon in a future version (v1.4 probably) | -- Coming soon in a future version (v1.5 probably) |
sample[x] -- Set oscillator x to a specific sample, e.g. sample[1] = "alien" | sample[x] -- Set oscillator x to a specific sample, e.g. sample[1] = "alien" |
loopstart[x] -- Set loop start point as value between 0 - 1 | loopstart[x] -- Set loop start point as value between 0 - 1 |
svol[x] -- Volume output for sample playback | svol[x] -- Volume output for sample playback |
| |
-- Delay output information (upcoming feature in v1.3) | -- Delay output information |
delay1[x] -- Delay1 parameters: | delay1[x] -- Delay1 parameters: |
-- delay1[1] = own feedback (value from 0 - 1) | -- delay1[1] = own feedback (value from 0 - 1) |
d1vol[x] -- How much of the output from oscillator x that should be routed to delay1 bus | d1vol[x] -- How much of the output from oscillator x that should be routed to delay1 bus |
d2vol[x] -- How much of the output from oscillator x that should be routed to delay2 bus | d2vol[x] -- How much of the output from oscillator x that should be routed to delay2 bus |
ovol[x] -- How much of oscillator x that should be sent to main output (1 = default) | |
mvol -- Amplify main output only (1 = default) | -- Reverb output information |
| reverb1[x] -- Reverb1 parameters: |
| -- reverb1[1] = wet (value from 0 - 1, where 0 = dry) |
| -- reverb1[2] = space (value from 0 - 1) |
| -- reverb1[3] = damp (value from 0 - 1, where lower values = less damp) |
| -- reverb1[4] = reverb level (volume of reverb tail) |
| -- reverb1[5] = mixMode (0 or 1), 0 = insert, 1 = send) |
| -- reverb1[6] = tailLatch (0 or 1), 0 = no, 1 = yes |
| -- reverb1[7] = keep (0 - 1), how much of original stereo signal to keep |
| -- reverb1[8] = cross (0 - 1), how much stereo signals should cross |
| reverb2[x] -- Reverb2 parameters |
| rrvol -- Amplification of reberb2 output |
| |
| -- Other routes of sound |
| mvol[x] -- How much of oscillator x that should be sent to main output (1 = default) |
| mrvol -- Amplification on main route |
| avol[x] -- How much of oscillator x that should be sent to alternative output |
| apanning[x] -- Panning per oscillator on the alternative route |
| arvol -- Amplification on alternative route |
| |
| |
-- Views settings | -- Views settings |
wave[x] = VSRect(wave[x]) -- Input is a wave array | wave[x] = VSRect(wave[x]) -- Input is a wave array |
| |
-- Helper functions for delays (next version) | -- Helper functions for delays |
VSPingPong(feedback,time) -- This function sets the delay variables needed for ping pong delay. | VSPingPong(feedback,time) -- This function sets the delay variables needed for ping pong delay. |
VSStereoDelay(feedback,time) -- This function sets the delay variables needed for a stereo delay. | VSStereoDelay(feedback,time) -- This function sets the delay variables needed for a stereo delay. |
-- 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,decay,sustain,release,initlevel,timeOn,timeOff) -- initlevel is initial volume | vol[x] = VSADSR(attack,decay,sustain,release,level,timeOn,timeOff) -- level is initial volume |
vol[x] = VSADSRE(attack,decay,sustain,release,initlevel,timeOn,timeOff) -- Exponential release | vol[x] = VSADSR(attack,decay,sustain,release,timeOn,timeOff) -- Shorter version without init level |
| vol[x] = VSADSRE(attack,decay,sustain,release,level,timeOn,timeOff) -- Exponential release |
| vol[x] = VSADSR(attack,decay,sustain,release,timeOn,timeOff) -- Shorter version without init level |
| |
| |