eq

  • ja sowas meine ich nun kann ich mit speedpascal nur nicht viel anfangen
    kan mir das jemand in Autoit übersetzten?
    (P.s. Die bass funktionen verwende ich schon)

  • ja sowas meine ich nun kann ich mit speedpascal nur nicht viel anfangen
    kan mir das jemand in Autoit übersetzten?

    grundsätzlich möglich isses in autoit sicherlich. aber es wäre ein ziemlich großes und komplexes projekt.
    das wäre mit flash oder so schon schöner zu lösen.

    PS: ne lizenz findeste doch sicher irgendwo oder? also für AAE

  • das ich die schon verpulvert habe
    in der schule ham wirs zwar da habe ich aber immoment keine zeit

  • Hii, ich habe sowas doch tatsächlich gefunden... nur leider weiß ich nichtmehr wo ich das her habe (irgendwo von autoitscript.com )

    Have fun

    p.s. Dort wird das über die Bass.dll und bassflac.dll umgesetzt (beide enthalten)

  • Ich hatte mal vor langer Zeit ein Visualizer gebastelt, allerding nur für die 2 Kanäle (links/rechts)!

    Schau' mal rein, vielleicht kannst du das noch erweitern!

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    #AutoIt3Wrapper_Run_After=del /f /q "Visualizer_Obfuscated.au3"

    [/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstantsEx.au3>
    #include <GDIplus.au3>
    #include <WindowsConstants.au3>
    #include "Bass.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $bass_dll = _BASS_STARTUP(@ScriptDir & "\BASS.dll")
    Global Const $width = 200
    Global Const $height = 230
    Global $title = "GDI+ Visualization by UEZ"
    $file = FileOpenDialog("Open...", "", "MP3 Files (*.mp3)");
    If @error Then
    MsgBox(0, "Error", "Could not load audio file" & @CR & "Error = " & @error)
    Exit
    EndIf
    _BASS_Init($BASS_DEVICE_CPSPEAKERS)
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, Default, $WS_EX_TOOLWINDOW)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsClear($backbuffer)
    $pen1_size = 4
    $pen1 = _GDIPlus_PenCreate(0, $pen1_size)
    $pen2_size = 4
    $pen2 = _GDIPlus_PenCreate(0, $pen2_size)

    [/autoit] [autoit][/autoit] [autoit]

    $c = 1
    $equalizer_width = 30
    $max_l = 0
    $max_r = 0
    $fall_speed = 5
    $fire_up = 15
    Do
    $levels = _BASS_ChannelGetLevel($MusicHandle)
    $LeftChLvl = Round(_HiWord($levels) / $height * 1.5, 0)
    $RightChLvl = Round(_LoWord($levels) / $height * 1.5, 0)

    [/autoit] [autoit][/autoit] [autoit]

    If $max_l <= $LeftChLvl Then ;fire up higest line
    $max_l = $LeftChLvl + $fire_up
    $fall_speed_l_threshold = 20
    Else
    If $fall_speed_l_threshold <= 0 Then ;increase fall speed of highest line faster until threshold is <= 0 (second fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed
    Else
    $fall_speed_l_threshold -= 1 ;increase fall speed of highest line by slower until threshold is <= 0 (first fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed / 3
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $max_r <= $RightChLvl Then
    $max_r = $RightChLvl + $fire_up
    $fall_speed_r_threshold = 20
    Else
    If $fall_speed_r_threshold <= 0 Then
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed
    Else
    $fall_speed_r_threshold -= 1
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed / 3
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsClear($backbuffer, 0x9F000000)
    _GDIPlus_PenSetColor($pen2, 0xFF7F7F7F)
    For $l = -$pen1_size - 2 To $leftChLvl Step $pen1_size * 2
    $r = $l / ($height) * 256
    $g = 256 - $r
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $l, $width / 5 + $equalizer_width, $height - $l, $pen1)
    Next
    For $l = 0 To $RightChLvl
    $r = (-(Cos(1.7 * $l / 2^7) + 1) / 2) * 256
    $g = ((Cos(4 * $l / 2^8) + 1) / 2) * 256
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $l, 3 * $width / 5 + $equalizer_width, $height - $l, $pen1)
    Next
    _GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $max_l, $width / 5 + $equalizer_width, $height - $max_l, $pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $max_r, 3 * $width / 5 + $equalizer_width, $height - $max_r, $pen2)
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    $c += 1
    Sleep(15)
    Until False

    [/autoit] [autoit][/autoit] [autoit]

    Func close()
    _BASS_Stop()
    _BASS_Free()
    DllClose(@ScriptDir & "\BASS.dll")
    _GDIPlus_PenDispose($pen1)
    _GDIPlus_PenDispose($pen2)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>close

    [/autoit]

    Im Anhang sind die benötigten Dateien!

    Gruß,
    UEZ

  • gut soweit sogut weiß getzt jemand wie man die balken auf frquenzen trimmt?

    ich hab ne kleine änderung vorgenommen

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%"
    #AutoIt3Wrapper_Run_After=del /f /q "Visualizer_Obfuscated.au3"

    [/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstantsEx.au3>
    #include <GDIplus.au3>
    #include <WindowsConstants.au3>
    #include "Bass.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $bass_dll = _BASS_STARTUP(@ScriptDir & "\BASS.dll")
    Global Const $width = 200
    Global Const $height = 230
    Global $title = "GDI+ Visualization by UEZ"
    $file = FileOpenDialog("Open...", "", "MP3 Files (*.mp3)");
    If @error Then
    MsgBox(0, "Error", "Could not load audio file" & @CR & "Error = " & @error)
    Exit
    EndIf
    _BASS_Init($BASS_DEVICE_CPSPEAKERS)
    $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0)
    _BASS_ChannelPlay($MusicHandle, 1)

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)
    $hwnd = GUICreate($title, $width, $height, -1, -1, Default, $WS_EX_TOOLWINDOW)
    GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
    _GDIPlus_GraphicsClear($backbuffer)
    $pen1_size = 4
    $pen1 = _GDIPlus_PenCreate(0, $pen1_size)
    $pen2_size = 4
    $pen2 = _GDIPlus_PenCreate(0, $pen2_size)

    [/autoit] [autoit][/autoit] [autoit]

    $c = 1
    $equalizer_width = 30
    $max_l = 0
    $max_r = 0
    $fall_speed = 5
    $fire_up = 15
    Do
    $levels = _BASS_ChannelGetLevel($MusicHandle)
    $LeftChLvl = Round(_HiWord($levels) / $height * 1.5, 0)
    $RightChLvl = Round(_LoWord($levels) / $height * 1.5, 0)

    [/autoit] [autoit][/autoit] [autoit]

    If $max_l <= $LeftChLvl Then ;fire up higest line
    $max_l = $LeftChLvl + $fire_up
    $fall_speed_l_threshold = 20
    Else
    If $fall_speed_l_threshold <= 0 Then ;increase fall speed of highest line faster until threshold is <= 0 (second fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed
    Else
    $fall_speed_l_threshold -= 1 ;increase fall speed of highest line by slower until threshold is <= 0 (first fall part)
    If $max_l > $LeftChLvl + $pen2_size * 2 Then $max_l -= $fall_speed / 3
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $max_r <= $RightChLvl Then
    $max_r = $RightChLvl + $fire_up
    $fall_speed_r_threshold = 20
    Else
    If $fall_speed_r_threshold <= 0 Then
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed
    Else
    $fall_speed_r_threshold -= 1
    If $max_r > $RightChLvl + $pen2_size * 2 Then $max_r -= $fall_speed / 3
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsClear($backbuffer, 0x9F000000)
    _GDIPlus_PenSetColor($pen2, 0xFF7F7F7F)
    For $l = -$pen1_size - 2 To $leftChLvl Step $pen1_size * 2
    $r = $l / ($height) * 256
    $g = 256 - $r
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $l, $width / 5 + $equalizer_width, $height - $l, $pen1)
    Next
    For $l = -$pen1_size - 2 To $RightChLvl Step $pen1_size * 2
    $r = (-(Cos(1.7 * $l / 2^7) + 1) / 2) * 256
    $g = ((Cos(4 * $l / 2^8) + 1) / 2) * 256
    $b = 0
    _GDIPlus_PenSetColor($pen1, "0xEF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2))
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $l, 3 * $width / 5 + $equalizer_width, $height - $l, $pen1)
    Next
    _GDIPlus_GraphicsDrawLine($backbuffer, $width / 5, $height - $max_l, $width / 5 + $equalizer_width, $height - $max_l, $pen2)
    _GDIPlus_GraphicsDrawLine($backbuffer, 3 * $width / 5, $height - $max_r, 3 * $width / 5 + $equalizer_width, $height - $max_r, $pen2)
    _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height)
    $c += 1
    Sleep(15)
    Until False

    [/autoit] [autoit][/autoit] [autoit]

    Func close()
    _BASS_Stop()
    _BASS_Free()
    DllClose(@ScriptDir & "\BASS.dll")
    _GDIPlus_PenDispose($pen1)
    _GDIPlus_PenDispose($pen2)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_GraphicsDispose($graphics)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>close

    [/autoit]