diff options
Diffstat (limited to 'src/server/internals/Note.cpp')
-rw-r--r-- | src/server/internals/Note.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index e2ead4b7..7558334e 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -60,6 +60,8 @@ NoteNode::NoteNode(InternalPlugin* plugin, const Ingen::URIs& uris = bufs.uris(); _ports = new Raul::Array<PortImpl*>(6); + const Atom zero = bufs.forge().make(0.0f); + _midi_in_port = new InputPort(bufs, this, Raul::Symbol("input"), 0, 1, PortType::ATOM, uris.atom_Sequence, Atom()); _midi_in_port->set_property(uris.lv2_name, bufs.forge().alloc("Input")); @@ -68,35 +70,41 @@ NoteNode::NoteNode(InternalPlugin* plugin, _ports->at(0) = _midi_in_port; _freq_port = new OutputPort(bufs, this, Raul::Symbol("frequency"), 1, _polyphony, - PortType::CV, 0, bufs.forge().make(440.0f)); + PortType::ATOM, uris.atom_Sequence, + bufs.forge().make(440.0f)); + _freq_port->set_property(uris.atom_supports, bufs.uris().atom_Float); _freq_port->set_property(uris.lv2_name, bufs.forge().alloc("Frequency")); _freq_port->set_property(uris.lv2_minimum, bufs.forge().make(16.0f)); _freq_port->set_property(uris.lv2_maximum, bufs.forge().make(25088.0f)); _ports->at(1) = _freq_port; _num_port = new OutputPort(bufs, this, Raul::Symbol("number"), 1, _polyphony, - PortType::CV, 0, bufs.forge().make(0.0f)); - _num_port->set_property(uris.lv2_minimum, bufs.forge().make(0.0f)); + PortType::ATOM, uris.atom_Sequence, zero); + _num_port->set_property(uris.atom_supports, bufs.uris().atom_Float); + _num_port->set_property(uris.lv2_minimum, zero); _num_port->set_property(uris.lv2_maximum, bufs.forge().make(127.0f)); _num_port->set_property(uris.lv2_portProperty, uris.lv2_integer); _num_port->set_property(uris.lv2_name, bufs.forge().alloc("Number")); _ports->at(2) = _num_port; _vel_port = new OutputPort(bufs, this, Raul::Symbol("velocity"), 2, _polyphony, - PortType::CV, 0, bufs.forge().make(0.0f)); - _vel_port->set_property(uris.lv2_minimum, bufs.forge().make(0.0f)); + PortType::ATOM, uris.atom_Sequence, zero); + _vel_port->set_property(uris.atom_supports, bufs.uris().atom_Float); + _vel_port->set_property(uris.lv2_minimum, zero); _vel_port->set_property(uris.lv2_maximum, bufs.forge().make(1.0f)); _vel_port->set_property(uris.lv2_name, bufs.forge().alloc("Velocity")); _ports->at(3) = _vel_port; _gate_port = new OutputPort(bufs, this, Raul::Symbol("gate"), 3, _polyphony, - PortType::CV, 0, bufs.forge().make(0.0f)); + PortType::ATOM, uris.atom_Sequence, zero); + _gate_port->set_property(uris.atom_supports, bufs.uris().atom_Float); _gate_port->set_property(uris.lv2_portProperty, uris.lv2_toggled); _gate_port->set_property(uris.lv2_name, bufs.forge().alloc("Gate")); _ports->at(4) = _gate_port; _trig_port = new OutputPort(bufs, this, Raul::Symbol("trigger"), 4, _polyphony, - PortType::CV, 0, bufs.forge().make(0.0f)); + PortType::ATOM, uris.atom_Sequence, zero); + _trig_port->set_property(uris.atom_supports, bufs.uris().atom_Float); _trig_port->set_property(uris.lv2_portProperty, uris.lv2_toggled); _trig_port->set_property(uris.lv2_name, bufs.forge().alloc("Trigger")); _ports->at(5) = _trig_port; @@ -141,10 +149,8 @@ NoteNode::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly) } void -NoteNode::process(ProcessContext& context) +NoteNode::run(ProcessContext& context) { - BlockImpl::pre_process(context); - Buffer* const midi_in = _midi_in_port->buffer(0).get(); LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)midi_in->atom(); LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { @@ -182,8 +188,6 @@ NoteNode::process(ProcessContext& context) } } } - - BlockImpl::post_process(context); } static inline float |