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.
Pages: 1 ... 3 4 5 
proMIDI 2.0 (Read 33723 times)
Re: proMIDI 2.0
Reply #60 - Mar 27th, 2008, 1:02pm
 
Hi, I've got a question on Promidi.

How do you handle multiple midi channel?
I need to be able to send midi notes on two ( or more ) midi channels, is that possible?

Does it work with the plug method?

//1 channel
midiIO.plug(this,"Synth1",0,0);

//2 channel
midiIO.plug(this,"Synth2",0,1);

//etc...

The problem is that I want to be able to select my midi devices throught a menu.
So people can use it with their favorite music software using what ever they use for virtual midi, or just with the build in midi-synth.
I've made this by first getting the list of midi outputs, put them in String Array. Made my thing for the visual menu. And then use the value of the array in midiIO.getMidiOut(myArryValue,0);
That doesn't work for the moment but I will find out why. Smiley

So can I change the midi device in the plug method dynamically?  You say in the documentation that it work with incoming data, does that mean it's doesn't work with Output?

ps: By the way it doesn't seem to work on a mac (intel, 10.4.11) the midipro_mac with mandolane included. Don't know why, but I'm mainly using a pc anyway.
Re: proMIDI 2.0
Reply #61 - Apr 1st, 2008, 7:17pm
 
ok ok,
Found my solution for the channels, it was quit simple in fact. I imagine that's why I didn't get any replies Wink

Still didn't fix the midi output selection but I will...
Re: proMIDI 2.0
Reply #62 - Apr 1st, 2008, 10:44pm
 
TM wrote on Mar 27th, 2008, 1:02pm:
Hi, I've got a question on Promidi.

ps: By the way it doesn't seem to work on a mac (intel, 10.4.11) the midipro_mac with mandolane included. Don't know why, but I'm mainly using a pc anyway.


What doesn't work with mandolane  If you can describe the problem and any console messages I'll investigate.

Mandolane
Reading a Midi File
Reply #63 - May 16th, 2008, 1:20pm
 
Hej,

I want to read a standard Midi file (Beethoven 4th for example) to visualize the song. Is there any way to do this with proMidi?
Would be great, if someone has a suitable solution.

Thanks, Fejngold
proMIDI 2.0 > no accesible method
Reply #64 - May 30th, 2008, 8:45pm
 
Hi! i have a strange error with proMidi Library.

No accessible method with signature "getOutputDeviceName(int)" was found in type "promidi.MidiIO".

I run this example included in proMidi library:

Quote:


import promidi.*;

MidiIO midiIO;

void setup(){
 // get an instance of MidiIO
 midiIO = MidiIO.getInstance(this);
 
 //print a list with all available devices
 midiIO.printDevices();
 println();
 
 //printDevices recoded
 midiIO.printInputDevices();
 midiIO.printOutputDevices();
 println("<<<<<<<<<   >>>>>>>>>>>>>>>>>>>>>");
 println();
 
 println("printPorts recoded 2");
 println("<< inputs: >>>>>>>>>>>>>>>>>>>>>>");
 for(int i = 0; i < midiIO.numberOfInputDevices();i++){
   println("input  "+nf(i,2)+": "+midiIO.getInputDeviceName(i));
 }
 println("<< outputs: >>>>>>>>>>>>>>>>>>>>>");
 for(int i = 0; i < midiIO.numberOfOutputDevices();i++){
   println("output "+nf(i,2)+": "+midiIO.getOutputDeviceName(i));
 }
 println("<<<<<<<<<   >>>>>>>>>>>>>>>>>>>>>");
}





anyone helps me?

thanks
Re: proMIDI 2.0 > no accesible method
Reply #65 - May 30th, 2008, 8:56pm
 
janebeta7 wrote on May 30th, 2008, 8:45pm:
Hi! i have a strange error with proMidi Library.

No accessible method with signature "getOutputDeviceName(int)" was found in type "promidi.MidiIO".


In a few minutes i resolved the problem:

I have two promidi libraries installed in my pc. One in library folder and two in an sketch folder. A little strange, i deleted one, and again mi M. Audio midi works!

This is the typical case when you askm you resolve!

Smiley

Re: proMIDI 2.0
Reply #66 - Dec 16th, 2008, 7:04am
 
Hello,

I'm using promidi's MidiOut class and midiIO class.  Mostly I'm just calling sendNote like so:

note = new Note(pitch,velocity,note_duration);
midiOut.sendNote(note);

Every once in a while, I'm getting this error:

Exception in thread "Thread-5" java.util.ConcurrentModificationException

at java.util.TreeMap$PrivateEntryIterator.nextEntry(Unknown Source)

at java.util.TreeMap$KeyIterator.next(Unknown Source)

at java.util.AbstractCollection.toArray(Unknown Source)

at promidi.MidiOut$NoteBuffer.run(MidiOut.java:263)

Any ideas why this might be happening?

Thanks,
- Bret
Re: proMIDI 2.0
Reply #67 - Jan 12th, 2009, 12:01pm
 
Hi, (excuse my english)

I'm using p5 under ubuntu 8.10.
When I connect a MIDI controller, I can't capture any event with proMidi 2.0 and the method controllerIn(Controller controller, int device, int channel).
I tried the qjackctl to set my midi devices but can't see my java/p5 process.
Any ideas ?

nico.
Re: proMIDI 2.0
Reply #68 - Sep 22nd, 2009, 5:35am
 
Recently downloaded the ProMIDI2 libraby and every time I open an example sketch, I get this:

Exception in thread "Animation Thread" java.lang.ClassCastException: uk.co.mandolane.midi.MMidiTransmitter$Info
     at de.humatic.mmj.spi.CoreMidiProvider.getDevice(CoreMidiProvider.java:122)
     at javax.sound.midi.MidiSystem.getMidiDevice(MidiSystem.java:200)
     at promidi.MidiIO.getDevice(MidiIO.java:202)
     at promidi.MidiIO.getAvailablePorts(MidiIO.java:213)
     at promidi.MidiIO.<init>(MidiIO.java:131)
     at promidi.MidiIO.getInstance(MidiIO.java:155)
     at promidi_sequencer.setup(promidi_sequencer.java:26)
     at processing.core.PApplet.handleDraw(PApplet.java:1400)
     at processing.core.PApplet.run(PApplet.java:1328)
     at java.lang.Thread.run(Thread.java:613)


I use it on a macbook, mac os x 10.41, mandalone installed. Any ideas?
Re: proMIDI 2.0
Reply #69 - Nov 19th, 2009, 9:08am
 
Managed to get ProMidi working. This time I'm having trouble with the structure of code, rather than promidi. The purpose of this sketch is to get midi note on messages and represent them as growing circles. For some reason the ellipse appears in the upper-left corner, even though the position is determined by the velocity and pitch (eg: ellipse(vel*5,pit*5,60,60); ). The println clearly shows the pitch values real time, so the trouble must be somewhere else. Where did I go wrong? If you try the sketch, don't forget to set the midi device and the input!

Quote:
import promidi.*;

MidiIO midiIO;

int s=60;
boolean button=false;
int vel;
int pit;

void setup(){
  size(128*5,128*5);
  smooth();
  midiIO = MidiIO.getInstance(this);
  println("printPorts of midiIO");
  midiIO.printDevices();
  midiIO.openInput(2,0); //SET DEVICE AND INPUT NUMBER!!!
  smooth();
}
void draw(){
  background(100);
  if(button){
    stroke(255);
    noFill();
    ellipse(vel*5,pit*5,s,s);
    s=s+10;
  } 
  else {
    s=60;
  }
}
void noteOn(Note note, int device, int channel){
  int vel = note.getVelocity();
  int pit = note.getPitch();
  button=true;
  println(pit);
}
void noteOff(Note note, int device, int channel){
  button=false;
}







Re: proMIDI 2.0
Reply #70 - Dec 10th, 2009, 6:58pm
 
ATTN: alkopop79

you have defined the variables vel and pitch twice...
once at the beginning of the sketch and once inside the function noteOn:

void noteOn(Note note, int device, int channel){
 int vel = note.getVelocity();
 int pit = note.getPitch();
 button=true;
 println(pit);
}

the variables do need to be initialized, but simply removing the "int" infront of the variables inside the noteOn function should take care of it
Re: proMIDI 2.0
Reply #71 - Dec 10th, 2009, 7:12pm
 
I have built a sketch using proMidi.

the value of the variable note inside the noteOn(); function is used to define an objects appearance:

void noteOn (Note note, int device, int channel) {
   for (int i=0; i < bubble.length; i++) {
       if (bubble[i].build == false) {
           bubble[i].button = true;
           bubble[i].noteToCheck = note;
           break;
       }
   }
}

The sketch works fine with one exception:

   if a chord is played (multiple notes at once) only one note variable is returned.

this seems to be because of the way the function is defined:

   void noteOn (Note note, int device, int channel) {

it has an input of a single note rather than an array of notes, this is peculiar because when the note is sent to the midi output via sendNote(); all played notes are heard:

   midiOut.sendNote(note);

How can I get the noteOn(); function to receive all played notes in a single frame, and/or get my objects to react to all notes played at once?
Pages: 1 ... 3 4 5