no fx, un-hardcode midi file and sound font

This commit is contained in:
Maksymilian Wilczyński committed 2025-05-11 21:25:22 +02:00
1 parent 0e42efe8e9
commit d0cd0181a4
6 files changed
+4 -4

No files matched your search

+4 -4
View File
@@ -38,7 +38,7 @@ void WriteWAVHeader(std::ofstream &file, DWORD length) {
int main(int argc, char** argv) {
std::cout << "Program start\n";
if (argc != 2) {
if (argc != 3) {
std::cerr << "Wrong arguments!\n";
return -1;
}
@@ -50,7 +50,7 @@ int main(int argc, char** argv) {
}
// 2) Load the SF2PACK soundfont
HSOUNDFONT sfont = BASS_MIDI_FontInit("Chorium_fork.sf2", 0);
HSOUNDFONT sfont = BASS_MIDI_FontInit(argv[1], 0);
if (!sfont) {
std::cerr << "BASS_MIDI_FontInit error: " << BASS_ErrorGetCode() << std::endl;
BASS_Free();
@@ -58,8 +58,8 @@ int main(int argc, char** argv) {
}
// Create decoding stream (no playback)
HSTREAM midiStream = BASS_MIDI_StreamCreateFile(FALSE, argv[1], 0, 0,
BASS_STREAM_DECODE | BASS_SAMPLE_FLOAT, 44100);
HSTREAM midiStream = BASS_MIDI_StreamCreateFile(FALSE, argv[2], 0, 0,
BASS_STREAM_DECODE | BASS_SAMPLE_FLOAT | BASS_MIDI_NOFX, 44100);
if (!midiStream) {
std::cerr << "BASS_MIDI_StreamCreateFile error: " << BASS_ErrorGetCode() << std::endl;
BASS_MIDI_FontFree(sfont);