Extra midi io via UART not working in standalone mode


#5

Hmm, Here's my pinout for connecting a Teensy to Axo UART

UART (Midircv) Teensy pin 0, Axo PA2 Rx
UART (Midisnd) Teensy pin 1, Axo PA3 Tx

Pretty sure I don't use a resistor in there since it's UART circuit, not a proper Midi one. I burn my patches to firmware and don't use SDCards. I'll post it later if I remember.


#6

I have the same setup from Arduino Due to Axo, all works fine until changing patches on SD Card.
Maybe connecting TX directly to midi in din, will show whether or not the TX from Arduino is doing its job.


#7

I have now completed testing direct connection of Arduino Due TX to Axoloti Midi in din, and this works perfectly.
So this then gives two possible scenarios for Axoloti uart extra midi io failure when changing patches in standalone mode.
1 - The uart serial connection is lost.
2 - The code for reading the RX data and sending the midi data into the midi system fails.

Tommmorrow I will test the recieving of UART data directly without the midi interpretation object. The midi data sent from the arduino is always strictly control change data type with data1 and data2, so I should be able to read this consistantly as 3 bytes and interpret it into my object, of course if all works out.

But of course for now, I have a work around option that also confirms that all data is being sent correctly from the Arduino.

:stuck_out_tongue_winking_eye:


#8

Hi Gavin I remember using @Hugo's extra midi io objects to send midi between 2 axo boards and it worked well, also in standalone mode. Did you text it with two axos? If that would work it could mean the problem is on the arduino side.


#9

Thanks @Blindsmyth, I only have one Axo, so can't test that one.
The Arduino side works perfectly, my last testing in the post above, I went from the Arduino TX pin to the Axo Midi In Din, and it all works perfectly.
As for the extra midi io setup, it only fails when changing patches in standalone mode, the first startup patch works perfectly, but the opening another patch from the startup patch, the patch opens and starts fine, there is just no control.
Do you know if your setup worked when changing patches in standalone mode ?

Tonight I plan on testing instead of the Midi data from the UART being sent into the midi environment, I am going to see if it works send the midi data out of object outlets instead, if this works, then it means there is something wrong in the object that sends the UART data into the midi environment.
When I refer to midi environment, I mean where you can nominate a CC value to parameter etc with the inbuilt midi setup. There is the object that sends the UART data into the inbuilt midi environment, this is where I may be experiencing the failure, but want to test for it to be sure.
:grin:


#10

Ah, I've just remembered something. If I upload a patch on the Axo I have to power cycle the Teensy to reinstate the UART. It drops out every time.


#11

Just finished more testing.
Firstly I though maybe doing a serial.end() to serial.begin() might do a reset enough to re-connect the uart, it failed.
Then I have tried reading the data directly off the uart pin as I mentioned above, this did not work either.

@mongrol, your experience with the teensy dropping out could be very well related, but I cannot power cycle the arduino because all my menu's are programmed into it, Restarting it would take me back to the beggining of my menu, so this is not an option.

But one thing is for sure, The Arduino Due TX pin can be wired directly into the "Axoloti Midi In 5 pin Din" (try saying that 5 times realy fast.. :stuck_out_tongue_winking_eye:) works perfectly at al times.

So this is my solution for now, yes it takes up a midi input, but at least it still leaves with the USB midi input if needed.

And believe it or not, this issue is my last final major core hurdle to get over in my setup, everything else is just building some more hardware with switches and tidying up some of my messy coding. Will add it all to my project page when i get it all cleaned up.

I hope this documentation is useful to anyone else experiencing similar issues.

No more testing from me on this one for quite a while.
:zipper_mouth_face:


#12

Axoloti MIDI IN 5-pin DIN
Axoloti MIDI IN 5-pin DIN
Axoloti MIDI IN 5-pin DIN
Axoloti MIDI IN 5-pin DIN
Axoloti MIDI IN 5-pin DIN
Make the connection and
WIN WIN WIN


#13

You can actually still use the 5 PIN MIDI IN while connecting to the back of it. I done some tests throwing a ton of MIDI from my Midibox to it while changing parameters from my Teensy plugged into the back. Didn't drop a beat.

EDIT: Actually, I lied. After looking back at my history to remind my aging brain I realise I've said teh exact opposite of reality.

I DID have trouble mixing signals from the back of teh MIDI.

I DID put a 220ohm resister in play.

Might be useful reading through my synth progress. here


#14

I thought something similar, but I thought what might be better is to have the midi go to the Arduino (in your case the teensy) before sent to the Axo, that way the midi packages can be forwarded as they arrive and then any other messages can be surely kept separated.


#15

yeah that is VERY likely to fail. midi at that point (the connector) is only an electrical signal, so merging electrical signals to afterwards interpret into messages will fail as soon as two messages overlap. :slight_smile:


#16

@Gavin
I didnt change patches in my setup, so I can't say anything about that.

I'm going midi pin to pin with my axolotis as well works really well.
You could still use something like a midi merge box or even collect more midi input with the arduino somehow?

Or use a usb midi interface if you don't need the usb port for other purposes.


#17

swwwwweeeeeet.
I'm relieved to hear that this worked. It definitely makes things a lot easier to wire having this as an option. I'm using a Teensy to send midi to my board and having the ability to wire directly to it and then only have to make a couple connections from the Teensy to the Axoloti board seems like a safe option....I'm super curious as to what the header pins on the Axoloti board are for though....havn't been able to find documentation on them yet and if they turn out to to be some sort of alternate input ill kick myself lol


#18

I'm planning to add a midi DIN i/o to the Axo and think these are the pins... PA2, PA3 (confirmation needed). I'll use 220R resistors on both send/rcv and a 6N137 optocoupler on the DIN in (RX) line... this I hope will work and be class compliant midi in out. I also use arduinos and teensys so this thread found me.. :wink:


#19

This will verify the pins for you so you always have something to refer too..

What devices do you intend to connect ?
What Axo object will you use to translate ?

Remember, I raised this thread because PA2 and PA3 loose connection when changing patches in standalone mode..
:stuck_out_tongue_winking_eye:


#20

@Gavin having read this thread again, I'm not sure I can use your 'fix' since I am already using the factory midi DIN? :frowning: (Edit: I am such a newbie... I thought I could just wire into the TX/RX pins and go. Obviously not thinking clearly at all and now realize without using the @Hugo extra_midi_io object, the serial port won't be setup and I won't have anything. Apologies for my lack of insight)
I certainly don't like the idea of adding another DIN only to have it drop out every patch change. I'm currently sending midi from a keyboard and a DIY controller(s) that use arduino boards (due, uno, teensy) to both USB and DIN. I use the midi/in/keybd and midi/in/cc objects.

I'll try connecting like this... (Edit: ...and use the extra_midi_io patch)


#21

If you are going from a Teensy or Due to Axo, you don't need to use a 5 pin din at all, just link the TX/RX with Axo RX/TX, as they are both 3.3v, you just need to join the grounds so the reference remains level. If you are using a Uno, if this is 5v you will need a logic converter.
I have some ideas for a new object that might work, but I am far from having the time to implament.
If you want to have a go, the idea is, I would start with just reading CC messages first, use the factory RX object, recieve three packages after reading and confirming the first one is a control change status byte then read data byte 1 and 2. Then split the status byte into 2 parts, one half to read the status, the second half to read the channel. So now you have 4 parts, status, chanel, cc, value. Then send the three messages chanel, cc, value out into a "internal midi send" object, and that should be sufficient to get the data into the Axo. Test it, test it with standalone patch change etc...
:grin:


#22

Hey,

4 Years later and I got to try this in my setup: 2 axolotis interconnected with pin PA2-PA3 sending midi to eachother via uart. I tried changing patches on one in standalone while the other is connected to patcher to send midi and monitor incoming midi and it works flawlessly.

I used self made objects based on @Hugo's scripts.

patch4.axp (6.7 KB)


#23

OH! going to try this


#24

If you wanna send midi via uart you have to make your own objects. its quite simple:
you put this in local data

int32_t lsend;
int timer;
// this is for the cc thin object

void SendMidi3(uint8_t b0,uint8_t b1,uint8_t b2){
sdPut(&SD2,b0);
sdPut(&SD2,b1);
sdPut(&SD2,b2);
}
// this defines your midi string

and then you just modify the normal midi objects and replace MidiSend3 with SendMidi3 (what you defined in local data)

Another more lazy way is to route all midi you wanna send via UART out to the internal bus, and then just hack a midi thru object to take all that data and route it the Uart.
But If you use the script that takes incoming midi from UART to internal you might have feedback issues, thats why I went for modifying the midi out objects.