MIDI volume control

curry curry at pair.com
Sun Jan 16 00:33:52 EST 2005

Unfortunately, there is no way to do it with mciSendString as far as I
know. There should be--but there's not.

You have to use shell or external. I made a helper app using BASIC, but the
EXE size is not super tiny--it's maybe 300 or 400K. That works just fine,
but a smaller one could be a little more responsive. I forgot the
exact API call to use because it's been 1.5 or 2 years.

(Background, for anyone curious about why this is needed:

In my opinion this is crucial for cross-platform dev because in some cases
QT on Windows (at least in some setups) just doesn't cut it--the worst is
it can lose pace when playing MIDI, and the result is terrible. So if you
turn off QT, then you just have to do two things: if using players for
sounds, use play instead for Win platform; and add volume adjustment for

Why vol. adj. for MIDI? Why not just set it in the MIDI itself? There is
ratio of MIDI and WAV volume; each has a different setting. It depends on
how the user has set it in the Master Volume control panel, or how
software has set it. So, if you use both sound and MIDI, you can
allow the user to make adjustments so that the sound and MIDI are both at
a comfortable level. For example, you can make a volume screen with a
slider that calls a volume-setter external, and another that sets



>>  playLoudness manages relative audioClip  volume, but has anyone figured
out  a generic shell command to  set the volume for MIDI playback (SW
Synth in  the 'volume  control' control panel) or is the command
>>   device-dependent?
>>  Purpose:
>>  To superimpose  wav speech over midi music and control relative
>>   volumes.

Kurt replied:
>  Perhaps you are not using Quicktime?   Otherwise it would be easy to, as
you say, manage the relative [player]  volume.  Also, I take it you have
existing MIDI sequences which  you would like to use, and are not
creating your own sequences for this  project, since MIDI note-event
volumes can range from 0-127.

Hi  Kurt,

Apologies... I said 'shell command' but I meant 'mciSendString'.

Background reading seems to indicate that 'volume' is not a 'required'
command, but if the 'volume control panel' can do it, and if Windows
can do it (it resets midi volume back to 100%), I assume access to MIDI
control is indeed possible.

'put mciSendString("setAudio volume 75") into returnValue'

What's the correct 'mciSendString' command syntax?


More information about the Use-livecode mailing list