usynth

simple midi synth for sndio
git clone git://nsmpr.xyz/usynth.git
Log | Files | Refs

commit 9129563bedd9b5a7833d910e682ebea66a119e45
parent 1db2a347caffc8d52344a014835c4064f0583907
Author: zavok <an2qzavok@gmail.com>
Date:   Tue, 31 Dec 2019 18:11:14 +0300

arglbargl

Diffstat:
Mmachine.c | 14++++++--------
Musynth.c | 1-
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/machine.c b/machine.c @@ -3,8 +3,6 @@ #include "operator.h" #include "fm.h" -#include "tune.h" - #include "machine.h" @@ -43,7 +41,8 @@ i_chan(VM *vm) case 0x81: vm->stack[vm->sp-1] = vm->channel->pitch; default: - vm->stack[vm->sp-1] = vm->channel->control[vm->stack[vm->sp-1]]; + vm->stack[vm->sp-1] = + vm->channel->control[vm->stack[vm->sp-1]]; } } @@ -126,7 +125,7 @@ instruction instructions[128] = { void vm_set(VM *vm, Channel *channel, Voice *voice) { - int16_t *sprog = { + int16_t sprog[] = { I_LIT, 0x00, I_LIT, 0x00, I_VOIC, I_LIT, 0x00, @@ -141,14 +140,14 @@ vm_set(VM *vm, Channel *channel, Voice *voice) int16_t vm_run(VM *vm) { - instruction *inst; + instruction inst; vm->halted = 0; vm->pc = 0; vm->sp = 0; while (vm->halted == 0) { - inst = vm->prog[vm->pc]; + inst = instructions[vm->prog[vm->pc]]; vm->pc++; inst(vm); } return vm->stack[vm->sp-1]; -} -\ No newline at end of file +} diff --git a/usynth.c b/usynth.c @@ -4,7 +4,6 @@ #include <stdint.h> #include <sndio.h> #include "midi.h" -#include "audio.h" #include "operator.h" #include "fm.h"