usynth

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

commit f591cbe8240599ac15feb34c35362cfd4387623f
parent a009d8d0ad58884db2de482d23522604215b56c5
Author: zavok <an2qzavok@gmail.com>
Date:   Fri, 25 Sep 2020 11:55:11 +0300

static everywhere

Diffstat:
Mfm.c | 1+
Mfm.h | 4++--
Mmachine.c | 2+-
Mmachine.h | 2+-
Mmidi.h | 2+-
Musynth.c | 4++--
Mwavetable.h | 2+-
7 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/fm.c b/fm.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <stdint.h> #include "operator.h" #include "wavetable.h" #include "fm.h" diff --git a/fm.h b/fm.h @@ -18,8 +18,8 @@ struct Channel { int16_t pitch; }; -Channel fm_channels[16]; -Voice fm_voices[32]; +static Channel fm_channels[16]; +static Voice fm_voices[32]; int64_t fm_synth(Voice*); int16_t fm_mix(void); diff --git a/machine.c b/machine.c @@ -97,7 +97,7 @@ void vm_fatal(VM* vm, char *errstr) { dprintf(2, "VM FATAL: %s\n", errstr); - dprintf(2, "pc = \n", vm->pc); + dprintf(2, "pc = %d\n", vm->pc); exit(-1); } diff --git a/machine.h b/machine.h @@ -34,7 +34,7 @@ struct VM { Channel *channel; }; -VM vms[32]; +static VM vms[32]; void vm_set(VM*, Channel*, Voice*); int16_t vm_run(VM*); diff --git a/midi.h b/midi.h @@ -10,7 +10,7 @@ struct Mvector { void(*sys_message)(uint8_t*); }; -Mvector m_vector; +static Mvector m_vector; void m_init(char *mdev); void m_read(void); diff --git a/usynth.c b/usynth.c @@ -37,8 +37,8 @@ s_init(char *sdev) int main(int argc, char **argv) { - s_init("rsnd/0"); - m_init("rmidi/0"); + s_init("snd/0"); + m_init("midi/0"); fm_init(); m_vector.note_on = fm_key_on; m_vector.note_off = fm_key_off; diff --git a/wavetable.h b/wavetable.h @@ -1,5 +1,5 @@ #define WT_LENGTH 256 #define WT_SIZE 8 -int16_t **wavetable; +static int16_t **wavetable; void wt_init(void);