#define MAX_POLYPHONY 100000
-struct KSynth* ksynth_new(int sample_rate, int num_channel, int max_polyphony) {
+struct KSynth* ksynth_new(const char* file_path, int sample_rate, int num_channel, int max_polyphony) {
struct KSynth* ksynth_instance = malloc(sizeof(struct KSynth));
if(ksynth_instance != NULL) {
ksynth_instance->samples = malloc(sizeof(struct Sample*) * 128);
// Load samples from file
- FILE* f = fopen("sample.ksmp", "rb");
+ FILE* f = fopen(file_path, "rb");
if(f == NULL) {
fprintf(stderr, "[KSynth] Error: Failed to open sample file.\n");
free(ksynth_instance);
* @param max_polyphony Maximum polyphony (1-100,000)
* @return struct KSynth* A pointer to the newly created KSynth instance on success, NULL on failure.
*/
-struct KSynth* ksynth_new(int sample_rate, int num_channel, int max_polyphony);
+struct KSynth* ksynth_new(const char* file_path, int sample_rate, int num_channel, int max_polyphony);
/**
* @brief Turns a note on for the specified MIDI channel and note.