I used to think of every frame as a sample and then refer to the current sample rate.
I have a midi input that seems to be based on "events"? if I'm right
I need to keep track of the "stream of time" or some clock, not to be dependent on specific midi input events?
If I use frames from run() I need to have 2 loops? that seems bad
as an example if I wanted something to happen after 100ms
Edit: I think I figured it out, I could use some big variable like long long and keep adding the value from frames, if its available even tho I have no audio(I'm gonna try). then I could use every new value like an offset from when the plugin was activated. like a clock in frames. when It reaches the highest value its could go back. what do you think?
Second edit: the only problem I have now is understanding how could I delay this function.
Code: Select all
writeMidiEvent(const MidiEvent& midiEvent)
Sorry I'm still learning c++ also I'm not so good at this.