Pages: [1] 2 3 4   Go Down
Author Topic: Midi direct via USB?  (Read 15045 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, does anyone know if it's possible to get the Arduino to send midi directly to an application on my Mac avoiding the need for a MIDI to USB box? Can I use the USB driver chip on the board to do this? I'm using Isadora to recieve MIDI.
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i think it should be possible. i'm not sure yet though if you can use the onboard ftdi usb chip or if you need another chip or none at all.

here's the specification for usb midi devices:
http://www.usb.org/developers/devclass_docs/midi10.pdf

search google for "usb midi atmega8", at least it has been done by one guy.

generally speaking it is possible to develop "native" usb devices using an atmega8. there are many different starting points on the web but i just didn't find the time yet. look for "AVRusb" as another example for such projects.

if you want to start on this, i'd be happy to assist. for now, i'm stuck with the innards of a midiman usb-midi adapter. i'd me more than happy with an arduino solution.

//best , kuk
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yeah i've got this up and running.

you will need to download the Roland to Serial to MIDI Driver from their website - sorry I don't have the link offhand but I googled it fairly quickly.

Next, you will have to edit the FTDI drivers that come with arduino so that you can run the serial port at 31250 bps. You will need to make a few changes to FTDIPORT.inf

Look for [FtdiPort232.NT.HW.AddReg] and change the the second line below to the one that i've got here.

HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,60,00,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00

This will map 38400 bps to 31250 which you need for MIDI communication. Whenever windows thinks it's running the port at 38400, the driver will actually run it at 31250. Use Serial.begin(31250) in your code.

Reinstall the arduino FTDI drivers, install the Roland drivers, and VOILA!


EDIT: whooooppppsss sorry just reread that you are using mac... I think a similar Roland driver exists, as for the FTDI driver mods, not so sure how you would go about it. It works on XP so there may be hope!
« Last Edit: January 04, 2007, 02:28:50 am by erikwh » Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this sounds good.

just to make sure i understand:
your arduino is sending midi data via serial at 31250 bps.
you needed to hack the ftdi driver to allow that bit rate.

the roland application just takes the data from the (ftdi)serial port and creates a virtual midi-in on your pc?

i tried similar things with the Gee Three StealtPort application on a mac. it creates a virtual midi port, and lets you chose a serial port for the data. it didn't work though. i guess the ftdi driver on the mac doesn't support 31250 neither.

anyone has an idea how to hack the mac-driver for the ftdi?

still HID-midi would be much more comfortable though, as we not need to install any drivers on any OS.

Maybe someone familiar with processing can create some kind of a general serial-to-midi application.
That way we would have a cross-platform solution.

but anyway, really nice work and it sure gives hope.


//kuk

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
this sounds good.

just to make sure i understand:
your arduino is sending midi data via serial at 31250 bps.
you needed to hack the ftdi driver to allow that bit rate.


exactly. I went to the FTDI website and looked up info on custom serial baud rates. There was a good outline of how to change the .INF settings to get the 31250 at http://www.ftdichip.com/Support/Knowledgebase/index.html?aliasingbaudrates.htm I had a quick look through but could not find anything on how to change the MAC drivers around.

The reason that the StealthPort application wont work is probably the same reason that I originally couldn't get the Roland Serial to MIDI driver to work - that is that the com port would not support 31250. If the Mac OS driver is anything like the windows driver, you would only have to change 2 bytes in some config file to get the driver going at the right baud rate. My bets would be on hacking the driver to get the raight baud rate and running the extra serial to midi driver. I am not sure how you would go about folding a HID-midi driver into the FTDI drivers, but I bet it would be a real pain.
« Last Edit: January 04, 2007, 04:00:10 pm by erikwh » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
yeah i've got this up and running... Reinstall the arduino FTDI drivers, install the Roland drivers, and VOILA!

I've reinstalled the FTDI drivers and installed the Roland driver, but I hear nothing when outputting MIDI from the Arduino. XP > Control Panel > Sounds and Audio Devices > Audio > Midi music playback > Roland Serial MIDI Out A, still nothing... smiley-sad any ideas?
Logged

berlin
Offline Offline
Sr. Member
****
Karma: 0
Posts: 293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, i did a little research on a mac solution.

we don't have an .inf files ofr the driver, but still there is readable file inside sytem/library/extensions/FTDIUSBSerialDriver.kext.

you have to right-click that file and select "show package content".

the file named "info.plist" is an xml-like file which lists all available Baud Rates and much more.

i didnn't really understand the structure of the doument but added 31250 for midi support.

the block now looks like this:
Code:
<dict>
                        <key>BaudRates</key>
                        <dict>
                              <key>B115200</key>
                              <integer>57600</integer>
                              <key>B1200</key>
                              <integer>57600</integer>
                              <key>B19200</key>
                              <integer>57600</integer>
                              <key>B230400</key>
                              <integer>57600</integer>
                              <key>B2400</key>
                              <integer>57600</integer>
                              <key>B300</key>
                              <integer>57600</integer>
                              <key>B31250</key>
                              <integer>57600</integer>
                              <key>B38400</key>
                              <integer>57600</integer>
                              <key>B4800</key>
                              <integer>57600</integer>
                              <key>B57600</key>
                              <integer>57600</integer>
                              <key>B600</key>
                              <integer>57600</integer>
                              <key>B9600</key>
                              <integer>57600</integer>
                        </dict>
                  </dict>

the driver still works as normal. still i get no results with the geethree midi to serial tool, which is the same i think as the roland drivers.

i didn't yet find a way to prove that my changes to info.plist had any effect at all. no serial tool i know of offers 31.250 as a baudrate. anyone hay an idea how to go on?

as for the Roland serial-to-midi driver on your pc... did you have to select between "fast mode" and "standard 1MHz"? which one did you chose?

i asked a question over at the AVR-USB forum.
http://forums.obdev.at/viewtopic.php?p=679#679
it seems not too easy to offer HID-midi-support on arduino :-( at least for me. so i hope i can get this solution to work.

//kuk

(edited a typo)
« Last Edit: January 18, 2007, 02:12:39 pm by leKuk » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
yeah i've got this up and running... Reinstall the arduino FTDI drivers, install the Roland drivers, and VOILA!

I've reinstalled the FTDI drivers and installed the Roland driver, but I hear nothing when outputting MIDI from the Arduino. XP > Control Panel > Sounds and Audio Devices > Audio > Midi music playback > Roland Serial MIDI Out A, still nothing... smiley-sad any ideas?

ok well first you should have the MIDI Music Playback set to Windows midi player - what you are attempting to do is send MIDI data TO arudino instead of receiving it.

To actually get some sounds, you will need some sort of program that caputres MIDI data and does something with it.  To make some computer music, you will need use a program like Cubase or Ableton or even just a simple VST instrument. From a program like that, choose to input MIDI data from the Roland MIDI device, then the switches or whatever on the Arduino will be able to control the software.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
ok, i did a little research on a mac solution.

we don't have an .inf files ofr the driver, but still there is readable file inside sytem/library/extensions/FTDIUSBSerialDriver.kext.

Humm looking at the file you changed, I can't see it having the same effect. What you are setting in the .inf file are some divisors that calculate a baud rate based on a reference frequency. I'd email FTDI and ask about setting a custom baud rate with the mac drivers, if it can be done they are the best people to ask.

erik
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Look for [FtdiPort232.NT.HW.AddReg] and change the the second line below to the one that i've got here.

HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,60,00,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00



Which second line do you mean exctly?

1[FtdiPort232.NT.HW.AddReg]
2 HKR,,"UpperFilters",0x00010000,"serenum"
 3;HKR,,"ConfigData",1,01,00,3F,3F,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,0 3,80,00,00,d0,80
4 HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,60,00,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00


And the roland serial to usb is this the right vesrsion:RSDRV31W2K.ZIP???

thanxx




« Last Edit: February 16, 2007, 04:09:58 pm by alf » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't get Windows to use the Arduino version of ftdiport.inf that I've changed; it insists on using the XP version in oem5.inf.

Any tips to force Windows to use my version? Is there a place in the registry I can just add the MIDI baud rate?

Thanks!
« Last Edit: February 28, 2007, 08:32:09 pm by zvsmedia » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Any tips to force Windows to use my version? Is there a place in the registry I can just add the MIDI baud rate?

Try somewhere under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS... there you'll find the ConfigData binary key.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I don't know if it would be the same for all XP installations, but I made a .reg file people could use. Just paste this into a file, name it "foo.reg" (or whatever) and double-click it to merge it into the registry. (USE AT OWN RISK! REG HACKS CAN KILL YOUR INSTALLATION!!!! BACKUP YOUR REGISTRY FIRST!!!!)

---paste below---

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\VID_0403+PID_6001+A4001drJA\0000\Device Parameters]
"PortName"="COM4"
"PollingPeriod"=dword:00000000
"ConfigData"=hex:11,00,3f,3f,10,27,00,00,88,13,00,00,c4,09,00,00,e2,04,00,00,\
  71,02,00,00,38,41,00,00,9c,80,00,00,60,00,00,00,34,00,00,00,1a,00,00,00,0d,\
  00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,d0,80,00,00
"MinReadTimeout"=dword:00000000
"MinWriteTimeout"=dword:00000000
"LatencyTimer"=dword:00000010

---paste above---
« Last Edit: March 10, 2007, 10:36:42 pm by zvsmedia » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok tried installing everything as per in this thread but no luck on midi via usb yet smiley-sad
I noticed in that the FtdiPort232.NT.HW.AddReg trick seems to be pointing to port 232. But I've installed on com3 - is that a problem.
I hate to sound lame but I can't find an answer anywhere. Help appreciated smiley



- Using: Arduino Decimella
- Listening on: Roland Serial Midi Out (and tried the standard windows midi port).
- Port configured bits per second: 38400
- Code on Arduino (from http://itp.nyu.edu/physcomp/Labs/MIDIOutput)

// The switch is on Arduino pin 10:
#define switchPin 2
// Middle C (MIDI note value 60) is the lowest note we'll play:
#define middleC 60
//  Indicator LED:
#define LEDpin 4

// Variables:
char note = 1;            // The MIDI note value to be played
int AnalogValue = 0;           // value from the analog input
int lastNotePlayed = 0;   // note turned on when you press the switch
int lastSwitchState = 0;  // state of the switch during previous time through the main loop
int currentSwitchState = 0;

void setup() {
  //  set the states of the I/O pins:
  pinMode(switchPin, INPUT);
  pinMode(LEDpin, OUTPUT);
  //  Set MIDI baud rate:
  Serial.begin(31250);
  blink(3);
}

void loop() {
  //  My potentiometer gave a range from 0 to 1023:
  AnalogValue = analogRead(0);
  //  convert to a range from 0 to 127:
  note = AnalogValue/8;
  currentSwitchState = digitalRead(switchPin);
  // Check to see that the switch is pressed:
  if (currentSwitchState == 1) {
    //  check to see that the switch wasn't pressed last time
    //  through the main loop:
    if (lastSwitchState == 0) {
      // set the note value based on the analog value, plus a couple octaves:
     // note = note + 60;
      // start a note playing:
      noteOn(0x90, note, 0x40);
      // save the note we played, so we can turn it off:
      lastNotePlayed = note;
      digitalWrite(LEDpin, HIGH);
    }
  }
    else {   // if the switch is not pressed:
    //  but the switch was pressed last time through the main loop:
    if (lastSwitchState == 1) {
      //  stop the last note played:
      noteOn(0x90, lastNotePlayed, 0x00);
      digitalWrite(LEDpin, LOW);
    }
}

  //  save the state of the switch for next time
  //  through the main loop:
  lastSwitchState = currentSwitchState;
}

//  plays a MIDI note.  Doesn't check to see that
//  cmd is greater than 127, or that data values are  less than 127:
void noteOn(char cmd, char data1, char data2) {
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
  Serial.print(data2, BYTE);
}

// Blinks an LED 3 times
void blink(int howManyTimes) {
  int i;
  for (i=0; i< howManyTimes; i++) {
    digitalWrite(LEDpin, HIGH);
    delay(100);
    digitalWrite(LEDpin, LOW);
    delay(100);
  }
}


« Last Edit: October 13, 2007, 01:06:47 am by asterix » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Has anyone actually gotten any iteration of this to work in OSX?

Or does anyone know of anyone working on a driver solution specifically for the Arduino MIDI crowd?
Logged

Pages: [1] 2 3 4   Go Up
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines