Home | Reviews | GUIpedia | Forum | Fun500
| QMidi loopingHey, How do I loop A Midi, or how do I detect if a midi is playing or not? thanks. I want looping music in my game, Kase-block. | 2009-02-22 | 1:06 AM |
Todd | Re:QMidi loopingI never really got MIDIs working in DOS but I'd imagine you'd have to find the loop you are using to play the MIDI and sync it with the loop for the game. Technically, you'd have to combine the loops to play tunes along with the game play.
To tell if a MIDI is playing, just check to see if you're not at the EOF or see that your SEEK index is less than or equal to the LOF.
The problem with MIDIs is that they do not work the same way as WAV or MP3 files. MIDIs use a soundboard built into the sound card and extended by the operating system or a program (if you use SoundBlaster with DOS). The soundboard produces the sound according to the notes the MIDI makes so all the tunes are pre-recorded either through the sound card or the soundboard extension of the OS.
I never really had much luck getting MIDIs to play in DOS. Since I never had a soundboard extension for QBasic or DOS, it could never play. | 2009-02-22 | 9:26 AM |
| Re:QMidi loopingQMidi uses Assembly to play the music. I have to run. SBMIDI and SBSIM to make make the midis work properly. | 2009-02-22 | 4:04 PM |
Todd | Re:QMidi loopingSBMIDI probably provides the MIDI soundboard extension for your sound card. SBSIM is the interface module for your sound card in DOS.
You said it uses Assembly. Does it use QB's INTERRUPT method or is it a compiled LIB file? | 2009-02-22 | 5:16 PM |
| Re:QMidi loopinghttp://www.petesqbsite.com/downloads/qmidi41.zip
I don't understand. DW. just have a look around the code. :) | 2009-02-23 | 1:24 AM |
Todd | Re:QMidi loopingIt does use INTERRUPTs. Looking at the code, there are subroutines like "StopMIDI" and a function called "TimeMIDI" to return the playback time. My guess would be that you could loop it but you'd just have to know how long your MIDI plays and then every interval, play the MIDI again. | 2009-02-23 | 8:50 AM |
| Re:QMidi loopingOk, for my song it's 109. Thank you a ton! :) | 2009-02-23 | 3:37 PM |
| Re:QMidi loopingThere is a MIDILoop function in QMIDI.BAS
You can either call this function in a loop or you can modify this function - split it at two functions: IS_playing and Play_if_not_playing.
I also wrote a port of this library for Pascal (works in Turbo pascal and Freepascal)
http://www.laaca.borec.cz/soubory/midipas.zip | 2009-02-28 | 5:40 AM |
| Re:QMidi loopingWhich version of QMidi would it be? I don't I downloaded the latest one. Version 3.5? | 2009-02-28 | 6:13 PM |
| Re:QMidi loopingUpdate:
There's a 'user friendly' version called midilib.
It has LoopMIDI, Thanks so much! :cheer: :cheer: :cheer: | 2009-02-28 | 6:17 PM |
BASIC Programming Help
2021 Brandon Cornell