Using only one Midi Channel (noob content :))

A
Alex posted Oct 17, 21:28:

Hi Guys.
I would Like to use the SB as a drum sampler. My set consists of 3 devices, all of them are controlled by the Beatstep Pro sequencer. So I need different MIDI channel for each device. What is the easiest way to change the MIDI channel from omni to lets say 10?
Im sorry, if the question is already been answered. I havent found the wright thread.
Thanks!

H
HansEhv posted Oct 17, 23:36:

Hi Alex,
If you need it like a simple source of beatsounds, why not let devices all output to the same channel, midi=10, the standard drum, and assign the samplerbox to that?
Or do you want to assign the three sources to three different voices (from your earlier implementation).
And ofcourse: original samplerbox has omni on with 16 channels, as it does not test for tthat at all :-)

A
AlexM posted Oct 18, 04:31:

Two different Alex's here Hans haha

Alex (OP), are you handy with python? If so, look into the rtmidi2 module (posted about on the forum). In its callback function you have access to the device name(s) sending midi messages (as the 'src' parameter). You could create a filter in this callback (MidiCallback) that goes something like:

if src == 'thedevicename':
    # do stuff here

This way you can still have all midi channels open. And perhaps you could assign the devices to different voices (see: http://www.samplerbox.org/forum/184) depending on what you want to do.

A
AlexR posted Oct 18, 06:11:

I see, there is a little misunderstanding. Sorry. There are two analog Synths and a sampler box connected to the Sequencer, not 3 sampler boxes. Each device needs a dedicated Midi Channel to be abble to play only its own sequence. I have warned you, im completely noob :) Just couldn't find the step by step instruction how to assign only one Midi channel to the Pi.
P. S. I Gonna call myself AlexR to avoid any confusions :D

H
HansEhv posted Oct 18, 09:04:

Oeps Alex (2x), sorry for the confusion :-)

Anyway: if the sources can send on a specific MIDI channel, it all drops down to testing the channel in the MIDI callback section. So you stay within the MIDI specs.

The callback needs to be changed in the beginning, so after the
" messagechannel = (message[0] & 15) + 1"
You can add something like
" if (messagechannel == MIDI_CHANNEL):"
here. You can use a fixed number or a variable, that's up to you.
Next you indent everything after this untill the end of this section with 4 spaces. You don't have to use 4, but you must the same amount; the if statements react on the indentation.

You can also use (parts of) other implementations found here on the forum...

...

  (not published)
  I want to post as guest
 

Post