Sign in to follow this  

Strange problem when playing midi using sdl_mixer

This topic is 4201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using Sdl_mixer 1.2.7 for this. Whenever I play the midi files, the sounds I hear are choppy. Sometimes though, they sound as the way they are supposed to, but most of the times, they are plain choppy. I don't know if these would hel, but I use this for my initialization: Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096); It always returns 0. and for loading the midi file music = Mix_LoadMUS(<midifile>); Basically, the problem is, for each program run, midi plays sometimes sounds fine, but most of the time choppy. I can't figure out why. Can anyone enlighten me with this?

Share this post


Link to post
Share on other sites
Sorry, just this can be SO many things :).

Does it also do this if you play WAV files using Mix_LoadWAV?

What about when you just play midi files on your desktop using your normal player?

Share this post


Link to post
Share on other sites
If MIDI is giving you a hard time then why don't you just use ModPlug Tracker to convert your MIDI file to an Impulse Tracker file format. That should fix the problem with MIDI. I suspect it has to do with the way that instruments are stored in memory in your MIDI playback device.

Share this post


Link to post
Share on other sites
Quote:
Original post by NeoJigglypuff

I don't know if these would hel, but I use this for my initialization:
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096);
It always returns 0.


Have you tried using AUDIO_S16 instead of the MIX_DEFAULT_FORMAT?

That's pretty much all I use and I can play everything just fine..

hth,


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Could be your soundcard (or lack thereof). Most computers that ship these days unfortunately come with no hardware midi support now(all midi is done by software mixing through pc drivers). An example of using a software midi driver is that it can cause things like delays (in ms), choppy notes, etc. On XP, or 2000, if the only midi device in your system is 'Microsoft GS Wavetable SW Synth', then you have one of these "cheap" sound cards/chips. If you want decent hardware midi support, get a SB16, SB Audigy, or any line of the new SB sound cards. Your best bet is to either get a new soundcard, or convert the midi to a MOD file. You can also record your midi to a WAV, or OGG, or other format. It's really a shame that sound cards are no longer focusing on hardware midi anymore. Even turtle beach (authors of so many piano software products) have stopped selling cards with hardware midi. Thats why your only safe bet is Creative.

Share this post


Link to post
Share on other sites

This topic is 4201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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