From c161e1016a04566a56b4858ea43502fed88dcc7f Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 20 Apr 2023 18:24:49 +0300 Subject: Add midi --- src/synth.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/synth.c') diff --git a/src/synth.c b/src/synth.c index 5ce932f..29c44e7 100644 --- a/src/synth.c +++ b/src/synth.c @@ -27,16 +27,20 @@ #include #include +#include + /* graphics */ /* synth */ #include "synth_engine.h" #include "synth_gui.h" +#include "midi.h" #define NUM_SECONDS (1) #define WAVE_SIZE (44100) + static void StreamFinished( void* synthData ) { @@ -44,6 +48,7 @@ StreamFinished( void* synthData ) printf( "Stream Completed\n"); } + int main(void) { PaStreamParameters outputParameters; @@ -51,7 +56,10 @@ main(void) { PaError err; int i; synth_t synth; + midi_t midi; + init_synth(&synth); + init_midi(&midi, &synth); err = Pa_Initialize(); @@ -107,6 +115,8 @@ main(void) { return err; error: Pa_Terminate(); + free_synth(&synth); + terminate_midi(&midi); fprintf( stderr, "An error occurred while using the portaudio stream\n" ); fprintf( stderr, "Error number: %d\n", err ); fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) ); -- cgit v1.2.3