Hi, thanks for the quick reply. Here's another patch on top of my last
one. There's nothing too special to it, just stubs for CoreMidi and
PortMidi so they'll at least compile. I think with this, I've covered
all the MIDI driver compilation issues here.
My UI tweaking wasn't complete. I didn't know what font was used for
the widget labels, so I left mine blank. Of the two spinners I added to
the instrument editor, the one on the left selects the channel (or "Off"
if channel is less than 1), and the one on the right selects the note to
use.
You're correct in what my patch does. The note velocity is the same as
before, so nothing new had to be added for the MIDI out stuff.
I've seen some variation on what to call middle C, so that might need
updating in the UI. The default value of C3 is note 60 (middle C). I'm
also unsure if I need to do anything more clever with my MIDI messages.
Right now I'm just dumping them out on demand, as opposed to creating a
separate thread, queueing the messages, and emitting them in a more
intelligent way. I didn't notice any problems with it, but I didn't do
any real stress testing, so could be an issue.. though easy enough to
resolve.
As for the note off messages, I wasn't aware of the note length feature
in Hydrogen. Do you know offhand where might be an appropriate place to
handle sending a note off when the note length reaches its end? I can go
hunting for a spot later, but a pointer would be helpful :).
I'm unsure of the code review policies for this project, but if the
hooks I've added and overall style of my code is acceptable I can work
on adding PortMidi and CoreMidi support (shouldn't be too hard).
Otherwise I'll wait to get things more solidified with the ALSA
implementation before working on the other driver targets.
On Sun, 2009-01-18 at 16:39 +0100, m.wolkst...@gmx.de wrote:
> hiho,
> wow... great!!!
> that sounds very good. i am not sure if we can implement this great feature
> into the 0.9.4 h2 version. it would be helpful to add an compiler option to
> activate/deactivate this feature in the sconstruct file. some people try to
> build binaries for windows and osx. and maybe other people under linux don't
> use alsa.
>
> if i understand your patch right you can send
> * note on messages from each instrument with the given instrument "midi in"
> note number
> (eg. kick = midi note number 65) and you can also change this number with the
> new
> combobox in instrument properties.
> * note on velocity is the same than the velocity you have edit in the
> NotePropertiesRuler.
> * midi channel can customised for each instrument with the second new
> combobox in instrument properties?
>
> what is with note off msgs? in moment h2 allows to edit the note length using
> the right mouse button + move mouse by clicking on an existing note.
Index: libs/hydrogen/include/hydrogen/IO/CoreMidiDriver.h
===================================================================
--- libs/hydrogen/include/hydrogen/IO/CoreMidiDriver.h (revision 728)
+++ libs/hydrogen/include/hydrogen/IO/CoreMidiDriver.h (working copy)
@@ -36,7 +36,7 @@
namespace H2Core
{
-class CoreMidiDriver : public MidiInput
+class CoreMidiDriver : public virtual MidiInput, public virtual MidiOutput
{
public:
CoreMidiDriver();
@@ -47,6 +47,9 @@
virtual void open();
virtual void close();
virtual std::vector<QString> getOutputPortList();
+
+ virtual void handleQueueNote(Note* pNote) {}
+ virtual void handleQueueAllNoteOff() {}
MIDIClientRef h2MIDIClient;
ItemCount cmSources;
Index: libs/hydrogen/src/IO/PortMidiDriver.h
===================================================================
--- libs/hydrogen/src/IO/PortMidiDriver.h (revision 728)
+++ libs/hydrogen/src/IO/PortMidiDriver.h (working copy)
@@ -31,7 +31,7 @@
namespace H2Core
{
-class PortMidiDriver : public MidiInput
+class PortMidiDriver : public virtual MidiInput, public virtual MidiOutput
{
public:
PmStream *m_pMidiIn;
@@ -43,6 +43,9 @@
virtual void open();
virtual void close();
virtual std::vector<QString> getOutputPortList();
+
+ virtual void handleQueueNote(Note* pNote) {}
+ virtual void handleQueueAllNoteOff() {}
private:
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Hydrogen-devel mailing list
Hydrogen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel