lokki who wrote the SampleLoader.h?
I think we did
lokki i found this: https://github.com/erikd/libsndfile/blob/master/examples/sndfilehandle.cc but the format of the functions is quite different to what is in SampleLoader.h
this is using a C++ API (note the .hh
in #include <sndfile.hh>
) which I have never used (or heard of).
lokki this is better i think:
looks like a very good starting point
lokki and i added this to SampleLoader.h:
that looks good. Does it work?
lokki switch (sendHash) {
case save_table: {
writeSamples(bla,bla,bla);
break;
}
Assuming that save_table
is something you computed with hv_stringToHash("save_table")
, then yes. Note that because of how switch
is implemented, save_table
needs to be constant (i.e.: you need to compute it once, then hardcode the value, see the existing examples in the code).
lokki on another note, would removing these: rt_printf("noteon: %d %d %d\n", channel, pitch, velocity);from the render.cpp make midi faster, or less cpu hungry? or is the rt_printf not affecting performance when the IDE is not running?
It would indeed save some CPU time. Good thing to comment it out. It was meant to be optional: https://github.com/BelaPlatform/Bela/issues/373