diff options
| author | gramanas <anastasis.gramm2@gmail.com> | 2023-04-20 18:24:49 +0300 | 
|---|---|---|
| committer | gramanas <anastasis.gramm2@gmail.com> | 2023-04-20 18:24:49 +0300 | 
| commit | c161e1016a04566a56b4858ea43502fed88dcc7f (patch) | |
| tree | b4b3086f000df6b63229dae6057f1aa253811b30 /src/synth.c | |
| parent | 1e374b426b4182c7b73b35219aadaca267b9623c (diff) | |
| download | synth-project-c161e1016a04566a56b4858ea43502fed88dcc7f.tar.gz synth-project-c161e1016a04566a56b4858ea43502fed88dcc7f.tar.bz2 synth-project-c161e1016a04566a56b4858ea43502fed88dcc7f.zip | |
Add midi
Diffstat (limited to 'src/synth.c')
| -rw-r--r-- | src/synth.c | 10 | 
1 files changed, 10 insertions, 0 deletions
| 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 <string.h>  #include <portaudio.h> +#include <portmidi.h> +  /* 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 ) ); | 
