VBGamer |
|
Midi volume with ActiveMovie DiscoStew (0 replies, 0 views) (2000-Oct-27) I was the guy who posted about volume change in DirectMusic, but I found an easier way to do it, its just that it is uneven. When I load everything up like this...
'Includes the ActiveMovie control reference
Option Explicit
Dim MediaControl as IMediaControl
Dim BasicAudio as IBasicAudio
Private Sub Form_Load()
Set MediaControl = new FilgraphManager
MediaControl.RenderFile <Whatever Midi file you want>
Set BasicAudio = MediaControl
End sub
Private Sub VScroll1_Change()
BasicAudio.Volume = ((100 - VScroll1.Value) / 100) * (-4000)
End Sub
...the midi volume increase more and more when the VScroll1.Value gets closer to 100. If you want to see this for yourself, open a new VB project (standard exe), and the ActiveMovie control reference, add a VScroll Bar (Min. as 100, Max at 0, Value at 0), and copy this code into the code section. Run the program, and show the full Volume Control. As the VB Bar goes up, the faster the Midi volume bar goes up. It looks like it using the ^ (power) function, but I have been having trouble pinpointing the number.
If anyone can help, please try this out and email me back. thx
DiscoStew |