hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.01k stars 172 forks source link

CLEAR_PATTERN and CLEAR_INSTRUMENT commands + consistent note handling #1950

Closed theGreatWhiteShark closed 2 months ago

theGreatWhiteShark commented 3 months ago

As discussed in #1948 new MIDI and OSC commands were introduced

With these new endpoints it is now possible to properly construct patterns using solely a MIDI devices. Previously, notes could only be added but not deleted.

In addition, we now use a common code basis for mapping incoming notes and instruments. Using this also NOTE_OFF MIDI events are properly mapped to hihat pressure groups and notes inserted via the virtual keyboard are now mapped exactly the same as MIDI notes (fixes #1770).

While I was at it I also introduced the OSC commands

using which one can now record note in the same way as using the MIDI interface.

(In case you are wondering why I keep adding more and more OSC endpoints: It is not that I think this protocol will take off at some point. Instead, all those endpoints can be very easily refactored into a HTTP-based REST API. I do not have any plans for writing a new UI. But I try to gradually path the way by moving functionality from the Qt-based GUI into the core and expose them. What I have in mind is a headless Hydrogen version, like our h2player, people can run and create/use a web-based UI on top of it. Maybe small and dedicated ones e.g. for live performances, playlist handling, practicing etc).

I also found a segfault in the Preferences > MIDI > MidiTable and fixed it.