(C++) transport handler?
-
I have a habit of asking questions which are not entirely within the natural scope of hise, and so I won't be offended if I don't get any replies
It may only be answerable by @Christoph-Hart (sorry Christoph).So, I'm well into my journey of creating c++ 3rd party nodes, and I've reached another hurdle: I want to access the global transport (daw clock and play head position) within a c++ node. This is for a tempo synced LFO.
I know that I could take the clock ramp node, and pass the modulation output to a parameter on my external node... That way the node can read the time whenever it needs to use it, but surely it's unnecessary to have the data go through all these extra steps? (Assuming that this has performance impact, to be honest I was planning on running on an internal counter for playback rate, and using updates from the real global transport (daw) only at certain increments such as every bar, to check alignment.
I'm thinking the two ideal options for me would be to either 'include' a tempo synced node inside my c++ node and then take the data directly (Christoph has mentioned this technique multiple times but I've yet to manage it, I'm quite new to c++).
The second option would be to directly grab data from an existing audio processor instance being used by hise?Perhaps the real answer is that I need to learn c++ and juce properly...
-
@griffinboy I'm wondering if there's a point at which it makes to interact directly with the JUCE API?
-
The tempo management is done on the HISE level so there's not much to interact on the JUCE API with for this.
Take a look at this base class:
You need to subclass from this, then override
tempoChanged()
(see a few lines below for the implementation of the tempo syncer. Basic C++ knowledge about polymorphism comes in handy, but getting this to work should lie within your skillset, so go for it :) -
As always, thanks for the response: )