We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › using promidi with an electronic drumkit
Page Index Toggle Pages: 1
using promidi with an electronic drumkit (Read 2824 times)
using promidi with an electronic drumkit
May 20th, 2010, 8:44am
 
I'm having problems with getting processing to see my midi based drum kit (millenium mps 400) to trigger animations

I have no problems with promidi seeing a midi keyboard using the basic promidi example supplied, my mac can see the drum kit (works perfectly with garageband) but the same example file will not work with my drumkit though it appears to see it fine (message in output window shows this)

the drumkit transmits on midi channel 10 and I assume this is the problem - I am unable to change the midi channel the kit transmits on so is there a way to change the example sketch to read midi channel 10? (my drumkit)

from there I feel confident enough to link to my animations but I am currently stuck here

any help much appreciated



Re: using promidi with an electronic drumkit
Reply #1 - May 21st, 2010, 1:29am
 
Which example are you talking about?

Looks like the noteOn() method provides a way to listen to a specific midi channel :

Code:
void noteOn(Note note, int device, int channel) {
 if (channel == 10) {
   // do something
 }
}
Re: using promidi with an electronic drumkit
Reply #2 - May 21st, 2010, 4:00am
 
hi
many thanks for looking
the example is the first example supplied with the proMidi library - it's just named proMidi.pde
I see the noteOn method but the drum kit never seems to call it in the way the keyboard does
I have added a println(channel); line into the method to test if it is triggering but with no success

the output panel shows

printPorts of midiIO
<< inputs: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
input 0 : e-drum        
<< outputs: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
output 0 : e-drum        
output 1 : Java Sound Synthesizer
<<>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

so i am sure the library is seeing the kit

any other ideas would be really appreciated

thanks again

Re: using promidi with an electronic drumkit
Reply #3 - May 21st, 2010, 4:10am
 
can you post some code? (at least the content of your setup())

did you call openInput the right way?

reference says :

openInput(inputDeviceNumber, midiChannel);
openInput(inputDeviceName, midiChannel);


so you should check that you've got something like :
Code:
midiIO.openInput("e-drum", 10); 


or
Code:
midiIO.openInput(0, 10); 

Re: using promidi with an electronic drumkit
Reply #4 - May 21st, 2010, 8:11am
 
hi thanks again for looking

my setup() is unchanged from the original example proMidi.pde
void setup(){
 size(128*5,128*5);
 smooth();
 background(0);
 
 //get an instance of MidiIO
 midiIO = MidiIO.getInstance(this);
 println("printPorts of midiIO");
 
 //print a list of all available devices
 midiIO.printDevices();
 
 //open the first midi channel of the first device
 midiIO.openInput(0,0);
}

the midiIO.openInput() line - I have tried midiIO.openInput("e-drum",0);
but I get 'There is no input device with the name e-drum'

midiIO.openInput(0,10) runs without error but doesn't seem to pick up the drums

my animations will be pasted inside the noteOn() method but it's getting the drums to call noteOn() that is my problem I think

again many thanks for looking - it's proving really frustrating here

any other ideas???



Re: using promidi with an electronic drumkit
Reply #5 - May 21st, 2010, 10:54am
 
are you sure your drumkit sends "note on" events? on channel 10? have you tried with any other channel?

I would do the following :

1) put a debug line in noteOn like :

Code:
void noteOn(Note note, int device, int channel) {
println("note on, device " + device + ", channel " + channel);
}

2) then run the sketch with different openInput.midiChannel :

[code]void setup() {
...
midiIO.openInput(0, value);
// where value in range 0 - 20 maybe?
...
}

Re: using promidi with an electronic drumkit
Reply #6 - May 23rd, 2010, 2:48am
 
hi thanks once more

I have tried something similar - I went up to channel 16 not 20

and tried a println("hello"); in the noteOn method

I think you are right that the drum kit itself may not be sending noteOn events at all - I'm not a midi person but I'm going to have a look at midi monitor (http://www.snoize.com/MIDIMonitor) tomorrow to see if I can work out what the drum kit is actually sending

I'll post back any results

thanks
Re: using promidi with an electronic drumkit
Reply #7 - May 24th, 2010, 2:51am
 
antiplastik - thanks for your efforts with this - in the end I tried a different midi library RWmidi and it picked up the drums without a hitch and does exactly what I need
I suspect that proMidi was more complex than I needed (or understood)
thanks for your help all the same
cheers
Page Index Toggle Pages: 1