From d522d5b4ca4754be754d6b38637a169891b52372 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Wed, 16 Aug 2023 20:08:07 -0400 Subject: [PATCH] create new constructor for VmcExtMidiNote --- VmcMessages/VmcExtMidiNote.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/VmcMessages/VmcExtMidiNote.cs b/VmcMessages/VmcExtMidiNote.cs index a3a0ba0..2d8ec39 100644 --- a/VmcMessages/VmcExtMidiNote.cs +++ b/VmcMessages/VmcExtMidiNote.cs @@ -60,5 +60,18 @@ namespace godotVmcSharp note = (int)m.Data[2].Value; velocity = (int)m.Data[3].Value; } + + public VmcExtMidiNote(int _active, int _channel, int _note, float _velocity) : base(new godotOscSharp.Address("/VMC/Ext/Midi/Note")) + { + if (_active < 0 || _active > 1) + { + GD.Print($"Invalid value for \"active\" 'i' argument of {addr}. Expected 0 or 1, received {active}."); + return; + } + active = _active; + channel = _channel; + note = _note; + velocity = _velocity; + } } } \ No newline at end of file