#SingleInstance Force SetWorkingDir, %A_ScriptDir% SetBatchLines -1 Process,Priority,, High ; Load Libraries fMod := DllCall("LoadLibrary", Str,"FMOD.DLL") RMC := DllCall("LoadLibrary", Str,"rmchart.dll") ; Set Variables AudioFile = %A_WorkingDir%\02 Grace.mp3 DataL = DataR = Loop, 10 { R := 0 L := 0 DataL .= (A_Index > 1 ? "*" : "") . L DataR .= (A_Index > 1 ? "*" : "") . R } ; Build GUI Gui, Color, Black Gui, +LastFound hwnd := WinExist() Gui, Show, w475 h425 ; Sound Analysis "Magicks" DllCall( "FMOD.DLL\_FSOUND_SetHWND@4", UInt,hWnd ) DllCall( "FMOD.DLL\_FSOUND_Init@12", UInt,44100, UInt,32, UInt,( FSOUND_INIT_GLOBALFOCUS := 0x2)) Flags := ( FSOUND_MPEGACCURATE := 0x20000 ) ; Create Chart AddChart( hwnd, BuildChart( DataL, DataR ), 1000 ) ; Open/Play Music fStream := DllCall("FMOD.DLL\_FSOUND_Stream_Open@16", Str,AudioFile, UInt,Flags, UInt,0, UInt,0 ) Channel := DllCall("FMOD.DLL\_FSOUND_Stream_Play@8", UInt,-1, UInt, fStream ) ; Update Graph Loop { ; Get Info From Playing Music ms := DllCall("FMOD.DLL\_FSOUND_Stream_GetTime@4", UInt,fStream ) DllCall( "FMOD.DLL\_FSOUND_GetCurrentLevels@12", UInt,Channel, FloatP,LCh, FloatP,RCh ) Tooltip,% "Ms:`t" ms "`nLt:`t" lCh "`nRt:`t" rCh, % A_ScreenWidth-125,% A_ScreenHeight-125 ; Update Data Arrays DataL := RegExReplace(DataL,"^[^\*]+\*","") . "*" . lCh DataR := RegExReplace(DataR,"^[^\*]+\*","") . "*" . rCh IfWinActive, ahk_id %hwnd% { ; Create New Chart AddChart( hwnd, BuildChart( DataL, DataR ), (A_Index/2 == A_Index//2 ? 1000 : 1001) ) ; Delete Old Chart If (A_Index > 1) DelChart( (A_Index/2 == A_Index//2 ? 1001 : 1000) ) } Sleep 1 ; If Song is done - break If !DllCall( "FMOD.DLL\_FSOUND_IsPlaying@4", UInt,Channel ) Break } ; Close Audio DllCall( "FMOD.DLL\_FSOUND_Stream_Stop@4", UInt,fStream ) DllCall( "FMOD.DLL\_FSOUND_Stream_Close@4", UInt,fStream ) Return GuiClose: ExitApp ; Get Data String BuildChart( DataL, DataR ) { Str = 00003400|00004300|000051|000061|00008-16777216|00009412|00011Tahoma|100011|100035|100045|10005-5|10006-5|1000910|100101|100111|100181|100200|100211|100222|100238|100331|100341|1003525|100378|100482|10051-16777216|10052-16777216|10053-16777216|100541|100558|10056-16777216|10057-16777216|100586|10063-1|100652|110011|1100221|1100421|110065|11019-65536|1102115|110221|1102325|110261|11053%DataL%|11055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|110562|110571,25|11058,|120011|1200221|1200421|120065|120131|12019-14774017|1202115|120221|1202325|120261|12053%DataR%|12055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|120563|120571,25|12058, ; Str = 00003400|00004300|000051|000061|00008-16777216|00009412|00011Tahoma|100011|100035|100045|10005-5|10006-5|1000910|100101|100111|100181|100200|100211|100222|100238|100331|100341|1003525|100378|100482|10051-16777216|10052-16777216|10053-16777216|100541|100558|10056-16777216|10057-16777216|100586|10063-1|100652|110011|1100221|1100421|110062|11019-65536|1102115|110221|1102325|110261|11053%DataL%|11055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|110562|110571,25|11058,|120011|1200221|1200421|120062|120131|12019-14774017|1202115|120221|1202325|120261|12053%DataR%|12055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|120563|120571,25|12058, ; Str = 00003400|00004300|000051|000061|00009412|00011Tahoma|100011|100035|100045|10005-5|10006-5|1000910|100101|100111|100181|100200|100211|100222|100238|100331|100341|1003525|100378|100482|10051-16777216|10052-16777216|10053-16777216|100541|100558|10056-16777216|10057-16777216|100586|10063-1|100652|110011|1100221|1100421|110061|11019-65536|1102115|110221|1102325|110261|11053%DataL%|11055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|110562|110571,25|11058,|120011|1200221|1200421|120061|120131|12019-14774017|1202115|120221|1202325|120261|12053%DataR%|12055C:\Documents and Settings\Administrator\Desktop\rmchart_dll\SOUND.csv|120563|120571,25|12058, Return Str } ; Delete Chart DelChart( ID ) { result := DllCall("rmchart.dll\RMC_DELETECHART" ,UInt,ID ) } ; Create New Chart ; engunneer ; http://www.autohotkey.com/forum/viewtopic.php?t=18292 AddChart( GuiID, DesignFile, ID ) { ChartModule := DllCall("LoadLibrary", "str", "rmchart.dll") result := DllCall("rmchart.dll\RMC_CREATECHARTFROMFILE" ,UInt,GuiID ,UInt,ID ,UInt,50 ,UInt,45 ,UInt,0 ,Str,DesignFile ) ; Draw the chart result := DllCall("rmchart.dll\RMC_DRAW" ,UInt,ID ) }