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 [2025/01/09 21:27] larsvividshaper_reference_manual [2025/01/09 21:31] (current) lars
Line 29: Line 29:
 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 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). 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 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".
Line 92: Line 93:
 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)
Line 152: Line 153:
 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.
vividshaper_reference_manual.1736454452.txt.gz · Last modified: 2025/01/09 21:27 by lars