+function queue_beep ()
+ -- queue 'ping' sound (unless one is already playing to prevent clicks)
+ if (ping_sound >= fps) then
+ -- major scale, 2 octaves
+ local scale = { 0, 2, 4, 5, 7, 9, 11, 12, 14, 16, 17, 19, 21, 23, 24 }
+ local midi_note = 60 + scale[1 + math.floor (math.random () * 14)]
+ ping_pitch = (440 / 32) * 2^((midi_note - 10.0) / 12.0) / sample_rate
+ ping_sound = 0
+ ping_phase = 0
+ end
+end
+
+-- callback: process "n_samples" of audio
+-- ins, outs are http://manual.ardour.org/lua-scripting/class_reference/#C:FloatArray
+-- pointers to the audio buffers