Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 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:
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.
-
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.
-
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?
-
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 :)
-
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)
-
I'm not sure, but I think high is one.
Also 31250 is not really the bit rate, but changes/sec (unit is baud) ^^
-
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?
-
I don't know, since I don't know how good you can control the port from axe.
I'm not a z80 guy ^^
-
I should get an arduino :p Solves every problem.
-
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?
-
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.
-
Ah ok cool :)
-
It will support all midi features I hope so it's gonna be awesomesauce if it works. Shootout to thepenguin77 for his UART axiom.
-
Does it need a special midi cord or something?
-
Sounds awesome. I have an Arduino, I might try it. Or even help.
-
Does it need a special midi cord or something?
No, but you gotta build a small piece of hardware. You need a 1k, 220 and 800 ohm resistor, a 9v battery, a midi socket,a 2.5mm plug socket and a pnp transistor
Sounds awesome. I have an Arduino, I might try it. Or even help.
No arduinos involved, but thank you for the offer.
-
It doesn't work. I will check the signal with a digital osciloscope.
Edit: I think it's the hardware. I don't have a clue :( Every site tells me to do it differently :(
-
Maybe the signal polarity is wrong (reversed), you could check that again.
-
Nope I know what's wrong! Midi parameters are 7 bits instead of 8 bits!
The first parameter (command and channel) is 8-bits, but the following two are supposed to be 7 bits long!