Question about BASS_VST_ProcessEvent

Started by Phil75,

Phil75

Hello  :)

I would like to trigger the notes of a VSTi plugin with my digital piano.
I use "BASS.net", "Bass.AddOn.Vst", "Bass.AddOn.Midi" and "radio42.Multimedia.Midi".

Everything works fine with this code:

Private Sub DeviceMidiIn_MessageReceived(sender As Object, e As MidiMessageEventArgs)

        If e.IsSysExMessage = False Then
            If e.ShortMessage.MessageType <> MIDIMessageType.SystemRealtime Then
                If e.IsShortMessage = True Then
                    BassVst.BASS_VST_ProcessEvent(hVSTi, CanalSelMIDI, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(e.ShortMessage.Data1, e.ShortMessage.Data2))
                End If
            End If
        End If

I think we should be able to make it simpler. But I don't know how to do it.

Only notes are transferred, not "Control Changes". I don't know how to do this.

Phil75

I used :

BassVst.BASS_VST_ProcessEventRaw(hVSTi, e.ShortMessage)
and everything seems to work  :)

Phil75

Hello  :)

So actually, not everything is working properly.

All VSTi plugins work except one (DecentSampler, 64bits).
Compile in 64-bit.

        Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)
        BassAsio.BASS_ASIO_Init(0, BASSASIOInit.BASS_ASIO_THREAD)

        hVSTi = Un4seen.Bass.AddOn.Vst.BassVst.BASS_VST_ChannelCreate(44100, 2, "C:\Program Files\VSTPlugins\DecentSampler.dll", BASSFlag.BASS_STREAM_DECODE)
        If hVSTi <> 0 Then
            BassVst.BASS_VST_EmbedEditor(hVSTi, Me.Handle)
            ObjASIOout = New BassAsioHandler(ASIODeviceSel, 0, hVSTi)
            Dim b As Boolean = BassAsio.BASS_ASIO_Start(0)
            Bass.BASS_ErrorGetCode()
        End If

b = True
Bass.BASS_ErrorGetCode() return BASS_OK

I can display the interface, load a Preset, but no sound comes out.
The Plugin works very well with other "VST Hosts".
I tried the plugin with the software "Soundfont Midi Player 6.4 64-bit" (Falcosoft),
it's the same as with my code. No sound comes out. But other VSTi plugins work.

Capture7.png

Sending MIDI messages over the MIDI-in port does not work. This code does not work either:

BassVst.BASS_VST_ProcessEvent(hVSTi, 0, BASSMIDIEvent.MIDI_EVENT_NOTE, Utils.MakeWord(60, 100))

Unless I use another VSTi.

Ian @ un4seen

I'm not sure if it'll help (I haven't tried that VSTi myself), but you could give this latest BASS_VST build a try:

    www.un4seen.com/stuff/bass_vst.zip

If possible, you could also try the 32-bit version of the VSTi, to see if the problem is something specific to the 64-bit version.

Falcosoft

Hi,
The problem with this plugin is that it defines 34 output channels.
Currently Bass_VST only supports maximum 32 channels.
It is actually just a define (MAX_CHANS 32) so it can be increased.
Unfortunately I could not find any official specification about the maximum allowed channel count in VST2 so maybe 64 could be the new MAX_CHANS.

Phil75

Thank you for your help

I did a test with the excellent software "VSThost" (Hermann Seib), indeed there are 34 outputs.
I even read that Kontakt 6 has 64 outputs.

Falcosoft

#6
Hi,

@Phil75:
I have made a new version of my fork that added support for plugins with 32+ input/output channels by replacing static buffer arrays with dynamic ones. So in theory the supported channels are not limited (even 64+ are possible) and it is even faster in most cases since non-used buffers do not have to be processed.
You can download and try it with my Soundfont Midi Player or even with your own software if it does not use such functions where my fork differs from the main one.

https://github.com/Falcosoft/BASS_VST/releases

@Ian:
The new commit is here if you would like to include something similar into main branch:

https://github.com/Falcosoft/BASS_VST/commit/ee7e28ec10c1c2781c07f055a3a18975b4510064

Phil75

@Falcosoft The new version seems to be working very well.
I'm very happy.
Thank you for your help  :)

Ian @ un4seen

Good to see that Falcosoft has already found the problem and posted a fix. The BASS_VST update I posted above removes the 32 channel limit too, so it sounds like it'd fix the problem too. Does it not?

Quote from: Falcosoft@Ian:
The new commit is here if you would like to include something similar into main branch:

https://github.com/Falcosoft/BASS_VST/commit/ee7e28ec10c1c2781c07f055a3a18975b4510064

Thanks. That is similar to what the update I posted does (ie. allocate buffersIn/Out dynamically), but not exactly the same. If you would like to compare, the update's source is available here:

    www.un4seen.com/stuff/bass_vst-src.zip

There are also some other changes that you may like to copy to your fork. A brief changelog is included in the bass_vst.h file.