News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Beep

Started by raleeper, August 12, 2011, 12:24:46 PM

Previous topic - Next topic

jj2007

Quote from: dedndave on August 14, 2011, 08:37:37 AM
Jochen,
open up your volume mixer and make sure the SW Synth level isn't all the way down or muted
i got it to work with a file using a single call to mciSendString
        INVOKE  mciSendString,chr$('play \masm32\examples\bcraven\playmidi\sample.mid'),
                NULL,NULL,NULL


i don't think i can play from a memory location that way
i may have to use a few calls to mciSendCommand, or use the midi functions

Perfect, it works. Thanks, Dave :U

dedndave

i see that the sw synth level keeps setting itself to 0
here is what i can gather after searching....

the SW Synth volume level is, of course, in the system registry
many midi files set the volume for the different midi channels
after playing a midi file with windows media player or many other programs,
the Synth volume level is reset to the value it was at boot
so, to get a change to remain, you set the level and reboot before playing a midi file
there is probably an easy registry edit, but i cannot seem to find it on the web

on another note.....
mciSendString is probably not the way to go, anyways
there is a noticible delay between the execution time and the time the sound occurs - lol

my understanding is that i do not need a midi file at all - even in memory
by using the winmm midi functions, i can send data strings directly to the synth to make sounds

jj2007

Quote from: dedndave on August 14, 2011, 04:01:55 PM
mciSendString is probably not the way to go, anyways
there is a noticible delay between the execution time and the time the sound occurs - lol

Right. However, to make it work for an "acoustic messagebox", you can open it at progstart and call the play command when you need it. There is no delay for play.

I attach an extra-long beep for you. Sorry, can't push it below 1,536 bytes :bg

dedndave

oh - i think you can make any musical beep you want in a file less than 128 bytes
the one drawback of midi files - everything has to be fricken musical - lol

jj2007

Quote from: dedndave on August 15, 2011, 12:53:52 AM
oh - i think you can make any musical beep you want in a file less than 128 bytes
the one drawback of midi files - everything has to be fricken musical - lol

The 1,536 referred to the executable, not the midi file - ok, I admit the example is really a bit gaga :P