Experiment: Use Midi Knob To Write A Sample

try putting this into your MidiActions.lua, located intot he “Scripts” folder (at the end of the file is fine):

local int_frame_buffer_pointer = 1;  
add_action("Selected Sample:Sample Buffer Writer [Set]",  
 local sample = song().selected_sample;  
 local buffer = sample.sample_buffer;  
 local int_frames = buffer.number_of_frames;  
 local int_chans = buffer.number_of_channels;  
 if message:is_rel_value() then  
 elseif message:is_abs_value() then  
 local real_value = 2*message.int_value/127-1;   
 local int_chan;  
 for int_chan = 1, int_chans do  
 buffer:set_sample_data(int_chan, int_frame_buffer_pointer, real_value);  
-- app():show_error(tostring(real_value));  
 int_frame_buffer_pointer = int_frame_buffer_pointer + 1;  
 if int_frame_buffer_pointer > int_frames then  
 int_frame_buffer_pointer = 1;  

now create a small sample, assign this new action to a MIDI controller via the Midi Map panel (on “Global Mappings => Selected Sample => Sample Buffer Writer”, then go to the sample editor and tweak the MIDI controller you have chosen: you will see your movements drawn on the sample editor window :)

if you now put a note for this instrument on the pattern and play it, you can hear the wave changing while moving the MIDI controller.

using MIDI Yoke and programs such as Plogue Bidule, you can do weird things such as transform amplitude value of your microphone input into MIDI signals and literally record your own voice in small loops.

A dream come true!


haha, awesome! etch a fuckin sketch!

trippy stuff, it-alien! (=

So right now you can map one knob for the drawing fun. Wouldn’t it be cooler to be able to set 2 knobs, 1 for up and down vertical movement and the other for horizontal drawing. Then a combination of moving both would draw diagonally. Would make more sense imo. Nevertheless great fun and thanks for this!

Hah awesome. :P