DPF midi time

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

Post Reply
User avatar
marbangens
Established Member
Posts: 27
Joined: Fri Nov 16, 2018 8:39 pm

DPF midi time

Post by marbangens »

Hello I'm wondering how would you keep track of time in dpf without audio in?
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)
In frames?
Sorry I'm still learning c++ also I'm not so good at this.
Last edited by marbangens on Wed Apr 15, 2020 9:41 pm, edited 1 time in total.

User avatar
SpotlightKid
Established Member
Posts: 177
Joined: Sun Jul 02, 2017 1:24 pm

Re: DPF midi time

Post by SpotlightKid »


User avatar
marbangens
Established Member
Posts: 27
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF midi time

Post by marbangens »

That seem to be about the time position during transport playback? That is not what I want

I could create new data typ from struct MidiEvent and edit data member frame. And then send that out. I'll try tomorrow.

ZzZz

User avatar
marbangens
Established Member
Posts: 27
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF midi time

Post by marbangens »

Okey, the host (Renoise) only calls run() when the plugin get midi in. But I want the plugin to be alive all the time and keep generating random numbers. How can I do that?

tramp
Established Member
Posts: 1717
Joined: Mon Jul 01, 2013 8:13 am

Re: DPF midi time

Post by tramp »

marbangens wrote:
Thu Apr 16, 2020 9:23 am
the host (Renoise) only calls run() when the plugin get midi in.
You may checkout if stepseq.lv2 run as expected in renoise. This one comes as well with only a midi out port as far I know, still, I haven't used it at all.
On the road again.

User avatar
marbangens
Established Member
Posts: 27
Joined: Fri Nov 16, 2018 8:39 pm

Re: DPF midi time

Post by marbangens »

thanks for the tip :D

you where right, it only runs continually if it gets loaded as an "Instrument" in Renoise. You can load midi utilities on a audio channel and then send it to an "Renoise Instrument" but then It requires some kind of input... Renoise is a strange host, but I love it :D

Edit: What is actually going an here is that Renoise have something called Auto suspend that prevents unnecessary cpu load

Post Reply