PlayHead problems with loaded VST instance


#1

I don’t know if I’m doing something wrong, but here’s my problem. I created a AudioProcessorGraph and I add a VST to a node. Everything works. But the graph does not get the playHead from my main AudioProcessor. So I just do this:

VstInstance->setPlayHead(getPlayHead());

Which fixes the problem. But, for every new VST I add to the Graph, I need to do this. I also tried doing it for the graph hoping it would make all new VST Instances to get it too, but it doesn’t.

Shouldn’t everything that gets added to the graph follow the “child” PlayHead too?

Wk


#2

No, you might have different things following different playheads. E.g. if you were using a graph to mix two files that are playing independently.


#3

Oh, makes perfect sense. :oops: How dare me questioning the leader… :mrgreen: :wink: (just joking)

Thanks Jules, as always.

Wk


#4

Sorry for waking up this old thread, but I was just looking at the docs, and AudioProcessor::setPlayHead is marked as “not for public use” .
Is it because it’s not supposed to be necessary ? Or is it because it’s dangerous to use in our own code ? Looking at the code, it seems perfectly ok to use it …

If we want to do that, we must make the AudioSources holding the file inherit from AudioProcessor, otherwise, you can’t put them into a graph, right ?


#5

I think that comment might be out-of-date - originally, it was used internally by the plugin subclasses, but if people are writing their own subclasses, they’d need to call it.

Yep.


#6

Thanks and thanks :wink:


#7

Oh by the way, I couldn’t find any class which wraps an AudioSource, and inherits from AudioProcessor. Should I write it, or is there already such a class and I didn’t see it ?


#8

No, don’t think I ever did one of those.


#9

I posted one a ways back…don’t know if it still works(or if I updated mine), but it’ll give you a start… it’s really simple, but it’ll save you some typing!

http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=3505&start=0&hilit=audioprocessor+speed


#10

Great, thanks for the inspiration :slight_smile:


#11