Author Topic: BASS_SFX v2.4.2.1 for winamp, sonique, bassbox, & WMP visual plugin support!  (Read 181399 times)

RevG

  • Posts: 454
if in WinAmp plagin click full screen, and after click button Esc then Visualisation is output in a separate window. Win Xp x86, delphi 7.

Thank you, I see that I have mistake in my embedWindow function. I am working on fixes now :)

jeffdavis

  • Posts: 297
I tried using this plugin a while ago with very limited success.   I just downloaded the latest and I'm still seeing the same problems.

I use VB6 for BASS in a custom inhouse audio tool for testing our audio DSP code.  It would be nice to have visualizations for audio files in the same window we use when testing video clips.  

I originally wanted to use the WMP Plugins as documented in BASS_SFX_PluginCreate.  I can get Alchemy to work but any other CLSID GUID I try to use the app crashes and then even Alchemy doesn't work.  Sometimes the GUID just doesn't do anything.  I thought it would be easier to just use what people probably already have installed instead of having to distribute some of the plugins that you include in your zip.  I can't add visualizations to our app at the expense of making it unstable.    

Should I stick with the DLL's for plugins or is there something I'm doing wrong with the WMP GUID's?  I am following the VB6 example as far as code goes.

I have tried the BBplugin's and they all seem to work fine.  The .svp plugins also seem to work fairly well but I have had them crash too sometimes.

Code: [Select]
Dim hSFX As Long

Private Sub Form_Load()

If BASS_Init(-1, 44100, 0, Me.hWnd, 0) Then

BASS_SFX_Init App.hInstance, Me.hWnd

hSFX = BASS_SFX_PluginCreate("2657FD22-5A20-433d-A8DF-2326500E88A8", Picture1.hWnd, Picture1.ScaleWidth, Picture1.ScaleHeight, 0)

    hStream = BASS_StreamCreateFile(0, StrPtr(MyMusicFile), 0, 0, 0)
    If hStream Then
        BASS_ChannelPlay hStream, 0
        BASS_SFX_PluginStart hSFX
        Timer1.Interval = 27
        Timer1.Enabled = True
    End If
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
BASS_ChannelStop hStream
BASS_StreamFree hStream
BASS_SFX_Free
BASS_Free
End Sub

Private Sub Timer1_Timer()
   BASS_SFX_PluginRender hSFX, hStream, Picture1.hDC
End Sub
« Last Edit: 14 Feb '10 - 00:12 by jeffdavis »

jeffdavis

  • Posts: 297
No response?  Is this product being used?


soloDev

  • Posts: 2
Yup. shure is, i am using it very much in my project. Cant wait for new releases!  (VB6 code, that is!)

jeffdavis

  • Posts: 297
If you are using this with VB6 code what is the most common reason for it crashing VB?  I get errors often when running this.  Do you use the WMP plugins with GUID's?   Do you use the .svp's or the BBplugins?


soloDev

  • Posts: 2
I have problems with BB's rendering WAY to slow, so i just dont normally use them at all.  Sonique plugins, WMP and WinAmp vises do good for me!  I have made a small mode to the original code, but only for ease of calling.

here is all of my frmSFXTest code.  It may make a call to a module that I dont have here, if so, just remark that line.  I tried to clean it up here for you.

Code: [Select]
Dim hStream As Long
Public hSFX As Long
Dim hSFX2 As Long
Dim hSFX3 As Long
Dim OpenFile As String
Public CurrentVis As String
Sub InitVis()
hSFX = -1
hSFX2 = -1
hSFX3 = -1
hStream = 0

'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
BASS_SFX_Init App.hInstance, frmSFXTest.hwnd
'BASS_SFX_Init App.hInstance, Form1.hWnd
End Sub

Private Sub Form_Load()

InitVis
CheckFiles
Load frmOne
frmOne.Visible = False
'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
'BASS_SFX_Init App.hInstance, Me.hWnd
'hSFX = BASS_SFX_PluginCreate("plugins\Fractal.svp", Picture1.hWnd, Picture1.Width, Picture1.Height, 0)
'hSFX = BASS_SFX_PluginCreate("plugins\smear.svp", frmSFXTest.hWnd, frmSFXTest.Width, frmSFXTest.Height, 0)

'hSFX2 = BASS_SFX_PluginCreate("plugins\vis_avs.dll", Picture2.hWnd, Picture2.Width, Picture2.Height, 0)
'hSFX3 = BASS_SFX_PluginCreate("BBPlugin\oscillo", Picture3.hWnd, Picture3.Width, Picture3.Height, 0)



'    hStream = Form1.BasCStream
'    If hStream Then
'      '  BASS_ChannelPlay hStream, 0
'        BASS_SFX_PluginStart hSFX
'       ' BASS_SFX_PluginStart hSFX2
'       ' BASS_SFX_PluginStart hSFX3
'        Timer1.Interval = 27
'        Timer1.Enabled = True
'    End If
'End If


End Sub

Public Sub ReloadVis(VisName As String)

'BASS_SFX_PluginFree Picture1.hWnd
'BASS_SFX_PluginFree frmSFXTest.hWnd
'BASS_SFX_Free
If VisName = "" Then VisName = "plugins\Fractal.svp"
CurrentVis = VisName
DoEvents

hSFX = -1
hSFX2 = -1
hSFX3 = -1
hStream = 0

'If BASS_Init(-1, 44100, 0, Form1.hWnd, 0) Then
' BASS_SFX_Init App.hInstance, Me.hWnd
hSFX = BASS_SFX_PluginCreate(VisName, Picture1.hwnd, Picture1.Width, Picture1.Height, 0)
'hSFX2 = BASS_SFX_PluginCreate(VisName, Form1.box_spectr.hWnd, Form1.box_spectr.Width, Form1.box_spectr.Height, 0)

'hSFX = BASS_SFX_PluginCreate("plugins\smear.svp", frmSFXTest.hWnd, frmSFXTest.Width, frmSFXTest.Height, 0)

'hSFX2 = BASS_SFX_PluginCreate("plugins\vis_avs.dll", Picture2.hWnd, Picture2.Width, Picture2.Height, 0)
'hSFX3 = BASS_SFX_PluginCreate("BBPlugin\oscillo", Picture3.hWnd, Picture3.Width, Picture3.Height, 0)
'If InStr(1, VisName, ".dll") Then
'hSFX2 = BASS_SFX_PluginModuleSetActive(Picture1.hWnd, VisName)
'
'   hSFX3 = BASS_SFX_PluginSetStream(Picture1.hWnd, VisName)
'End If
    hStream = Form1.BasCStream
    If hStream Then
      '  BASS_ChannelPlay hStream, 0
        BASS_SFX_PluginStart hSFX
'        BASS_SFX_PluginStart hSFX2
       ' BASS_SFX_PluginStart hSFX3
        Timer1.Interval = 27
        Timer1.Enabled = True
    End If
'End If

End Sub


Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then DragForm frmSFXTest
End Sub

Private Sub Form_Resize()
Picture1.Height = Me.ScaleHeight
Picture1.Width = Me.ScaleWidth
Dim retval As Long
retval = BASS_SFX_PluginResize(Picture1.hwnd, Picture1.Width, Picture1.Height)
ReloadVis CurrentVis
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Dim FormVal, CurrentVal As Integer
Dim D As Integer
D = frmSFXTest.Top

If frmSFXTest.Top <> Form1.Top Then GoTo Skipper
If frmSFXTest.Left + frmSFXTest.Width = Form1.Left Or Form1.Left + Form1.Width = frmSFXTest.Left Then
If Form1.Left + Form1.Width = frmSFXTest.Left Then ReturnMe frmSFXTest, Form1, True, "Right", 10
If frmSFXTest.Left + frmSFXTest.Width = Form1.Left Then ReturnMe frmSFXTest, Form1, True, "Left", 10

End If


Skipper:
Unload frmOne
BASS_SFX_PluginStop Picture1.hwnd
BASS_SFX_PluginFree Picture1.hwnd
Me.Visible = False
If sfxbg.Visible = True Then
Unload sfxbg
Set sfxbg = Nothing
End If
End Sub




Private Sub Picture1_DblClick()
frmSFXTest.Visible = False
'If frmSFXTest.Width <> Screen.Width Then
If frmSFXTest.WindowState = 0 Then

frmSFXTest.WindowState = 2
'frmSFXTest.Width = Screen.Width
'frmSFXTest.Height = Screen.Height
'frmSFXTest.Move 1, 1

'fullscreen
'FormOnBottom frmSFXTest
frmSFXTest.Visible = True
GoTo EOSub
Else
'windowed
frmSFXTest.WindowState = 0
End If

EOSub:
FormOnTop Form1
frmSFXTest.Visible = True
End Sub

Private Sub Timer1_Timer()
On Error Resume Next
If (hSFX <> -1) Then
If mnuFullVis.Checked = True Then
BASS_SFX_PluginRender hSFX, hStream, Picture1.hdc
Else
BASS_SFX_PluginRender hSFX, hStream, Form1.hdc
End If


End If
'If (hSFX2 <> -1) Then
'BASS_SFX_PluginRender hSFX2, hStream, Form1.box_spectr.hDC
'End If


End Sub

Sub CheckFiles()
    Dim dVis As String
    Dim xName As String, xLen As Integer
    If FileExists(App.Path & "\defaultvis.txt") = True Then
    Open App.Path & "\defaultvis.txt" For Input As #1
    Input #1, dVis
    Close #1
   
    'EdgeCrusher - Sonique = always fails for me.
    If InStr(1, dVis, "edgecrusher") Then Exit Sub
   
    If dVis = "" Then dVis = "plugins\Fractal.svp"
    frmSFXTest.ReloadVis dVis
   
   
    xLen = Len(App.Path & "\plugins\")
    xName = Mid(dVis, xLen + 1)
    frmSFXTest.Caption = "Visulizer - " & xName
     GoTo EOSub:
    End If

 
    If FileExists(App.Path & "\currentvis.txt") = True Then
    Open App.Path & "\currentvis.txt" For Input As #1
   
    Input #1, dVis
    Close #1
   
   
    If dVis = "" Then dVis = "plugins\Fractal.svp"
    frmSFXTest.ReloadVis dVis
   
    xLen = Len(App.Path & "\plugins\")
    xName = Mid(dVis, xLen + 1)
    frmSFXTest.Caption = "Visulizer - " & xName
   
    End If
 GoTo EOSub:
 
 
EOSub:
If dVis = "" Then dVis = "plugins\Fractal.svp"
frmSFXTest.ReloadVis dVis
End Sub
Private Function FileExists(FullFileName As String) As Boolean

    On Error GoTo MakeF
        'If file does Not exist, there will be an Error
        Open FullFileName For Input As #1
        Close #1
        'no error, file exists
        FileExists = True
    Exit Function
MakeF:
        'error, file does Not exist
        FileExists = False
    Exit Function
End Function



I actually Don't have it crash VB6, my Glass (Aero) code does that, not this.  This works just fine for me.  I have it set up so that you can call from ANY Form / Module a quick swap on the Vises.

just call frmsfxtest.ReloadVis (visname\path to new vis name here)

So just call frmsfxtest.reloadvis "c:\ProgramDir\SomeFolderName\Aorta.svp"

and it will change to Aorta ASAP.

jeffdavis

  • Posts: 297
I would like to get the Scope option from the Bars and Waves visualization working with BASS_SFX

I use the CSID from  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Objects\Effects\Bars\Properties

"48501FF0-F6A9-11D2-9435-00A0C92A2F2D"

Per the documentation

hSFX = BASS_SFX_PluginCreate("48501FF0-F6A9-11D2-9435-00A0C92A2F2D", Picture1.hWnd, Picture1.ScaleWidth, Picture1.ScaleHeight, 0)

but when I render this I get nothing in my window.  If I use a .DLL file it works but I'd really like to use the Windows Media Player visualization specifically the scope one.

Has anyone been able to get this to work?   I'm using VB6







A440hz

  • Posts: 6
Please see my request http://www.un4seen.com/forum/?topic=11299.msg78637#msg78637 for a center channel remover/extractor

Respectfully,
Joe

toob

  • Posts: 112
[previously posted to wrong area]

My app uses sonique plugins fine but when I use winamp visuals I can see the winamp editor and I can choose and load winamp plugins but they do not react to the music stream as the sonique ones do.

Any thoughts on what I'm missing, this is my code?

bass.net.dll   2.4.6.4
bass.dll   2.4.5.0
bass_sfx.dll   2.4.2.1

vs2005 VB

Code: [Select]
'declare
Public Stream As Integer = 0
Public BASS_UNICODE As Integer = -2147483648
Public hSFX As Integer = 0
Public hVisDC As IntPtr = IntPtr.Zero

'play some mp3
Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)
Bass.BASS_SetVolume(Me.CrystalTrackBar1.Value / 10)
Stream = Bass.BASS_StreamCreateFile(mp3, 0L, 0L, BASSFlag.BASS_UNICODE)
If Stream <> 0 Then Bass.BASS_ChannelPlay(Stream, True)


'winamp visual
BASS_SFX_PluginStop(hSFX)
hVisDC = GetDC(My.Forms.Effect.PictureBox1.Handle)
hSFX = BASS_SFX_PluginCreate("plugins\vis_avs.dll", My.Forms.Effect.PictureBox1.Handle, My.Forms.Effect.PictureBox1.Width, My.Forms.Effect.PictureBox1.Height, 0)
BASS_SFX_PluginStart(hSFX)
My.Forms.Form1.VisualTimer.Enabled = True


'timer
Private Sub VisualTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VisualTimer.Tick
        If hSFX <> -1 Then BASS_SFX_PluginRender(hSFX, Stream, hVisDC)
End Sub

Also I'm displaying the visual in a fully docked vb picturebox control within a windows form. For the sonique pugins I just maximise the form to go full screen. In the winamp interface it has it's own full screen option and when I return from full screen the winamp visual is no longer in the picturebox container but at zero pixels top and left of my screen.  I can still use the forms maximise and minimise which works fine. So I either need to find a way to remove the full screen option from the winamp interface or find a way to get the winamp visual to draw itself back in my container. What's is the solution to this?

Also does anyone know how to get the winamp interface to save its settings when you change them. (for example modify effect change time "cfg_fs_rnd_time") When it loads it reads my file "pluginswinamp.ini" and uses it's settings, but if I change them in the winamp interface the changes are not written back to the ini file?

thanks in advance
Mark

toob

  • Posts: 112
Unable to find an entry point BASS_SFX_PluginGetModuleName
« Reply #209 on: 22 Jun '10 - 15:56 »
bass_sfx 2.4.2.1


Public Declare Function BASS_SFX_PluginGetModuleName Lib "bass_sfx.dll" (ByVal handle As Integer, ByVal nModule As Integer) As String

When I run this while module is loaded & hSFX has a value:
MsgBox(BASS_SFX_PluginGetModuleName(hSFX, 0))

I get:
Unable to find an entry point named 'BASS_SFX_PluginGetModuleName' in DLL 'bass_sfx.dll'.

Bass_SFX help lists BASS_SFX_PluginGetModuleName as being a function

Am I going mad?
Is there any other method to get the current visualisation name?

thanks

toob

  • Posts: 112
This turned out to be an error in the bass_sfx.chm help file, would appear that:
BASS_SFX_PluginGetModuleName
is in fact
BASS_SFX_PluginModuleGetName

Anyway now I can get the name of a sonique plugin successfully, however the same code when a winamp visual is running returns nothing. Any ideas, here is my code:


Code: [Select]
        Dim n As Integer = 0
        Dim name As String = ""
        Dim xx As String = ""
        While Not (name Is Nothing)
            name = BASS_SFX_PluginModuleGetName(hSFX, n)
            n += 1
            If Not (name Is Nothing) Then
                xx = xx + name
            End If
        End While
        MsgBox(xx)

All I want to do is to be able to display the name of the winamp visual that is currently being displayed

Any advice please?

bass_sfx 2.4.2.1


Public Declare Function BASS_SFX_PluginGetModuleName Lib "bass_sfx.dll" (ByVal handle As Integer, ByVal nModule As Integer) As String

When I run this while module is loaded & hSFX has a value:
MsgBox(BASS_SFX_PluginGetModuleName(hSFX, 0))

I get:
Unable to find an entry point named 'BASS_SFX_PluginGetModuleName' in DLL 'bass_sfx.dll'.

Bass_SFX help lists BASS_SFX_PluginGetModuleName as being a function

Am I going mad?
Is there any other method to get the current visualisation name?

thanks


toob

  • Posts: 112
The message below was posted in February, I'm having the same problem when returning from the winamp plug-in full screen. The visual is drawn to x0 y0 and not in the original container, in my case a picturebox control. vs2005 VB

Is this still on the fix list? [please]

if in WinAmp plagin click full screen, and after click button Esc then Visualisation is output in a separate window. Win Xp x86, delphi 7.

Thank you, I see that I have mistake in my embedWindow function. I am working on fixes now :)

Tom Speirs

  • Guest
The plugin works very well. Apart from the issues with winamp plugins the only other issue I have found is that WMP plugins dont free from memory. You will quickly run out of memory after loading them several times.

Also PluginStop returns false for me.

Windows 7 x64.


Horatis

  • Posts: 6
I'm using VS.Net 2010 under Win7 x64. I can start my stream and my AVS from WinAmp. But after some time (about 10 mins) the Vis just freezes all visual parts of my prog. But music plays (I use an 1 hour megamix ;-) Can someone help? I did it like in the vs.net-Example from SFX
Here is my timer-Code:
If _stream = 0 Then
         If Not _Timer1 Is Nothing Then _Timer1.Enabled = False
         BASS_SFX_PluginStop(_handleVis)
         Exit Sub
      End If
      BASS_SFX_PluginRender(_handleVis, _stream, GetDC(Form1.pbVis.Handle))

And yes: I don't use Bass.Net.


Oops. Thing found out by trial and error. *g*: Winamp doesn't need the Render in the timer. Now it plays already longer then before... *g*
« Last Edit: 2 Sep '10 - 06:20 by Horatis »

PhilProip

  • Posts: 1

Hi All

I must be doing something wrong.
I cant get the Winamp Plugins to load. Both the BASS_SFX_PluginCreate & BASS_SFX_PluginCreateW functions return True but fail to load the plugin
Ive even entered an invalid plugin path but the function still returns true.




 

OldUser

  • Guest
Bass_SFX benutzt viele Quelltexte von anderen Anwendungen
Die unter Kopieren und Einfügen in die Bibliothek eingefügt wurden.
Winamp Plugins wurden noch nie richtig eingebaut.
Und 80% davon funktionieren nicht.

Bass_SFX used many sources from other applications
Were added in copy and paste into the library.
Winamp plug-ins were never really built.
And 80% do not work like this.

Horatis

  • Posts: 6
I currently only allow AVS to be used in my prog as Vis. Works perfectly. As mentioned. Don't render you vis in a timer when you use WinAmp.

Dermot

  • Posts: 12

Anybody got this working in Delphi 2010?

I'm just getting a blank black background on panel

The delphi sample seems out of date too not taking the PAnsiChar into consideration

Code: [Select]
procedure TForm1.FormCreate(Sender: TObject);
begin

  if BASS_Init(-1, 44100, 0, Handle, nil) then
  begin
    BASS_SFX_Init(HInstance, Handle);
    Stream:=BASS_StreamCreateFile(False, PAnsiChar('music\Matrix.mp3'), 0, 0, 0);
    BASS_ChannelPlay(Stream, False);

    hVisDC1 := GetDC(Panel1.Handle);


    hSFX1:=BASS_SFX_PluginCreate(PChar('plugins\sphere.svp') , Panel1.Handle, Panel1.Width, Panel1.Height, 0); //sonique

    BASS_SFX_PluginStart(hSFX1);

  end;
end;

I added the PChar and PAnsiChar, but still isn't working, no errors.

Matrix stream started successfully after adding the PAnsiChar, so its playing.

But no visualisation is shown.

Or am i missing something?

Ionut Cristea

  • Posts: 1533
  Maybe you could convert the plugin filename from Unicode to Multibyte.

lamos

  • Guest
BASS_SFX v2.4.2.1 and Delphi 2010
« Reply #219 on: 25 Sep '10 - 10:53 »
There were problems.
I can not load a plug-in
Code: [Select]
...
  if not BASS_SFX_Init(HInstance, Handle) then
    ShowMessage('Error init visual');
...
  VisDC := GetDC(Panel1.Handle);
  SFX:=BASS_SFX_PluginCreate('sphere.svp', Panel1.Handle, Panel1.Width, Panel1.Height, 0); //sonique
  BASS_SFX_PluginStart(SFX);
...
procedure Tsoul.Timer1Timer(Sender: TObject);
begin
  if (SFX <> -1) then BASS_SFX_PluginRender(SFX, Channel, VisDC);
end;

In what a problem prompt.

P.S. Embarcadero Delphi 2010

lamos

  • Guest
Re: BASS_SFX v2.4.2.1 and Delphi 2010
« Reply #220 on: 25 Sep '10 - 11:10 »
Use
 
SFX:=BASS_SFX_PluginCreateW('sphere.svp', Panel1.Handle, Panel1.Width, Panel1.Height, 0); //sonique

:)

tomspeirs

  • Guest
The plugin works very well. Apart from the issues with winamp plugins the only other issue I have found is that WMP plugins dont free from memory. You will quickly run out of memory after loading them several times.

Also PluginStop returns false for me.

Windows 7 x64.



Just wanted to add there are some issues with freeing plugins and freeing the library that were not present in older versions. Also the binary posted in the first post seems to be a debug build. BASS_SFX will stop working and potentially crash applications when being freed and reinitialised along with the memory leak mentioned above. Ive reverted to an older version because of the the bugs but thanks again for the plugin and I hope you continue to work on it.

Thanks.
Tom.

detlion1643

  • Posts: 1
I was using Bass_SFX for a couple months, took a month off from programming and come back to my code not working anymore. This used to work, and I have made no changes to my computer setup. I am using winamp milkdrop2 visuals on a picturebox.

Code: [Select]
Public Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Int32) As IntPtr

hSFX4 = BASS_SFX_PluginCreate("vis_milk2.dll", Form1.PictureBox15.Handle, Form1.PictureBox15.Width, Form1.PictureBox15.Height, 0)
            BASS_SFX_PluginSetStream(hSFX4, currentplayingsong)
            BASS_SFX_PluginStart(hSFX4)
            BASS_SFX_PluginResize(Form1.PictureBox15.Handle, Form1.PictureBox15.Width, Form1.PictureBox15.Height)

I now receive an Error compiling ps_2_0 warp shader on the plugincreate line, but milkdrop2 will still work 100% through winamp.

ephracis

  • Posts: 28
Hi,

I am trying to get this to work in C#. I fired up your example but it gave me DllNotFoundException. I have copied BASS_SFX.dll into the bin/Debug folder but no luck.

What do I need to do in order to get the C# example running?

radio42

  • Posts: 4383
Is the SFX plugin dll you are using also in your folder - and what about bass.dll?
Normally the DllNotFoundException tells you exactly what dll could not be found.