Posts: 27
Threads: 3
Joined: Jul 2023
Reputation:
3
I'm looking for a solution how I can play MIDI music within a file and then repeat itself over and over again.
As an example:
The Music.mid is in an archive at offset address &H400.
For example, I want to load the data into an array and send it to an API like Winmm. Is that possible? And if so how?
Or are there better alternatives for such a project?
The archive is nothing special. Is simply a raw archive.
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
$UNSTABLE:MIDI
' Using a custom soundfont rather than the default
$MIDISOUNDFONT: "soundfont.sf2"
_SNDPLAYFILE "example.mid"
Posts: 27
Threads: 3
Joined: Jul 2023
Reputation:
3
Is there any alternative other than $unstable:midi and soundfonts?
Because the file is over 200MB in size when I use the commands.
That's out of all proportion.
I have a gm.sf2 that is almost 3MB and a midi file with almost 400 bytes
Then why is the EXE over 200MB?
Without $unstable:midi and soundfonts, the EXE is just 2MB in size.
What is QB64PE doing there? That's stupid.
Would like to use the tools of Windows. So no sound fonts.
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
Can you share the code and file? Something is wrong if it's a 200mb file.
Posts: 734
Threads: 30
Joined: Apr 2022
Reputation:
43
You can use MCISendString, I believe.
Tread on those who tread on you
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
You did not say in your OP that you wanted the MIDI file played back by the system, ie. the "GS Wavetable Synthesizer" or through a MIDI cable into a hardware synthesizer.
Welcome to consequences with using MIDI and Soundfonts. The Soundfont will become part of the EXE file to ensure playback of any MIDI file that could possibly use that Soundfont. The system cannot assume which patch will be used, so it could include a few and throw away the others. This malady happens anywhere else that a Soundfont has to be packed along with other data and the execution of music related to it.