.mid woes... again..

Blitz3D Forums/Blitz3D Beginners Area/.mid woes... again..

po(Posted 2005) [#1]
music=PlayMusic("test.mid")
Print "Playing.."
While Not KeyHit(1)
	If Not ChannelPlaying(music) Then music=PlayMusic("test.mid"):Print "Looping.."
Wend
End

That should play the song and "loop" it, right? Well, it doesn't. I don't hear any sound at all. I can hear .mids fine through Windows Media Player, so it must be a blitz thing.
Does anyone else have this problem?


wizzlefish(Posted 2005) [#2]
Does Blitz support .mid?


po(Posted 2005) [#3]
Yup, but only when using PlayMusic(), so you can't use LoopSound.


Kuron(Posted 2005) [#4]
Haven't checked your code, but every version of Blitz has had issues with mids because it uses fmod for sound.

Somewhere in the code archives should be some userlibs for using winmm to play sounds. You can play MID & WAV through that and it should work fine on most PCs.


WolRon(Posted 2005) [#5]
The latest versions of Blitz play .mid files OK.


Sledge(Posted 2005) [#6]

The latest versions of Blitz play .mid files OK.



I don't think so. You used to be able to go...

soundtrack=PlayMusic ("whatever.mid")

Repeat
Until ChannelPlaying(soundtrack)=True

While ChannelPlaying(soundtrack)=True
   ;CODESTUFF
Wend


...but that's been effectively broken for ages (and I mean YEARS ages), slowing down program execution to a crawl. If anyone finds otherwise I'd appreciate you posting to correct me.


po(Posted 2005) [#7]
Well, if I can't play mids in blitz, can someone point me to a .mid to mp3, wav or some other blitz campatable format(preferably free)? I have tried Audacity, but it can't convert properly, and Goldwave doesn't either. There is also .mid Converter, but that costs money...


Sledge(Posted 2005) [#8]
You can still play them... the code I posted polls the playback routine as a condition to stay in a loop (typical use: a demo that ends when the music finishes). If you don't need to test whether the midi is playing in this fashion then you won't suffer the slowdown. However I would still avoid midi simply due to you having no clue how the music will sound on any one machine.

Most sound cards come with some sort of .WAV recorder. You can usually set these to record midi output, so getting a .WAV of your midi files should be easy enough (just hit record then start playing the midi file). After that you can use DBPowerAmp (a free utility) to convert the .WAV to .OGG (a free lossy compressed format supported by Blitz).


_PJ_(Posted 2005) [#9]
How would you access the WAV recorder of your sound card?


po(Posted 2005) [#10]
That's what I'd like to know....


Sledge(Posted 2005) [#11]
If your card didn't come with a sound recorder just Google for a freeware one...

http://www.google.co.uk/search?q=freeware+sound+recorder


Rottbott(Posted 2005) [#12]
Use TiMidity++. It can export MIDIs as WAV, MP3 or OGG and also substantially improves the quality!