Commit 98512076 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Simplify gate retrigger: AS3310s reset faster

parent ada89eb9
......@@ -133,7 +133,6 @@ void do_clock_update(void) {
}
vibrato_update(delta);
gate_update(delta);
pitch_update_clock(delta);
}
......
......@@ -2,16 +2,6 @@
#include "pitch.h"
#include "voice.h"
static uint8_t _gate_retrig[NUM_VOICES];
enum {
// RETRIG_DELAY should be as low as possible to reduce MIDI latency, but
// high enough to allow the hardware envelope generators in the CrowBX
// to
// reset. I know 0x3f to be too low.
RETRIG_DELAY = 0x5f,
};
void gate_init(void) {
for_each_voice (v) { gate_off(v); }
}
......@@ -31,7 +21,6 @@ void gate_off(uint8_t v) {
return;
}
_gate_retrig[v] = 0;
*(g->port) &= ~(g->mask);
}
......@@ -41,22 +30,6 @@ void gate_on(uint8_t v) {
}
gate_off(v);
_gate_retrig[v] = RETRIG_DELAY;
}
void gate_update(uint8_t delta) {
for_each_voice (v) {
if (_gate_retrig[v] == 0) {
continue;
}
if (delta < _gate_retrig[v]) {
_gate_retrig[v] -= delta;
continue;
}
_gate_retrig[v] = 0;
gate_on_legato(v);
pitch_env_trigger(v);
}
gate_on_legato(v);
pitch_env_trigger(v);
}
......@@ -7,6 +7,5 @@ void gate_init(void);
void gate_on(uint8_t voice);
void gate_on_legato(uint8_t voice);
void gate_off(uint8_t voice);
void gate_update(uint8_t delta);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment