Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Midi: set default MIDI out channel & note #449

Open
mendomusic opened this issue Dec 4, 2016 · 3 comments
Open

Midi: set default MIDI out channel & note #449

mendomusic opened this issue Dec 4, 2016 · 3 comments

Comments

@mendomusic
Copy link

mendomusic commented Dec 4, 2016

Under Pattern Editor Drumkit there is the table with the default incoming MIDI routings by instrument position.

I would like to suggest the following improvement to enable quick set-up of midi routing to external programs:

  • If the entry in drumkit.xml for am instrument is set to <midiOutChannel>-1</midiOutChannel> hydrogen could automatically set this to <midiOutChannel>9</midiOutChannel> which will provide the user MIDI out on the standard channel 10
  • if <midiOutNote>60</midiOutNote> (seems to be the standard note), change this to the positional note. For GMkit the instrument id 7, the position 8, (Tom Mid) would then be assigned to <midiOutNote>73</midiOutNote> or even better to the respective note value of general midi standards.

Since MIDI out channel & MIDI out note are hard-coded in the drumkit XML file, this change would require to recode all drumkit XML.
But instead, hydrogen could run the two checks on top when reading the drumkits. Maybe enabled/disabled by a setting.

Unfortunately, I do not understand cpp files.

but some pseudo code would come in here:
https://github.com/hydrogen-music/hydrogen/blob/master/src/core/src/basics/instrument.cpp#L250

   if ( __midi_out_channel == -1)
        pInstrument->set_midi_out_channel( node->read_int( "midiOutChannel", 9, true, false ) );
	pInstrument->set_midi_out_note( node->read_int( "midiOutNote", pInstrument->__midi_out_note, true, false ) );
    if ( __midi_out_note == 60)
        MIDI_NOTE = MIDI_NOTE_OF_CURRENT_POSITION
        pInstrument->set_midi_out_note( MIDI_NOTE, pInstrument->__midi_out_note, true, false ) );    

I think this small change would improve the midi setup. Thanks for considering.

@mauser
Copy link
Member

mauser commented Dec 7, 2016

Hi!

In general, i'm also thinking that there is the need for a more user-friendly midi handling in hydrogen.

But coming to your use-case, i don't think that re-interpreting the values from the drumkit xml is a good idea. First of all, the value "-1" has a special meaning: "do not output anything". This is sth. of course different to channel 9.. So re-interpreting this value in hydrogen seems to be not a good thing to me.
It is questionable if it is a good default value to turn off the midi output by default (by setting the channel to -1), but on the other hand, there are many people who do not use the midi output at all and who want to minimize overhead and turn off the generation of midi out notes.
In addition, it is quite easy for people to set their own values - just adjust the channels of your favourite drumkit and save that drumkit.

About your second point: Midi Note 60 "seems" to be the standard note, but if you look at the MIDI table which you referenced in your link, then Midi Note 36 is listed as the first note. (see also http://computermusicresource.com/GM.Percussion.KeyMap.html). The fact that all instruments were mapped to note 60 was a bug and was not intended. If you're building a fresh version of hydrogen from our git repository, you will see that the default song (empty song) is now consistent with the GM Kit note values (those which are set in Hydrogen's own GMKit drumkit). In my opinion this is a good starting point and does not need any re-interpretation.

@elpescado
Copy link
Contributor

Hi, I've been thinking about the same issue lately.

Problem with your solution is that note 60 is a legitimate note value. In General MIDI spec note 60 maps to Hi Bongo drum, so changing this may upset some Cuban musicians:)

Instead, I proposed pull request that assigns default note values when all instruments use the same MIDI note.

@thijz
Copy link
Member

thijz commented Mar 5, 2018

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

No branches or pull requests

5 participants