Replies: 1 comment
-
Do you have to use FluidSynth to read the MIDI data? Maybe you could simply use existing R libraries, like tuneR: https://search.r-project.org/CRAN/refmans/tuneR/html/readMidi.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote some bindings for the R programming language. In one function we read a midi file into an in-memory table object.
Currently this is implemented by playing the midi and using
fluid_player_set_playback_callback
to store events. We actually have tofluid_player_play()
twice, because we first need to know how much memory to allocate to store the midi data.On the first run we set
fluid_player_set_playback_callback
to a function that only increments a counter for each event. Once complete we know the total number of events in the midi file. We then reset the player, allocate the output memory, and set the callback to another function that stores each event in our output table, andfluid_player_play()
again.The code in here: https://github.com/ropensci/fluidsynth/blob/main/src/readmidi.c
Some questions:
fluid_player_set_playback_callback
?Beta Was this translation helpful? Give feedback.
All reactions