User Tools

Site Tools


vividshaper_reference_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vividshaper_reference_manual [2023/11/12 20:02] – [A simple example] larsvividshaper_reference_manual [2024/03/30 10:02] (current) lars
Line 52: Line 52:
 gatetimeon     -- Time in seconds for how long the key was pressed. gatetimeon     -- Time in seconds for how long the key was pressed.
 gatetimeoff    -- Time in seconds since the key was released. gatetimeoff    -- Time in seconds since the key was released.
 +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.
 tick           -- The number of times the Lua code has been called since initiation (when tick=0). tick           -- The number of times the Lua code has been called since initiation (when tick=0).
 cc[x]          -- Value of CC message x (between 0 to 127). cc[x]          -- Value of CC message x (between 0 to 127).
Line 61: Line 63:
  
 -- Output information -- Output information
-wave[x]        -- Wave array x (one array for each oscillator x).+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).
 note[x]        -- Note output for oscillator x (default value is the same as note). note[x]        -- Note output for oscillator x (default value is the same as note).
 vol[x]         -- Volume for oscillator x. Default is 0. vol[x]         -- Volume for oscillator x. Default is 0.
 +ring[x]=y      -- Oscillator x should be ring moduled by oscillator y (coming in next version)
 +sync[x]=y      -- Oscillator x should be synced by oscillator y       (coming in next version)
 gvol           -- Global volume, default = 1. Multiplied on the output to amplify or limit the audio. gvol           -- Global volume, default = 1. Multiplied on the output to amplify or limit the audio.
 updatefreq     -- Update frequency: 128, 256, 512, 1024, 2048, or 4096. Tells how many frames to wait before running Lua. updatefreq     -- Update frequency: 128, 256, 512, 1024, 2048, or 4096. Tells how many frames to wait before running Lua.
Line 95: Line 99:
 wave[x] = VSWaveFold(wave[x],amplify)         -- Wave will be folded outside the range [-1, 1]. wave[x] = VSWaveFold(wave[x],amplify)         -- Wave will be folded outside the range [-1, 1].
 wave[x] = VSNorm(wave[x],threshold,normvalue) -- Normalise the waveform to normval if max amplitude is above threshold wave[x] = VSNorm(wave[x],threshold,normvalue) -- Normalise the waveform to normval if max amplitude is above threshold
 +wave[x] = VSAbs(wave[x])                      -- Return absolute values of the input wave.
  
 -- Wave math operators - arguments can be either arrays or scalar factors -- Wave math operators - arguments can be either arrays or scalar factors
Line 102: Line 107:
 wave[x] = VSAdd(wave1,wave2) -- Add element wise wave1 with wave2 wave[x] = VSAdd(wave1,wave2) -- Add element wise wave1 with wave2
 wave[x] = VSSub(wave1,wave2) -- Subtract element wise wave1 with wave2 wave[x] = VSSub(wave1,wave2) -- Subtract element wise wave1 with wave2
 +
 +-- LFOs (Low Frequency Operators): Coming in the next version (v1.2)
 +-- These LFO functions take time as input. They are similar to the wave generators in how they
 +-- operate, but they only return a scalar value.
 +lfo = VSLFOSin(frequency,phase,time)          -- phase is in degrees
 +lfo = VSLFOTriangle(frequency,phase,time) 
 +lfo = VSLFOSaw(frequency,phase,time)
 +lfo = VSLFOSquare(frequency,phase,width,time) -- width is between 0 to 1
 +
 +-- Helper function to remove negative values
 +output = VSRect(input)  -- Input is a scalar value
 +wave[x] = VSRect(wave[x]) -- Input is a wave array
  
 -- Envelopes -- Envelopes
Line 108: Line 125:
 vol[x] = VSADSR(attack,decay,sustain,release,initlevel,timeOn,timeOff) -- initlevel is initial volume vol[x] = VSADSR(attack,decay,sustain,release,initlevel,timeOn,timeOff) -- initlevel is initial volume
 vol[x] = VSADSRE(attack,decay,sustain,release,initlevel,timeOn,timeOff) -- Exponential release vol[x] = VSADSRE(attack,decay,sustain,release,initlevel,timeOn,timeOff) -- Exponential release
 +
  
 -- Filters (x = oscillator) -- Filters (x = oscillator)
Line 119: Line 137:
 biquadcoeff = VSBandpass(cutoffFreq,resonance,notein) -- Helper function to set the quadfilter values biquadcoeff = VSBandpass(cutoffFreq,resonance,notein) -- Helper function to set the quadfilter values
 biquadcoeff = VSHighpass(cutoffFreq,resonance,notein) -- Helper function to set the quadfilter values biquadcoeff = VSHighpass(cutoffFreq,resonance,notein) -- Helper function to set the quadfilter values
-wave[x] = VSBiquad(wave[x],biquadcoeff)                  -- Apply filter on wave using quadfilter settings+wave[x] = VSBiquad(wave[x],biquadcoeff)               -- Apply filter on wave using quadfilter settings
  
--- MIDI output+-- MIDI output (coming soon - not available in this version!)
 -- 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
vividshaper_reference_manual.1699815771.txt.gz · Last modified: 2023/11/12 20:02 by lars