- Muchas notas - Fran Acién

20250908 - MIDI with Faust

Know MIDI keys

Use the app MIDI monitor, and the midikey is the second byte in decimal. In the AKAI the buttons are from 44 and the potentiometers from 01.

declare options "[midi:on]";
import("stdfaust.lib");
freq = hslider("frequency[midi:ctrl 01]",200,50,1000,0.01) : si.smoo;
process = os.sawtooth(freq);
declare options "[midi:on]";
import("stdfaust.lib");
freq = hslider("frequency[midi:keyon 44]",200,50,1000,0.01) : si.smoo;
process = os.sawtooth(freq);
declare options "[midi:on]";
import("stdfaust.lib");
process = (os.osc(500)*en.adsr(0.1, 0.1, 0.8, 0.5, button("gate1[midi:key 44]")),
          os.osc(800)*en.adsr(0.1, 0.1, 0.8, 1.0, button("gate2[midi:key 45]")),
          os.osc(200)*en.adsr(0.1, 0.1, 0.8, 1.5, button("gate3[midi:key 46]"))) :> _;
declare options "[midi:on]";
import("stdfaust.lib");
bend = ba.semi2ratio(hslider("frequency[midi:pitchwheel]",0,-2,2,0.01)) : si.smoo;
process = os.sawtooth(440*bend);