User Tools

Site Tools


getting_started_vividshaper

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
getting_started_vividshaper [2025/01/06 19:56] larsgetting_started_vividshaper [2025/01/09 21:41] (current) – [Using more oscillators] lars
Line 173: Line 173:
  
 active = VSMax(vol) > 0.00001 active = VSMax(vol) > 0.00001
 +
 +pitchbend = pitchbend * 2
 </code> </code>
  
Line 179: Line 181:
 note[x] is an array corresponding to the notes being played for the eight oscillators (x is between 1-8). If we don't set note[x] explicitly, each oscillator will keep the default notein value. Hence, you don't have to set the note[] array if you don't want to change the note. note[x] is an array corresponding to the notes being played for the eight oscillators (x is between 1-8). If we don't set note[x] explicitly, each oscillator will keep the default notein value. Hence, you don't have to set the note[] array if you don't want to change the note.
  
-Given that notein=48, note[1] will be 47.99 and note[2] will be 48.01. Setting these two oscillators slightly detuned will create a beat effect, which you can read more about here:+The pitchbend variable is representing the current pitch bend data from your keyboard, and ranges by default between -2 to +2 (two semi-tones in each direction). This value is added to each note[x] value in the sound engine (after the Lua code has finished running). Say that note[1] == 48 and pitchbend == 0.3. The note that will be played by the oscillator will then be 48.3. In the code above, we manipulate the pitchbend variable so that it ranges from -4 to +4 instead. If you wish to turn it off (or use the pitchbend data to modulate something else), you can do so by setting pitchbend = 0 somewhere in the code. 
 + 
 +In the above code, we are adding and subtracting 0.01 for note[1] and note[2]. Given that notein == 48, note[1] will then be 47.99 and note[2] will be 48.01. Setting these two oscillators slightly detuned will create a beat effect, which you can read more about here:
  
 https://en.wikipedia.org/wiki/Beat_(acoustics) https://en.wikipedia.org/wiki/Beat_(acoustics)
getting_started_vividshaper.txt · Last modified: 2025/01/09 21:41 by lars