#define MAX_POLYPHONY 100000
-struct KSynth* ksynth_new(const char* file_path, int sample_rate, int num_channel, int max_polyphony) {
+struct KSynth* ksynth_new(const char* sample_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(file_path, "rb");
+ FILE* f = fopen(sample_file_path, "rb");
if(f == NULL) {
fprintf(stderr, "[KSynth] Error: Failed to open sample file.\n");
free(ksynth_instance);
* The `max_polyphony` parameter sets the maximum number of simultaneous notes that can be played.
* Values exceeding 100,000 will be clamped to 100,000.
*
+ * @param sample_file_path Path to the sample file
* @param sample_rate Sample rate
* @param num_channel Number of channels (1-2)
* @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(const char* file_path, int sample_rate, int num_channel, int max_polyphony);
+struct KSynth* ksynth_new(const char* sample_file_path, int sample_rate, int num_channel, int max_polyphony);
+
/**
* @brief Turns a note on for the specified MIDI channel and note.