Author Topic: AXE midi out adapter  (Read 9060 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
AXE midi out adapter
« on: November 12, 2011, 04:31:56 am »
Hey guys! I'm working on a midiadapter for the TI 83 series calculators. The hardware is neary done (need a midi socket) I found this code on the arduino website:
Code: [Select]
void setup() {
  //  Set MIDI baud rate:
  Serial.begin(31250);
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int note = 0x1E; note < 0x5A; note ++) {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    delay(100);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00); 
    delay(100);
  }
}

//  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(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}
I wonder what the output of this code is (in binairy) so that I can write a midi routine in axe.
If you like my work: why not give me an internet?








Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: AXE midi out adapter
« Reply #1 on: November 12, 2011, 04:38:23 am »
Looks pretty easy, just a serial protocol :)
I don't know how easy it is to do with a TI-83, but its quite simple.
You should look first at making it output serial data, sending the bytes together with the stop bits at the right bitrate.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #2 on: November 12, 2011, 04:47:06 am »
Looks pretty easy, just a serial protocol :)
I don't know how easy it is to do with a TI-83, but its quite simple.
You should look first at making it output serial data, sending the bytes together with the stop bits at the right bitrate.
Serial.begin(31250);
That is the bitrate in bits/second. 31kHz is very high. I might have to use a microcontroller to speed up the signal.
Where should I put the stop/start bits exactely?
If you like my work: why not give me an internet?








Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: AXE midi out adapter
« Reply #3 on: November 12, 2011, 04:55:48 am »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #4 on: November 12, 2011, 05:03:47 am »
Take a look at this: http://patents.ame.nd.edu/microcontroller/main/node24.html
and this
http://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter

UART and RS-232 are your keywords :)
So a start bit is logic 1 and a stop bit is slightly longer than a normal bit and logic 0. What does logic 1 mean? No current flow? (I'm confuses about inverted signals :P)
If you like my work: why not give me an internet?








Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: AXE midi out adapter
« Reply #5 on: November 12, 2011, 05:08:14 am »
I'm not sure, but I think high is one.
Also 31250 is not really the bit rate, but changes/sec (unit is baud) ^^

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #6 on: November 12, 2011, 05:10:50 am »
I'm not sure, but I think high is one.
Also 31250 is not really the bit rate, but changes/sec (unit is baud) ^^
So is it doable using axe?
If you like my work: why not give me an internet?








Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: AXE midi out adapter
« Reply #7 on: November 12, 2011, 06:10:33 am »
I don't know, since I don't know how good you can control the port from axe.
I'm not a z80 guy ^^

« Last Edit: November 12, 2011, 06:11:21 am by jimbauwens »

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #8 on: November 12, 2011, 09:51:31 am »
I should get an arduino :p Solves every problem.
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: AXE midi out adapter
« Reply #9 on: November 12, 2011, 02:04:03 pm »
Interesting. Would it let you use for example a calc as a midi keyboard or just an actual midi keyboard to play music on your calc?

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #10 on: November 12, 2011, 02:05:57 pm »
Interesting. Would it let you use for example a calc as a midi keyboard or just an actual midi keyboard to play music on your calc?
It sends midi notes to an external midi device.
If you like my work: why not give me an internet?








Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: AXE midi out adapter
« Reply #11 on: November 12, 2011, 02:12:41 pm »
Ah ok cool :)

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: AXE midi out adapter
« Reply #12 on: November 12, 2011, 02:16:45 pm »
It will support all midi features I hope so it's gonna be awesomesauce if it works. Shootout to thepenguin77 for his UART axiom.
If you like my work: why not give me an internet?








Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: AXE midi out adapter
« Reply #13 on: November 12, 2011, 04:34:32 pm »
Does it need a special midi cord or something?

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: AXE midi out adapter
« Reply #14 on: November 12, 2011, 04:47:45 pm »
Sounds awesome. I have an Arduino, I might try it. Or even help.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.