Skip to content

Instantly share code, notes, and snippets.

View vinc6's full-sized avatar
🎯
Focusing

vinc vinc6

🎯
Focusing
  • hong kong
View GitHub Profile
@vinc6
vinc6 / p_quantizer.lua
Last active February 14, 2024 03:55
script for frequency tracker and such
--- pitch quantizer
-- vinc 240211
-- in1: freq
-- in2: amp
-- out1: pitch quantized sine osc
-- out2: pitch quantized cv
-- out3: trig
-- out4: amp env follower
lasf_f = 0
--- coordinates cv generator
-- vinc 230124
-- in1-2: x-axis, y-axis
-- out1-4: magnitude in corresponding quadrants
function quadrants()
local x = math.min(math.max(input[1].volts, -5), 5)
local y = math.min(math.max(input[2].volts, -5), 5)
local h = math.sqrt(math.pow(x, 2)+math.pow(y, 2)) -- hypotenuse
local r = math.atan2(y, x) -- radian
MIDIClient.init;
MIDIIn.connectAll;
~midiOut = MIDIOut.newByName("Elektron Digitakt", "Elektron Digitakt").latency_(Server.default.latency);
(
MIDIdef.cc(\controlChange, {
| val, num, chan, src |
var digitaktUID, nanoCtrlUID;
digitaktUID = MIDIIn.findPort("Elektron Digitakt", "Elektron Digitakt").uid;