Another config tool

Discussions of any related software

Moderator: Related software moderators

Re: Another config tool

Postby elrules » Sun May 10, 2009 12:20 am

kimouette wrote::?: Could Mac users tell us what MCT features currently work with your MD?
I second that
elrules
 
Posts: 629
Joined: Thu Nov 29, 2007 4:51 pm
Location: Murcia, Spain, Europe, The World

Re: Another config tool

Postby acspike » Tue May 12, 2009 12:11 am

As I'm waiting for the possible open source release of MCT, I've been trying to learn some Java and learn how to talk to the MegaDrum. I've created a minimal example of detecting the MegaDrum and returning the firmware version. I don't have delusions that this is beautiful code or even idiomatic Java, but it still might give someone a leg up as they do their own investigations.
You do not have the required permissions to view the files attached to this post.
acspike
 
Posts: 17
Joined: Mon May 12, 2008 12:58 pm

Re: Another config tool

Postby Ken Forgettable » Tue May 12, 2009 10:39 am

acspike wrote:learn how to talk to the MegaDrum.

I'll make a sober assessment tonight thanks, and keep it up!

Are you MAC or linux?
Ken Forgettable
 
Posts: 402
Joined: Tue Jan 06, 2009 5:04 pm

Re: Another config tool

Postby acspike » Tue May 12, 2009 11:40 am

I'm using Ubuntu linux. I did get a chance to test it once on Windows XP last week too.
acspike
 
Posts: 17
Joined: Mon May 12, 2008 12:58 pm

Re: Another config tool

Postby Ken Forgettable » Tue May 12, 2009 12:31 pm

elrules wrote:
kimouette wrote::?: Could Mac users tell us what MCT features currently work with your MD?
I second that

Can fuzzysnuggleduck, kimouette, userfriendly, or any other MAC troopers find the time to see if acspikes little proggy (above) works for them and report back with the OS version please.
Ken Forgettable
 
Posts: 402
Joined: Tue Jan 06, 2009 5:04 pm

Re: Another config tool

Postby userfriendly » Tue May 12, 2009 1:51 pm

I'm probably going to need a MegaDrum for that, so I'll have to wait until the kit reaches me. :(

As soon as I have it (and have built it, of course), I can test on OS X 10.5.6, Ubuntu Studio 8.04 and Windows XP.
userfriendly
 
Posts: 71
Joined: Sat Apr 25, 2009 9:31 pm

Re: Another config tool

Postby acspike » Tue May 12, 2009 1:55 pm

Mac users/java experts take note of lines 82-85 and line 88 where I'm "discovering" the megadrum.

Code: Select all
      MidiDevice.Info[] mdi = MidiSystem.getMidiDeviceInfo();

      //For Linux:
      String checkFor = "MegaDrum";
      //For Windows:
      //String checkFor = "USB Audio";
      for (int i = 0; i < mdi.length; i++) {
         String info = mdi[i].getName()+": "+mdi[i].getDescription();
         if (info.indexOf(checkFor)>-1) {
...


I don't know what name the os reports for the megadrum on Mac (I'm sure it is on the forum somewhere) so checkFor will almost have to change. Also note that the program doesn't work well on linux. After I send a sysex message and get a reply I have to power cycle the megadrum before I can send and receive another sysex set (though it continues to get short messages from the drum).
acspike
 
Posts: 17
Joined: Mon May 12, 2008 12:58 pm

Re: Another config tool

Postby fuzzysnuggleduck » Tue May 12, 2009 2:18 pm

I'll have a chance to test tomorrow. Hopefully I remember.
fuzzysnuggleduck
 
Posts: 130
Joined: Tue Dec 02, 2008 9:16 am

Re: Another config tool

Postby Ken Forgettable » Wed May 13, 2009 10:55 am

acspike stuff works just dandy, I can't make it misbehave on XP - but check out the comments in MidiDevice.java - written my morons for use by idiots!

... my interpretation is:

+ A MidiDevice can be opened explicitly as well as implicitly.

+ A MidiDevice should always be closed explicitly, even if it has been opened
implicitly.

+ Explicit access is accomplished by calling open and close on a MidiDevice
instance.


... but the ladies seem to go to say

+ Implicit opening is accomplished by calling
javax.sound.midi.MidiSystem#getReceiver MidiSystem.getReceiver and
javax.sound.midi.MidiSystem#getTransmitter MidiSystem.getTransmitter.

... and

/**
* Obtaining a Transmitter with this method does not
* open the device. To be able to use the device, it has to be
* opened explicitly by calling #open.
*/
public Transmitter getTransmitter() throws MidiUnavailableException;


... then they twist the knife

/**
* Note that some devices, once closed, cannot be reopened. Attempts
* to reopen such a device will always result in a MidiUnavailableException.
*/
public void open() throws MidiUnavailableException;

I don't like to see a woman compromised 8-)
Ken Forgettable
 
Posts: 402
Joined: Tue Jan 06, 2009 5:04 pm

Re: Another config tool

Postby acspike » Wed May 13, 2009 11:45 am

Ken, I think you're trying to tell me something, but I'm not sure exactly what. ;)

In regard to closing MidiDevices I think you make a very valid point that the devices need to be closed unconditionally. I should move lines 132-138 outside of the if statement and check for nullness individually. Good eye.

I have to confess that I have no idea what you are telling me about the MidiDevice.open() method and the various women involved with it. Are you saying that I should store up a Transmitter and Receiver object at the same time I open the devices? Are you recommending that I explicitly close the Receiver and Transmitter?

You have to lay it on the line for me. I'm a java newb here! :mrgreen:
acspike
 
Posts: 17
Joined: Mon May 12, 2008 12:58 pm

PreviousNext

Return to Related Software

Who is online

Users browsing this forum: No registered users and 29 guests