Commit d5b85119 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Silly implementation of non-unison mono mode

parent a6c23593
PRG = crowbx
OBJ = crowbx.o midi.o dac.o uart.o gate.o poly.o mono.o list.o vibrato.o poly2.o poly_voice.o safe_add.o pitch.o buffer.o pitch_env.o vibrato_rate.o
OBJ = crowbx.o midi.o dac.o uart.o gate.o poly.o mono.o list.o vibrato.o poly2.o poly_voice.o safe_add.o pitch.o buffer.o pitch_env.o vibrato_rate.o mono2.o
MCU_TARGET = atmega328p
OPTIMIZE = -O3
......
......@@ -4,6 +4,7 @@
#include "gate.h"
#include "midi.h"
#include "mono.h"
#include "mono2.h"
#include "pitch.h"
#include "pitch_env.h"
#include "poly.h"
......@@ -15,6 +16,7 @@ enum _programs {
PGM_POLY,
PGM_POLY2,
PGM_MONO,
PGM_MONO2,
NUM_PGM,
};
static uint8_t current_program = NUM_PGM;
......@@ -23,30 +25,35 @@ void (*pgm_init[NUM_PGM])(void) = {
poly_init,
poly2_init,
mono_init,
mono2_init,
};
void (*note_on[NUM_PGM])(uint8_t n) = {
poly_note_on,
poly2_note_on,
mono_note_on,
mono2_note_on,
};
void (*note_off[NUM_PGM])(uint8_t n) = {
poly_note_off,
poly2_note_off,
mono_note_off,
mono2_note_off,
};
void (*control_change[NUM_PGM])(uint8_t ctl, uint8_t val) = {
poly_control_change,
poly2_control_change,
mono_control_change,
mono2_control_change,
};
void (*update_clock[NUM_PGM])(uint8_t delta) = {
poly_update_clock,
poly2_update_clock,
mono_update_clock,
mono2_update_clock,
};
void
......
#include "mono2.h"
#include "gate.h"
#include "mono.h"
#include "voice.h"
void
mono2_init(void)
{
mono_init();
}
void
mono2_note_on(uint8_t n)
{
mono_note_on(n);
}
void
mono2_note_off(uint8_t n)
{
mono_note_off(n);
}
void
mono2_control_change(uint8_t ctl, uint8_t val)
{
mono_control_change(ctl, val);
}
void
mono2_update_clock(uint8_t delta)
{
mono_update_clock(delta);
for_each_voice (v) {
if (v == 0) {
continue;
}
gate_off(v);
}
}
#ifndef _mono2_h
#define _mono2_h
#include <stdint.h>
void mono2_init(void);
void mono2_note_on(uint8_t note);
void mono2_note_off(uint8_t note);
void mono2_control_change(uint8_t ctl, uint8_t val);
void mono2_update_clock(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