Page 1 of 1

DPF run() with only midi out help

Posted: Fri Apr 10, 2020 8:02 pm
by marbangens
Hey everyone my name is Martin and I am learning how to program plugins (and also still learning c++)

I'm making a plugin that will generate random midi cc messages, values within a specific range (max 0-127),
and also with a randomness in time (if the user want, 20ms-2000ms).
I'm using DISTRHO Plugin Framework (DPF)
I have no input (midi or audio) and I don't know when the host will call run() I think I need a loop but on what frames should it be based on?
I want to control the time in some way. I have this function for midi output below, but I can't figure it out by myself :(

Code: Select all

bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
In DistrhoPluginInfo.h I have only

Code: Select all

#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 1
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1
I have an empty run function
and I need you help to get started :roll:
Thanks :D

Re: DPF run() with only midi out help

Posted: Fri Apr 10, 2020 8:11 pm
by nils
I am relaying this message from the DPF author falktx from the #lad IRC channel on freenode, who does not have a forum account here.

Code: Select all

needs to define that it wants midi input. with that defined, the run function changes to have midi events

slightly useful link https://distrho.github.io/DPF/classPlugin.html#a0a969c78f8455ac6ba65fa42e8c498f6

the idea is already there, just really needs that DISTRHO_PLUGIN_WANT_MIDI_INPUT 

another useful link https://distrho.github.io/DPF/group__PluginMacros.html 

Re: DPF run() with only midi out help

Posted: Fri Apr 10, 2020 8:48 pm
by marbangens
Okey, thanks. seems dirty, but I guess I could use midi input for something fun :D

edit: I realized I could use the midi input just like an "midi thru". :wink: not so dirty after all...