Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Proposal for even simpler midi sending API #45

Open
Boscop opened this issue Apr 28, 2018 · 0 comments
Open

Proposal for even simpler midi sending API #45

Boscop opened this issue Apr 28, 2018 · 0 comments
Assignees

Comments

@Boscop
Copy link
Member

Boscop commented Apr 28, 2018

Right now, sending midi events is already quite simple:
https://github.com/rust-dsp/rust-vst/blob/6dab92fbbf327837f468de9910414f9ea3e5fffc/examples/fwd_midi.rs#L20

But we are still requiring plugins to own a SendEventBuffer to be able to send midi events. This requires plugin authors to know about the SendEventBuffer and introduces more friction than what could be possible: The SendEventBuffer for each plugin could be an implementation detail, hidden from the plugin author, by storing it in the plugin cache, just like we do with the plugin's Info struct:
https://github.com/rust-dsp/rust-vst/blob/6dab92fbbf327837f468de9910414f9ea3e5fffc/src/cache.rs#L3-L4

And then sending midi events would be as simple as:

self.host.send_events(events);

with a method send_events() on HostCallback that uses AEffect::get_cache():
https://github.com/rust-dsp/rust-vst/blob/04258d15fa49e0aec5d38bcbe1839a635aeed7f4/src/api.rs#L163
It already has the AEffect pointer:
https://github.com/rust-dsp/rust-vst/blob/4b19b1772a7c8a375498dbbe7f58ebf42cf9da68/src/plugin.rs#L751-L754

What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants