@Clyde: this library takes some time to update the volume changed, I don't know if there's a way to speed it up, anyway check out this example below, it changes the volume waiting 100 millisecs in steps of 0.01.
If you want steps of 0.2 use a timer of 1000 or 1500 and check what happens.
About reply #24, I dunno. Maybe you can make a dummy sequence using that note C-5 and see what value minifmod will return for you, just use the code below to do this job for you.
' ===========================================================================
' MiniFMOD replayer
' Copyright (c), Firelight Multimedia, 2000.
'
' Freebasic compatible library version by rbz - 24 Dec 2008
' Synch method/idea by Hellfire
' ===========================================================================
#include "windows.bi"
#include "minifmod170.bi"
'Include song
#include "Virgil_Turrican.bas"
Cls
Locate 1, 1
Print "-------------------------------------------------------------"
Print "MiniFMOD example XM player"
Print "Copyright (c) Firelight Multimedia, 2000"
Print ""
Print "Freebasic compatible library and wrapper by rbz - 24 Dec 2008"
Print "Synch method/idea by Hellfire"
Print "-------------------------------------------------------------"
'Initialise MiniFmod
'MiniFmod_Init(@MusicBuffer(0), size)
'@MusicBuffer(0) => pointer to (.xm) fastracker song buffer
'size => song buffer size
'Returns 0 if error and 1 if success
If MiniFmod_Init(@Music(0), 86030) = 0 Then
Print "Error upon initialization"
Sleep 5000
End 1
End If
'Start play
MiniFmod_Play()
Print "Playing song ..."
Print "Press a key to exit"
Dim as integer ord, row, channels, note, samp
Dim as single mytime
Dim as integer synchChannel
Dim as unsigned integer inst_note
synchChannel = 1
While Inkey$ = ""
'return current order
ord = MiniFmod_GetOrder()
'return current row
row = MiniFmod_GetRow()
'return elapsed time
mytime = MiniFmod_GetTime() / 1000
Locate 11, 1
Print "ord " & ord & " row " & row & " seconds " & mytime & " "
'return current module max. channels
channels = MiniFmod_GetChannels()
Locate 12, 1
Print "Module Channels: " & channels & " "
'Get channel to synch
'return sample/instrument at uinteger hi word and note on low word
'for desired channel passed to the function
inst_note = MiniFmod_GetSynch(synchChannel)
samp = inst_note shr 8 'hiword = sample/inst
note = inst_note and &hff 'loword = notes
Locate 13, 1
Print "Note: " & note & " "
Locate 14, 1
Print "Sample Num.: " & samp & " "
Sleep 1
Wend
'Volume fade test
dim vol as single
dim t as integer
vol = 1.0 'Full Volume
t = GetTickCount()
Print "Fade effect test..."
while vol>0.0
if(GetTickCount()> t+100) then
t=GetTickCount()
vol=vol-0.01
' the range for "vol" are:
' 1.0 for full volume and 0.0 no sound
MiniFmod_SetVolume(vol)
endif
Locate 16, 1
Print Using "Volume: #.##"; vol
wend
'Stop play
MiniFmod_Stop()
'Free music
MiniFmod_Free()
Print "Music Stopped"
Sleep 2000
End