faust icon indicating copy to clipboard operation
faust copied to clipboard

monophony handling

Open giuliomoro opened this issue 6 years ago • 11 comments

use faust2xxx (e.g.: bela, caqt) with -midi -nvoices 1 and you will get the following behaviour:

  • press key A, you hear note A. Keep holding key A
  • keep holding key A, press key B, you hear note B, keep holding key A
  • keep holding key A, release key B, keep holding key A. You hear nothing.

This may be expected behaviour, as the docs say

When a key-on event is received, gate will be set to 1. Inversely, when a key-off event is received, gate will be set to 0. Therefore, gate is typically used to trigger an envelope, etc.

but I'd argue this is not desirable behaviour: who would want to find themselves still holding down a note and not hearing anything? Analog monosynths typically had "high" or "low" note priority, meaning the currently pressed highest (or lowest) note would be the one you'd hear. Later on, digital keyboard scanning came into play and some synthesizers started providing the "most recent" note on: the latest note being pressed (B) would be the one you'd hear, and when releasing it, while still holding down an old note A, you'd go back to hearing A. Are any of these behaviours available in FAUST?

example file:

declare options "[midi:on][nvoices:1]";
import("stdfaust.lib");
freq = hslider("freq",200,50,1000,0.01);
gain = hslider("gain",0.5,0,1,0.01);
gate = button("gate");
envelope = en.adsr(0.01,0.01,0.8,0.1,gate)*gain;
process = os.sawtooth(freq)*envelope;

built with faust2caqt -midi -nvoices 1 poly.dsp

note that the above file (mostly taken from https://faust.grame.fr/doc/manual/index.html#midi-polyphony-support ), does actually require the -nvoices command-line switch to build, even though the page says it shouldn't need it.

giuliomoro avatar Dec 04 '18 16:12 giuliomoro