Sign in to follow this  
Neonic148

modplug midi conversion

Recommended Posts

Hello, I have OpenMPT-1.17.02.54 that I plan to use to convert midi files to module files. I have created a midi file and I can play it with my windows media player. When I import this midi into modplug, the music sounds different from the way it sounds in the windows media player. This musical deformation will also be hearable after the music is exported as a module file(I can only export it as IT). I discovered that the midi file also sounds different when I play it in the quicktime player. So I guess each player has its own instruments for midi files. I like the music the best the way it's played in the media player, I need that music in some kind of module file. Is there a way to make the exported IT file sound exactly the same as the original midi file(played by my windows media player)?

Share this post


Link to post
Share on other sites
MIDI has no intrinsic sounds, just instructions to play sounds. So it will sound different depending on which hardware or software is playing back those sounds - it might be the Microsoft software synthesizer, or it could be your sound card's onboard sounds.

Tracker formats like IT however use samples to play back their music. Typically this is done by embedding the instrument definitions in the tracker file. I seem to recall that MPT allows you to use a General MIDI sound bank, which probably results in similar output to that which you'd get via the Microsoft soft synthesizer route. However, I expect that you can't legally distribute those sounds with your file. So if you intend to distribute this IT file to others, it will sound different for each user (if it even plays at all - they may not have the GM sound bank that you're using on your PC). The alternative is to change the file to use different instruments that you're allowed to distribute.

If you instead used a compressed wave format such as MP3 or OGG, you could capture the exact sounds of your MIDI setup and distribute that however you liked. But then it would obviously not be in IT format. If IT format is absolutely necessary then you could write a new IT song, with a single note in it, that is playing back the compressed audio. This depends on the tracker decoding software supporting compressed audio formats, of course.

Share this post


Link to post
Share on other sites
Quote:
Original post by Neonic148
Is there a way to make the exported IT file sound exactly the same as the original midi file(played by my windows media player)?


Like Kylotan says - MIDI = Music Data only - designed to play on any computer. Computer software or sound card provides the sounds to play.

IT = Music Data + Samples

You will need to create instruments samples to assign to the instruments that the IT song references.

Quote:
MPT allows you to use a General MIDI sound bank


You CAN load the instruments from the GM Bank into your IT file - there are many problems with this approach:

1. You won't have rights to distribute those sounds in your music - they are copyright as part of the Windows OS.

2. You need to know what restrictions the player you are using will need from the IT file - ie IT files support multi-sample instruments - what happens when you drag an instrument from the GM Bank into the IT file's instrument. It will create a new instrument mapping with multiple samples. Some engines don't allow this tho most should.

However it may give you a better understanding of what you may need to create.

Share this post


Link to post
Share on other sites
The reason I want my music to play as notes/samples is that my music should be treated as two parts:

1 the intro, that is played only once at the beginning

2 the main tune, that is looped

The sound from the last notes of the intro overlaps about a second with the sound of the first notes in the main tune.

I could try to make several wavs or mp3s and give each of them a time to start playing, to make it sound as if they were one song. However, then I wouldn't have that super precize synthesizer to let the right wav/mp3 be played at exactly the right (millisecond accurate) time. The time precision would depend on the framerate that my app runs with.

Or is it someway possible to link a wav/mp3 to a midi event?
Or to treat a complete wav/mp3 as a sample for IT?

[Edited by - Neonic148 on September 14, 2009 4:47:01 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Neonic148
I could try to make several wavs or mp3s and give each of them a time to start playing, to make it sound as if they were one song. However, then I wouldn't have that super precize synthesizer to let the right wav/mp3 be played at exactly the right (millisecond accurate) time. The time precision would depend on the framerate that my app runs with.


It depends on what audio engine you're using and the limitations of the hardware you're playing on. If you're doing this with FMOD or WWise it should be easy to setup in an event.

If you're playing this under Windows, or any consoles then you can easily allow 2 streams at once - and specify the start the main loop to begin 1 sec before the end of the intro.

Alternatively provide the intro (minus the 1 second overlap) + play the main loop, and the 1second remaining of the tail of the intro at the same time (the first time) and only the main loop any other times it plays..

Quote:
Original post by Neonic148
Or is it someway possible to link a wav/mp3 to a midi event?
Or to treat a complete wav/mp3 as a sample for IT?


For long sounds like songs in an IT file, possibly not - the IT file may have a restriction on the length of the sample. You could try it with MIDI / DLS. Implementation.

Another way to do it is depending on how it's being implemented and if you can get seamless stitching, is to define 4 sequences:
1. Intro
2. First Bar of Main Loop with tail from intro
3. First Bar of Main Loop without intro tail
4. Mainloop minus first bar.

Intro Becomes: [1 + 2 + 4]
Main Loop Becomes [3 + 4]

ALTERNATIVELY - if your main loop doesn't HAVE to start from the beginning and it's always played after INTRO.. you could do it this way:

Intro = Intro + First Bar of Main Loop
Main Loop = Main Loop from Beginning of 2nd Bar to End of First Bar

Share this post


Link to post
Share on other sites
Quote:

If you're playing this under Windows, or any consoles then you can easily allow 2 streams at once - and specify the start the main loop to begin 1 sec before the end of the intro.


Is there a website that teaches this for C++ on windows?

[Edited by - Neonic148 on September 15, 2009 11:57:40 AM]

Share this post


Link to post
Share on other sites
There are many different ways of doing this in C++. But if you were going to use an IT file, what were you going to play that back with? If you had a library of playing back IT files then such libraries usually have capability for playing other sound formats, and setting loop points.

Share this post


Link to post
Share on other sites
Quote:

But if you were going to use an IT file, what were you going to play that back with?


Originally the plan was using bassmod to play the music files. But now I hear it's possible to play a wav/mp3 with delay, that seems a much easier solution.

[Edited by - Neonic148 on September 15, 2009 12:42:43 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this