MidiChannel is always 1 in NoteOn when logging midi players output
-
If I have a MidiPlayer playing a midi file with all events on channel 2, in NoteOn callback logging with Message.getChannel() , I get channel 1, why is that?
-
@ulrik I ask because I want to see from which MidiPlayer the note on events is coming if I use more than 1 MidiPlayer.
Or is there another way to distinguish from which it's coming? -
@ulrik
Here's a small snippet using 2 MidiPlayers, player1 has events on channel 1, player2 on channel 2Logging the midi events from the 2 players shows that it's working
Looking in NoteOn cb show midi channel 1 from both players
HiseSnippet 4195.3oc2a08TiikcWFZ2aauYRM6tytYeIUogZqJlfG0VFiaHyNYvxV.F7GpwFZfN8NQHcss.YIijrASpopox+XYeHUdNOkmyeB6+AcNm6URVx1.Fllo1ItJD5dum64967w8bN5KEGaMhqqsCWhTsGOfvk3uIYqwVd8J2S0vhqZEtDuLoGw0iSZ7.UWWhNWhDKuKNVhTufi96u7sRplpVZjIcwwcrsgFolQeCuI8pr8AFll6npSZazOB0E1tplsUYaS6g.NVNYNtApZWp1kzPEIaoj.Hj0M7rcZ4oBfgKwKjr0G2pm80VL5O1v03bSB1PjqEvHV26XapiHF6kqbOCSck.40kiKQRkIR+xLo+KRV2P2Hr+IZgOmN.+jYDUejXo3va4XvS7tf2bfzxQfzuHvfPgjo5XhCEJoSVm0RLFHJOzwgX40hb0PRLiwe4a8GpsCnVi1eMa6AxVp.zzi1Mx8yARaMfDefDK+IRN4PQZGCSBJyIBZ.TixGXuqn5oxk3+LoXg7BVsKdvlkOzyUQP3vNJ6ZIbxIGKLZr4oZvu5GcwUFqsmao0uZnvNh5qIpNr9kBan71w0xcn8os2usjfhs9nikVesVBWddo5cZ4cdEqba1pzgE7NsyQd5MTp8t5UdyFhUKcs2o6eh3kikFnc8IibKZtyEE0Kzoq2Y5JuMeMkSxuozf0NPZWsl4FZ2RW6Xg1Z4JsU0it4pqJegT2MuZMMgQuSS3fdp6KKvgB1D+3DnmeKitVpdCcf9R1XXeIUPkDQK2vtuALNcOoem6scEh0rcmaazBBVCGun68Xl0XVNtGieU9+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WApjmWruUfuX6CIlDUWRzDT0fLPpNfdh7D0EOvGYShEzd86SxfKOFOf+upRq3+MbjNYviMyOzXPS9PwQ7gQ6Qtj1pT3LwjVEL+NdQ+LMvXUZFmSLiaXlMmzS+q23SQdykWn7lO8MRQcddUvWRCEOuqGApTi43P6fm1yixTHYLv1T0Ay+unVkV8ss85EOkkw1OKFk+Jp3f6ONKj3i+mMkA92kDRFmmm4x7iwo9SCpYu2IcqqBwzug80H0Bp7Qi3+R.fOA2DKgWSHqcNrM0QjXoSa.Wn0G8GTDamvePwfA+IYM5qp4X+cZrmjCty8Uzd.41h9oWkJYcrMe3CpKYxbB43vWYguSSC8o+JP+L+4j+ILm0eByovSXNa7DlSwmvbdySXNaduyAqaqzPO69L+enCEY1WrWhvulP3hA++.TsDHiA
-
@ulrik @Christoph-Hart is it possible to fix this, or do I make something wrong when logging the events?
-
Is there a solution here - does anyone have an idea?
-
@Christoph-Hart
Related to this issue of not being able to grab notes by their midi channel in the NoteOn Cb, I tried a different approach using no arp or midi players at all. Instead I've built 4 arpeggiators manually and now to my question:I use the TransportHandler and made the "NoteOn callback inside the GridChange function set to 18, 1/96 (1/64T)
const TH = Engine.createTransportHandler(); TH.setEnableGrid(true, 18); TH.setSyncMode(TH.PreferExternal); if (MPsActivate[0].getValue()) { local nv = NVLookUpNum[MPsSpeed[0].getValue()-1]; if (gridcount % (nv*96) == 0) { slider1 == NumSliders.getValue()-1 ? slider1 = 0 : slider1++; //for (sp in S) local nn = MPSPs[0][0].getSliderValueAt(slider1); local v = MPSPs[0][1].getSliderValueAt(slider1); local l = MPSPs[0][2].getSliderValueAt(slider1); local len = Engine.getSamplesForQuarterBeats(nv*l*4); for (n in PKs) { local ev = Synth.addNoteOn(1, Math.range(nn + n, 0, 126), v, 0); Synth.noteOffDelayedByEventId(ev, len); } } }
I have not tested this carefully yet.
Is there a drawback using this approach?
It feels like it will not be as accurate as using the built in NoteOn cb