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.
IndexProcessing DevelopmentLibraries,  Tool Development › The MidiBus MIDI library
Pages: 1 2 3 4 
The MidiBus MIDI library (Read 35058 times)
Re: TheMidiBus MIDI library
Reply #15 - Jan 25th, 2009, 5:12am
 
As per this topic, I've just made a small update to the library. Now, when themidibus receives a NoteOn with zero velocity, it automatically converts it to a NoteOff with the same pitch and velocity.

These two MIDI messages are used interchangeably in the MDI specification (as far as I know), but in terms of programming I think it's much easy to only receive NoteOffs.

Please take a minute to update your libraries.

Sparky
Re: TheMidiBus MIDI library
Reply #16 - Feb 5th, 2009, 10:50am
 
Hi, that library sounds great.

I found proMidi frustrating as it seems to be oriented to none realtime projects. My main problem is that you have to define a note length in proMidi. So no "as long as you are pressing a button send this note". ( maybe it's not the case anymore ). sendNoteOn() and sendNoteOff() never worked for me.

Is that the same in this library? I could test it my self I feel a bit lazy Sad sorry...

Thx
Re: TheMidiBus MIDI library
Reply #17 - Feb 5th, 2009, 1:08pm
 
no, here you can send noteoff whenever you like. this is good and simple to use library.
Re: TheMidiBus MIDI library
Reply #18 - Feb 5th, 2009, 2:38pm
 
Brilliant Smiley

thx
Re: TheMidiBus MIDI library
Reply #19 - Feb 6th, 2009, 3:23am
 
Hey TM,

Yes, my library does do what you want. Making this kind of thing easy is the reason I wrote an alternative to proMidi ... here is a simple example of how to do it:

Code:

import themidibus.*; //Import themidibus

MidiBus myBus; //Your MidiBus object

void setup() {
size(200,200);
background(0);

myBus = new MidiBus(this, "", "Java Sound Synthesizer");
//Initialize your MidiBus Object
}

void draw() {
int channel = 0;
int pitch = 64;
int velocity = 100;

myBus.sendNoteOn(channel, pitch, velocity); // Send a Midi noteOn.
//This will play until you send a noteOff with the same channel/pitch

delay(500); //Let's wait 0.5 sec and listen to the beautiful piano

myBus.sendNoteOff(channel, pitch, velocity);
// Ok, let's stop it now. Send a Midi noteOff

delay(2000); //Now let's wait 2 sec before we start again
}


If you want to learn more about what my library can do, what feature it has and how to use them, you should visit the javadocs. In particular have a look at the PApplet page and the MidiBus page. And obviously, if you have any question about how to use the library, just post here and I'll be happy to help out.

Also just for your information (and in the interest of full disclosure): as you mentioned it is possible to send note on commands with proMidi, but it's not very well documented. This topic briefly explains how.
Re: TheMidiBus MIDI library
Reply #20 - Feb 10th, 2009, 3:57pm
 
Thanks,

Just had quick testing and it seems to work great! I really glad that you made this simple midi lib. I can finally work again with real time.

Cheers.
Re: TheMidiBus MIDI library
Reply #21 - Jul 19th, 2009, 2:17am
 
Hi
I'm doing a project where I'm reading values from an accelerometer with an Arduino board, then sending the values to Processing and then i would like to convert the values to Midi and send them to Logic Pro.
Is it possible to use TheMidiBus library to convert these values to a Midi signal? And is it possible to make Processing behave as a Midi-input device so Logic Pro can recognize it?
I have never worked with Midi before so excuse me if I'm asking for something obvious.
Best regards
Re: TheMidiBus MIDI library
Reply #22 - Jul 19th, 2009, 6:15pm
 
Just made a semi-large update to the library. A variety of small new features to discover and some various internal changes.

Most notably the MidiBus.list() method now behaves slightly differently, but it should now properly detect which input/output devices are actually available (previously the library would sometimes list unavailable devices as being available). Similarly the returnList() method is now gone. Instead the new methods availableInputs() and availableOutputs() return arrays of the available input and output devices.

Other new stuff in the update includes the removeInput() and removeOutput() methods and the associated attachedInputs() and attachedOutputs() methods which list the input and output devices currently attached the the MidiBus object.

Also there are also some new flavors of the sendMessage() method as well as a toString() method now.

Please take the time to download the latest release, version 004.

There is now a CHANGELOG.txt file for a full list of the changes in the latest .zip release.

Sparky
Re: TheMidiBus MIDI library
Reply #23 - Jul 19th, 2009, 6:28pm
 
Yes you can absolutely do what you're talking about.

(Although you should probably redownload my library after last night's update so we're using the same version, sorry for the inconvenience)

First of all, to make Processing behave like a MIDI-input device in Logic. I'm going to assume we're on mac here, because logic doesn't exist on PC as far as I know. You'll want to set up an IAC bus on your mac. This is essentially a software MIDI bridge that will let you share MIDI from Processing to Logic. For this, open up the "Audio MIDI Setup" Application (under Application/Utilities). Click on "MIDI Devices", then click on "IAC Driver". Make sure the device is online (there should be a check box) and make sure there is at least one port in the list of ports (if not just click add port and make a new one). You should now have (at least) one IAC bus to send MIDI over. You can google IAC bus for more information about the IAC driver.

I will assume for my example that your IAC port was called "Bus 1" like mine.

When you run MidiBus.list() you should see something like this:
Code:

Available MIDI Devices:
----------Input----------
[0] "IAC Driver - Bus 1"
[1] "Real Time Sequencer"
----------Output----------
[0] "IAC Driver - Bus 1"
[1] "Real Time Sequencer"
[2] "Java Sound Synthesizer"


In which case you processing sketch would be something like this (this is really vague, please tell me if you need more detail):
Code:

import processing.serial.*;
import themidibus.*;

MidiBus myBus;
Serial arduino;

void setup() {

 //Set up your sketch and you arduino
 //Set up so your arduino calls SerialEvent with new data

 //Set up the MidiBus using your new IAC bus
 myBus = new MidiBus(this, "", "IAC Driver - Bus 1");
}

void draw() {
 //Important drawing stuff here
}

void serialEvent(Serial port) {
 int data = 0;

 //receive data here eg
 //arduino.readStringUntil(20);
 //or something similar


 //Then you simply do this:
 myBus.sendControllerChange(0, 0, data);
 //or
 myBus.sendNoteOn(0, 0, data);
 //or something else similar
 
}


Sorry if that was kinda vague.

Sparky
Re: The MidiBus MIDI library
Reply #24 - Jul 27th, 2009, 4:19pm
 
WARNING: Some windows users have reported strange problems with the new release of the MidiBus library. I am currently working on understanding and fixing theses issues, you may want to wait a few days before updating your library.

If you are also experiencing issues please don't hesitate to send me bug reports it's always help.

I will update here when the bugs are fixed.
Re: The MidiBus MIDI library
Reply #25 - Jul 29th, 2009, 5:37pm
 
hello,
I am running into a problem with midibus. I am using it to transfer midi signals to processing, via midiYoke and midiOX on a PC. My problem is that on one XP machine it is working fine, whereas on others processing just doesnt see any midi messages. The one that works was setup over a month ago whereas the latest attempts are only in the last few weeks. How can I trouble shoot this?

UPDATE: the problem was that the working machine  had the older midibus library. The new library I couldnt get to work.

Thanks
Greg
Re: The MidiBus MIDI library
Reply #26 - Aug 7th, 2009, 5:30pm
 
Edit, this bug is now fixed. If you've got the lastest version and are experiencing problems please e-mail me with a quick bug report

Hey Gregorty,

As I mentioned there seems to be some problems on windows with my new build. I apologies it is very difficult for me to debug for windows (I don't have a PC).

I fully expect to update the library early this week and fix all outstanding bugs (hopefully ...). I will PM you when it happens.

In the mean time, if you're so inclined, bug reports are always helpful. Just send me an e-mail with as much detail as possible eg code you were running, what operating system, what midi devices etc ...

Sorry to anyone affected by theses bugs.

Sparky
Re: The MidiBus MIDI library
Reply #27 - Aug 8th, 2009, 12:51am
 
I can't manage to get the MidiBus.list() to include an IAC port. It doesn't come up on my list. Even though other apps can see the port perfrectly well, the list just doesn't include it. Am I missing something? is there a dependent package that I need to install as well as MidiBus, to see the ports available via AudioMidi?


Edited:
edit:  ah! the mmj.jar     -  working now


Quote:
To make mmj available to all Java applications simply drop both mmj.jar and libmmj.jnilib into /Library/Java/Extensions.
Re: The MidiBus MIDI library
Reply #28 - Aug 9th, 2009, 4:40pm
 
Just a heads up. The windows bugs appear to have been fixed. Please redowload the new version 004 of the MidiBus to get the bug fixes.

If you are still experiencing any problems/weird behavior on windows please e-mail me and let me know so I can fix it ASAP.

Thanks to Clone45 for all the debugging help.

On a side note I will start a low volume mailing list for new releases and updates of the MidiBus in the next week or two, so check back here if you're interested.

Also you've got it cristian_vogel, always install MMJ on a mac or else you will only see the Java Sound Synthesizer and The Real Time java Sequencer.

Sparky
Re: The MidiBus MIDI library
Reply #29 - Aug 21st, 2009, 4:22am
 
Hey Sparky
Thanks for your nice reply, it works perfectly. Now I just need to figure out how MIDI really works and what the different commands does.
Keep up the good (excellent) work.
Best regards
Morten
Pages: 1 2 3 4