MIDI file writer or wav or ogg?
MIDI file writer or wav or ogg?
Hello, is there a library to create midi files, or wav files or ogg files in PB?
Thanks
Thanks
Re: MIDI file writer or wav or ogg?
Hi,
To save data as wav file, you have to use an own procedure.
But there are examples available. For example:
viewtopic.php?p=412988#p412988
MIDI Reader:
viewtopic.php?p=408596#p408596
viewtopic.php?p=71613#p71613
Also the file format of MIDI is not very complicated:
https://www.csie.ntu.edu.tw/~r92092/ref/midi/
Btw. you can load midi files directly via LoadMovie() ...
viewtopic.php?p=457492#p457492
To save data as wav file, you have to use an own procedure.
But there are examples available. For example:
viewtopic.php?p=412988#p412988
MIDI Reader:
viewtopic.php?p=408596#p408596
viewtopic.php?p=71613#p71613
Also the file format of MIDI is not very complicated:
https://www.csie.ntu.edu.tw/~r92092/ref/midi/
Btw. you can load midi files directly via LoadMovie() ...
viewtopic.php?p=457492#p457492
Re: MIDI file writer or wav or ogg?
Thank you for the link. I have this error: Structure not found: WAVEFORMATEX while trying to run the program. Perhaps you could say me why this error?
Thank you.
Thank you.
Re: MIDI file writer or wav or ogg?
About which source code you are writing?
There are so many codes insided the links, it cost me simply to much time to check all of them.
There are so many codes insided the links, it cost me simply to much time to check all of them.
Re: MIDI file writer or wav or ogg?
I am sorry very much. The source code is the first you have given to me. viewtopic.php?p=412988#p412988infratec wrote:About which source code you are writing?
There are so many codes insided the links, it cost me simply to much time to check all of them.
I don't know understand why the structure is not defined in this source... But I have seen the link to the midi file specifications and I think I will use this way.
Thank you very much.
Re: MIDI file writer or wav or ogg?
I guess u are using a older version or the demo.bloiiing wrote:I am sorry very much. The source code is the first you have given to me. viewtopic.php?p=412988#p412988infratec wrote:About which source code you are writing?
There are so many codes insided the links, it cost me simply to much time to check all of them.
I don't know understand why the structure is not defined in this source... But I have seen the link to the midi file specifications and I think I will use this way.
Thank you very much.
Add this and it should work:
Code: Select all
Structure WAVEFORMATEX
wFormatTag.u
nChannels.u
nSamplesPerSec.l
nAvgBytesPerSec.l
nBlockAlign.u
wBitsPerSample.u
cbSize.u
EndStructureRe: MIDI file writer or wav or ogg?
I guess u are using a older version or the demo.
Add this and it should work:[/quote]
Thank you for the structure. But where can I find the new version of this demo? I am asking that because I have a new error: Constant not found: #WAVE_FORMAT_PCM. I am afraid to boring you with my questions...
Thank you.
Add this and it should work:
Code: Select all
Structure WAVEFORMATEX
wFormatTag.u
nChannels.u
nSamplesPerSec.l
nAvgBytesPerSec.l
nBlockAlign.u
wBitsPerSample.u
cbSize.u
EndStructureThank you for the structure. But where can I find the new version of this demo? I am asking that because I have a new error: Constant not found: #WAVE_FORMAT_PCM. I am afraid to boring you with my questions...
Thank you.
- NicTheQuick
- Addict

- Posts: 1549
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: MIDI file writer or wav or ogg?
He guesses you are using the demo version of Purebasic. The demo version does not include any structures or constants from the Windows API. That the reason why the structur and constant can not be found.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Re: MIDI file writer or wav or ogg?
Are you sure? Because I use the version that I have downloaded from my user account. I registered PB few years ago. And It works with others programs. But I have forgotten to say you that I am under Linux. I am going to try under windows and I will come back to let you know if it works.NicTheQuick wrote:He guesses you are using the demo version of Purebasic. The demo version does not include any structures or constants from the Windows API. That the reason why the structur and constant can not be found.
Thank you.
Re: MIDI file writer or wav or ogg?
I have just verified and it is the reason. It works fine on windows without changes. I had not seem there where windows constants.bloiiing wrote:Are you sure? Because I use the version that I have downloaded from my user account. I registered PB few years ago. And It works with others programs. But I have forgotten to say you that I am under Linux. I am going to try under windows and I will come back to let you know if it works.NicTheQuick wrote:He guesses you are using the demo version of Purebasic. The demo version does not include any structures or constants from the Windows API. That the reason why the structur and constant can not be found.
Thank you.
Sorry an thanks you for your help.

