DPF run() with only midi out help

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
User avatar
marbangens
Established Member
Posts: 56
Joined: Fri Nov 16, 2018 8:39 pm
Been thanked: 6 times

DPF run() with only midi out help

Post 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
nils
Established Member
Posts: 537
Joined: Wed Oct 22, 2008 9:05 pm
Has thanked: 35 times
Been thanked: 94 times
Contact:

Re: DPF run() with only midi out help

Post 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 
User avatar
marbangens
Established Member
Posts: 56
Joined: Fri Nov 16, 2018 8:39 pm
Been thanked: 6 times

Re: DPF run() with only midi out help

Post 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...
Post Reply