Example Scripts
There are a bunch of scripts included with VstLua. Most of these are intended as examples, so that
you can see how to build your own, rather than complete, useful entities in their own right. Scripts
that are host-synced (and therefore need the host to be running to do anything) are marked HostSync .
scripts/
- arpeg.lua Simple arpeggiator. Press notes on your MIDI keyboard and they'll be arpeggiated. Set the speed from the GUI. HostSync
- ccquantize.lua Quantizes all incoming CCs to steps of 32.
- ccremap.lua Shows how to remap CCs. Just maps 1->74 and 2->75. Only needs 10 lines of code!
- ccsmooth.lua Filters all CCs with an exponential smooth.
- chord.lua Plays chords. Press a note on your MIDI keyboard chord notes will be added. Select chord types from the GUI.
- complex_drummachine.lua Like drummachine.lua, but has multiple drum channels. HostSync
- drummachine.lua Very simple drum machine. Set the pattern (in 16th notes) in the GUI. Plays C-3 at those times. HostSync
- dualfo.lua LFO example, with a pair of LFO's, one modulating the other. The output affects CC74. HostSync
- forcetoscale.lua Shows how to force MIDI notes to a given scale. Select mode/key from the GUI panel; MIDI notes will be forced to the nearest note which is in key.
- graphical_groove.lua Basic groove editor (like energyXT's MIDI groove effect). In the GUI panel, you can set note delay (first row) and note velocity gain (second row) for each 16th note. HostSync
- groove.lua Simple groove effect. Adds groove to notes C-3 (bassdrum) and F#3 (hihat), but no others. HostSync
- guitest.lua Tests all the gui components. Also tests keyboard control (try pressing keys and watching the message window). Tests drag and drop support.
- humanize.lua Add slight variations to timing and velocity of notes. Based on script posted by austinfx on KVR.
- keytracking.lua Very simple keytracking, adjusts CC74 (filter cutoff) so that it increases as the note played runs up the keyboard.
- lfo.lua LFO example, with a single LFO, synced to the host tempo. The output affects CC74. HostSync
- livequantize.lua Delays notes until the next quantized interval in real time. The quantize level can be set in the GUI panel. HostSync
- microtuner.lua A more complex script, which can load Scala .scl files, and microtunes incoming input using pitchbends. Input is spread over 16 channels (with independent pitch bend), so polyphonic microtuning works. The output should be sent to a machine which supports independent pitch bend per channel (e.g. polyiblit). The detune level of the target synth can be set in the script. Scala files can be loaded via the GUI.
- midi_sampledelay.lua Delays incoming midi by a set number of samples (set from the GUI).
- midiecho.lua Incoming notes are echoed (repeated after a delay with reduced velocity).
- midilooper.lua Simple looper. Depress the sustain pedal (or otherwise set CC4 to 127) and the script
will start recording. When the pedal is released, the recorded loop is played until the pedal is next used to mark a recording point. Double-tap the pedal to clear the loop. The loop start/end can also be quantized to bar boundaries (see the "quantize" variable in the script)
- monster_pitch.lua Takes incoming notes on channel 0, and replicates them across all 16 channels, and continuously pitch bends all of the channels with a slowly drifting function. Result is a bit like Ligeti's Atmospheres (if you use a choir patch).
- note_release.lua Simply plays a note a fifth above the original when the original is released. Do-wee, doooo-wee, etc.
- ornament.lua Adds "ornaments" to notes (inspired by the awesome Buzz machine SpeccyII).
- pitchdrift.lua Like monster_pitch.lua, but only across two channels and with less extreme pitching.
- print_notes.lua Prints out incoming notes to the message window. Shows how to use numberToNote()
- print_events.lua Prints out all incoming events.
- snapshots.lua Records and morphs between snapshots. Hold down a MIDI note, and move some CCs. Do another. Pressing the original will morph back to the CCs that were set while the first note was down. Notes are not passed on to the host.
- spin.lua Send a MIDI note, and the note will be repeated, with increasing delay and decreasing velocity. Sounds a bit like spinning the wheel of a bike if a percussive synth is used.
- transpose.lua Very basic script, transposes notes below C-4 down a fifth, notes above up by a fifth.
- triggerenv.lua Triggers an ADSR envelope on CC74 when C-2 is pressed. You can set the envelope values from the GUI panel.
- velocity_scale.lua Changes the velocity response of incoming notes. The response can be set from the GUI. Low values make it less sensitive, high values more sensitive.
scripts/contrib
Contributed scripts go here!
scripts/algo
Algorithmic music generation stuff. Only very basic things here just now. All of these are host-synced, so the host must be playing for any output to be generated.
- chordcatalogue.lua Plays Tom Johnson's "Chord Catalogue" . HostSync
- musinum.lua Plays a simple sequence, based on the Music in the Numbers algorithm. HostSync
- random_notes_algo.lua Adapted from a script sent by Robert Lindeman. Plays random, tuneful notes. HostSync
- random_tunes.lua Plays sequences of major chords, randomly moving around the circle of fifths. HostSync
- rhythmic.lua Plays a very simple rhythmic pattern: daa---da---daa---da---daa---da... HostSync
- runscales.lua Runs up and down scales, with the base note set by the incoming MIDI note. Set the scale to use from the GUI panel. Speed is controlled with the mod wheel. HostSync
scripts/test
Test functions, not likely to be very interesting to most people.
- bmptest.lua Tests that bitmap loading works.
- hashtest.lua Tests the value hashing functions.
- hosttime.lua Tests setHostTime() functionality (for bidule users).
- sysextest.lua Tests sysex message packing/unpacking and sysex event send/receive. Unfortunately
there are very few hosts that support vst sysex. VSTHost does, however.
scripts/netosc
Networking, shared memory communication, and Open Sound Control examples.
- cc-osc.lua OSC example, translates incoming MIDI CCs to OSC messages and sends them on UDP port 7 to localhost.
- midi-otherinstance.lua Uses shared memory to send midi events to all other instances of VstLua currently running on this machine.
- net-recv.lua Tests network receive capability using recv() in onFrameCb().
- net-recv-loop.lua Test network receive with multithreaded recv().
- net-send.lua Sends messages via UDP. Use with net-recv.lua/net-recv-loop.lua
- osc-cc.lua OSC example, translates incoming OSC packets on port 7 to CC messages, in the same format as cc-osc.lua uses.
- osc-handler.lua Shows how to create OSC scripts that respond to events.
- osc-recv-test.lua Dumps incoming OSC packets on port 7000 to the message window.
- osc-send-test.lua Sends a simple test OSC message to port 7000 on localhost.
- osctest.lua Tests all OSC functionality (all datatypes, bundles, nested bundles, etc.)
- sharedmem.lua Simple communication example with shared memory.