Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
host BPM detection
No permission to create posts
April 16, 2015
3:04 am
Avatar
JD Young
Leiden, The Netherlands
Admin
Forum Posts: 80
Member Since:
November 5, 2014
sp_UserOfflineSmall Offline

Hi Will, how are you:)

I’m still busy building plug-ins with v6.5 and having a lot of fun! I gave the host BPM detection another shot today - for a delay plug-in with 'sync' functionality - and build an easy to use BPM detector class based on the midi beat clock messages (the ppqn’s). Unfortunately I can’t get it to work properly yet. To test my class I put a simple member variable m_Counter++ in midiClock() and called sendUpdateGUI() to a slider, but nothing happened. It did work when I put the code into processAudioFrame(), so I thought maybe RAFX doesn’t generate midi beat clock messages. But in (an older version) of cubase it didn’t work either. (to be sure I set m_bWantAllMIDIMessages to true as well)

I’m not sure what I’m doing wrong, but I figured my assumption that midiClock() simply gets called every PPQN might be wrong. Tips and tricks are more than welcome ;) (It might be a handy class to share on the forum as well, if I get it to work…)

All the best,

JD

April 17, 2015
4:56 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Hi JD

RackAFX does not generate any MIDI messages - it only receives them, and then forwards them to the plugin. To test this functionality, you would need to use the DLL as a VST2/3 (directly) or port to VST2/3/AU in order to get MIDI clock messages from the host. Or, you could attach a sequencer's output to a MIDI input and feed that to RAFX. I will do some experimenting to see how difficult that would be (might require a MIDI Yoke type of internal routing).

However, that is an interesting idea to have RAFX generate MIDI clocking information with a BPM setting. I will investigate this further. I am planning a big update for the end of May timeframe.

- Will

April 18, 2015
4:43 pm
Avatar
Tom
Admin
Forum Posts: 65
Member Since:
April 3, 2014
sp_UserOfflineSmall Offline

JD Young said

Hi Will, how are you:)

I’m still busy building plug-ins with v6.5 and having a lot of fun! I gave the host BPM detection another shot today - for a delay plug-in with 'sync' functionality - and build an easy to use BPM detector class based on the midi beat clock messages (the ppqn’s). Unfortunately I can’t get it to work properly yet. To test my class I put a simple member variable m_Counter++ in midiClock() and called sendUpdateGUI() to a slider, but nothing happened. It did work when I put the code into processAudioFrame(), so I thought maybe RAFX doesn’t generate midi beat clock messages. But in (an older version) of cubase it didn’t work either. (to be sure I set m_bWantAllMIDIMessages to true as well)

I’m not sure what I’m doing wrong, but I figured my assumption that midiClock() simply gets called every PPQN might be wrong. Tips and tricks are more than welcome ;) (It might be a handy class to share on the forum as well, if I get it to work…)

All the best,

JD

Hi JD,

what are you trying to do exactly? Is it just a tempo-synced effect like a delay? Then it might be easier to get the BPM and time signature information that the host provides then tracking midi events IMO. Or are you trying something fancy Cool that requires you to track the midi clock ?

Regards,
Tom

April 18, 2015
7:12 pm
Avatar
JD Young
Leiden, The Netherlands
Admin
Forum Posts: 80
Member Since:
November 5, 2014
sp_UserOfflineSmall Offline

Hi Tom,

Yes, it's just about getting the BPM, for tempo-syncing a delay! Nothing fancy at all. But I don't know how to get the BPM an time signature directly... Can you explain this to me?

Thanks! JD

April 18, 2015
10:00 pm
Avatar
Tom
Admin
Forum Posts: 65
Member Since:
April 3, 2014
sp_UserOfflineSmall Offline

Hi JD,

you'll have to dive a bit into the native VST2 / VST3 parts. From the RackAFX-only plugin I think it is not yet possible to get the required information from the host.

@Will: I guess something like the VST2 VstTimeInfo or VST3 ProcessContextor structures containing the "musical" context might be a nice addition to RackAFX?

In VST2 you have to query the tempo from the host, in VST3 you already get this info within the ProcessData structure that contains the audio buffer etc. I don't know how much experience you have with C++ programming and with the VST APIs? You can add a parameter to your plugin in RackAFX which will take the BPM value. This way you can just set it in RackAFX but push the "real" BPM from the host once you have exported to a "native" VST plugin.

With the RackAfx exports you can query the BPM value in the VSTProcessor.cpp (for RackAFX-VST3 export) or ...Export.cpp (RackAfx VST2 export), normalize it (i.e. to the same range you set in the RackAFX control) and set it as a parameter before the audio buffer will be processed:
m_pRAFXPlugIn->setParameter(kWhateverId, floatValueBetween0And1);

Not tried yet, but it should work.

If you need help, let me know!

April 18, 2015
10:24 pm
Avatar
JD Young
Leiden, The Netherlands
Admin
Forum Posts: 80
Member Since:
November 5, 2014
sp_UserOfflineSmall Offline

Thanks so much for your reply, Tom! This certainly puts the last few pieces of the puzzle in its place for me…

I think if I research the VST SDK a bit more I’ll manage! Similar functionality in RackAFX would be great of course, but I can understand it’s a lot of work getting it to port correctly to VST and AU; for just one simple feature. But (@Will) this would be more interesting to me personally than generating midi beat clock messages within RackAFX.

Thanks guys. Back to work! :)

JD

April 19, 2015
12:23 am
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Good ideas, guys.

I will look into something like this for the next release around the end of May.

- Will

January 11, 2016
5:13 am
Avatar
Derek
Member
Members
Forum Posts: 41
Member Since:
November 19, 2015
sp_UserOfflineSmall Offline

Was this ever addressed in RackAFX? JD did you get it working?

Derek

January 27, 2016
2:59 pm
Avatar
JD Young
Leiden, The Netherlands
Admin
Forum Posts: 80
Member Since:
November 5, 2014
sp_UserOfflineSmall Offline

Hi Derek,

As far as I know, this feature is not yet implemented. Would be nice though! But I think if you convert your RAFX project to a VST project, you can get the tempo information from either VST2 VstTimeInfo or VST3 ProcessContextor (like Tom suggested earlier). But this might a bit of a hassle, because you probably would have to test your plug-in directly in a sequencer to check if your code works properly.

Cheers! JD

January 27, 2016
8:02 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

This is still not implemented in RackAFX. The main reason is that RAFX is not a sequencer. When you hit the Play button to stream audio, there is no synchronized MIDI clock. When you load a Synth plugin, it also simply freewheels and does not attempt to sync to an external clock. RAFX does not load MIDI files, nor does it generate MIDI clock info.

Most importantly, one of the fundamental reasons I added the VST and AU porting was to allow you, the programmer, to implement added functionality found in the VST3 and AU APIs that does not exist in RackAFX, or the RAFX-as-VST2/3 paradigm, because these features are outside the scope of the RackAFX product and it is not an option for me to spend 100% of my time working on a free, non-licensed product in order to save lazy programmers' time. This is also why I created the Advanced GUI API to allow you to extend the functionality of the GUI portion of your product.

Therefore, you will need to study the relevant APIs and add the extra code for yourself to the ported projects. In this way, you can extend and customize your projects as needed. Yes, I know that "studying the relevant APIs" is certainly a turn-off or a "hassle" after you've had someone do so much work for you. But, that's just how it is.

- WP

March 7, 2016
1:15 am
Avatar
Derek
Member
Members
Forum Posts: 41
Member Since:
November 19, 2015
sp_UserOfflineSmall Offline

Hi,

For anyone still interested, this is how I got the BPM from the host (using Tom's advice from above)

Using "Make VST" from RackAFX.

In your RackAFX main class add a function to handle the incoming tempo. e.g.

void MyProject::UpdateTempo(float tempo);

Then inside VSTProcessor.cpp add the following line at the top of VSTProcessor::doControlUpdate (could add it to ::process instead if you like)

// call the update tempo function in the plugin
((MyProject *)m_pRAFXPlugIn)->UpdateTempo(data.processContext->tempo);

Of course you could save off the tempo and only call you update function if that value changes.

Your UpdateTempo function will be called as the change the BMP in you DAW host.

ProcessContext contains a bunch of stuff that is updated directly from the DAW so you might find other useful items in there.

April 2, 2016
1:33 am
Avatar
Frodson
Member
Members
Forum Posts: 38
Member Since:
September 7, 2015
sp_UserOfflineSmall Offline

Hi,
I'm trying to get the BPM in a VST2-wrapped VST3 Plugin. I can neither use data.processContext->tempo, since its VST3, nor VSTtimeInfo, since its VST2. I tried the VST-mailing list, but noone seems to know there either. So, anybody here who knows a way or can tell me whether this is possible at all?
Thanks Fred

April 2, 2016
2:45 am
Avatar
Derek
Member
Members
Forum Posts: 41
Member Since:
November 19, 2015
sp_UserOfflineSmall Offline

Frodson said

Hi,
I'm trying to get the BPM in a VST2-wrapped VST3 Plugin. I can neither use data.processContext->tempo, since its VST3, nor VSTtimeInfo, since its VST2. I tried the VST-mailing list, but noone seems to know there either. So, anybody here who knows a way or can tell me whether this is possible at all?
Thanks Fred

Hey Frodson,

Are you using the "Make VST" button to create your plugin or just building directly in RAFX?

In my post above yours, the ProcessContext will work for VST2 plugins using the VST3 wrapper.

April 2, 2016
5:21 pm
Avatar
Frodson
Member
Members
Forum Posts: 38
Member Since:
September 7, 2015
sp_UserOfflineSmall Offline

Hi coffeemate,
thanks for your answer! Yes, I'm using the makeVST option. I thought the VST2 couldn't possibly have that functionality, since it's part of the VST3 library. Happy to hear I was wrong! I'll give it a try later.
Thank you, Fred

April 4, 2016
7:42 pm
Avatar
Frodson
Member
Members
Forum Posts: 38
Member Since:
September 7, 2015
sp_UserOfflineSmall Offline

Hi,
It works now, it was actually working all the time, but the synth didn't update, because I didn't turn any knob after changing the tempo. Made an autoupdate for changed values now.
Thank you for your help,
Fred

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143