Commit 16421d9d by Jacob Vosmaer

Forgot to 'git add'

parent eba4db4e
#include <avr/io.h>
#include "voice.h"
#include "gate.h"
void
gate_on(uint8_t v)
{
if (v > NUM_VOICES) {
return;
}
PORTC |= _BV(v);
}
void
gate_off(uint8_t v)
{
if (v > NUM_VOICES) {
return;
}
PORTC &= ~_BV(v);
}
#ifndef gate_h
#define gate_h
#include <inttypes.h>
void gate_on(uint8_t voice);
void gate_off(uint8_t voice);
#endif
#include "dac.h"
#include "poly.h"
#include "gate.h"
#include "voice.h"
void
poly_note_on(uint8_t note)
{
uint8_t v = voice_acquire(note);
if (v == NUM_VOICES) {
// This should never happen if the voice assigner is working correctly.
return;
}
dac_set_note(v, note);
gate_on(v);
}
void
poly_note_off(uint8_t note)
{
uint8_t v = voice_release(note);
if (v == NUM_VOICES) {
// This can happen if we get a spurious note off message from MIDI
return;
}
gate_off(v);
}
#ifndef _poly_h
#define _poly_h
#include <inttypes.h>
void poly_note_on(uint8_t note);
void poly_note_off(uint8_t note);
#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