i2c2midi – a DIY module that translates I2C to MIDI

The general idea would be to calculate the amount of pitch bend needed for gliding to the next note, and then use I2C2MIDI’s NRPN slewing feature to set the timing.
Something along these lines (not tested and writing without beeing in front of TT):

J WRAP + J 1 0 3        // counter for a 4 step sequence
K - PN 1 + J 1 PN 1 J   // calculate interval between current note and next note
X + * / 8192 12 J 8192  // calculate pitch bend amount
I2M.NRPN.SLEW A B 200   // set pitch bend duration
I2M.N PN 1 J 127        // play current note
DEL T: I2M.NRPN A B X   // send pitch bend message a bit later

A and B would be the MSB and LSB of the pitch bend message; T would define when the gliding starts …

As mentioned above, I haven’t tried this myself, but maybe it gives you a starting point for experimenting … :wink:

3 Likes

It definitely gives me a starting point! I’m excited to give this a try. I’ll report back if I’m successful. Thanks a bunch!!!

I got my missing pcb in the mail the other day and finished my build!
The REG1117 I used is working as a substitute for the LM1117.

On another note: I accidentally uploaded the I2M Teletype firmware incorrectly, and when I opened the scenes menu it gave me this very cool pattern. I eventually figured out I missed the critical step of pressing the button after the upload is completed :sweat_smile:

4 Likes

this would make some great album art. thanks for your mouser BOM, that was super helpful, I just ordered all the parts for this build!

1 Like

Finished my build over the weekend (thank you again, @attowatt!) and for anyone thinking about doing this as a first project it’s totally doable. Couple of hours start-to-finish and very few places where you can trip up along the way.

Now that I’ve got it racked I’ve got a new question :sweat_smile: Hoping someone here has a perspective.

My intention is to use this in conjunction with my DAW so I was just going to drill a hole in the side of a case and run a cable from the teensy USB port to my computer. Now that I’ve got it in hand, however, I’m wondering if I could use this cable from the TRS out to something like this to handle the USB in on my machine.

I’ve got this dream of being able to freely switch between my computer and other MIDI stuff so it would be kind of a dream to be able to do this without the extra step… but I realize I’m fairly clueless about the workings of USB MIDI.

2 Likes

That should work fine. While I don’t have i2c2midi in my rack, I do have plenty of modules that speak midi over TRS, and I do TRS → DIN adapter → Mio USB → laptop all the time.

1 Like

@new_moon Awesome to hear that your build was successful! Congratulations!

Yes, as @3-foot-1 pointed out, this is absolutely possible.
I use the similar M-Audio Uno USB MIDI interface myself. Make sure to use a Type A adapter for TRS to DIN.

Enjoy!

i2c2midi Firmware v5.0.0

With the release of the new Teletype 5.0.0 beta, I am celebrating the inclusion of the I2M OPs with a firmware update for i2c2midi of the same name (v5.0.0).

It comes with some minor refactoring and two new OPs.

This i2c2midi firmware works with TT 5.0.0 BETA 1.
Both new OPs are included in 5.0.0 as well.


:mute::sound: MIDI Channel Mute & Solo

With these two new OPs you can mute or solo individual MIDI channels. If muted, all outgoing MIDI messages on that channel are stopped. If soloed, only MIDI messages on that channel are beeing sent, all other messages are stopped.

From the docs:

  • I2M.MUTE x
    Set mute state of current MIDI channel to x. If x = 1 all outoing MIDI messages on that channel are muted. Default is x = 0.

  • I2M.MUTE# ch x
    Set mute state of MIDI channel ch to x. If x = 1 all outoing MIDI messages on that channel are muted. Default is x = 0. Use ch = 0 to set for all channels.

  • I2M.SOLO x
    Set solo state of current MIDI channel to x. If x = 1 all outoing MIDI messages on that channel are soloed. Default is x = 0.

  • I2M.SOLO x
    Set solo state of MIDI channel ch to x. If x = 1 all outoing MIDI messages on that channel are soloed. Default is x = 0. Use ch = 0 to set for all channels.


:toolbox: Download

Download the firmware here:
https://github.com/attowatt/i2c2midi/releases

11 Likes

Just built an i2c2midi with a teensy 4.1 and trying to flash the newest v5 firmware I keep getting these errors? Only the bottom led on the module flashes 4 times when its done compiling.

Could you please try to compile and upload the firmware using Teensyduino?

The firmware is comprised of multiple .ino files, which might confuse external compilers.

For reference, this is the expected output that I get here. The four warnings I get are not so nice but can be ignored as long as the Compilation is successful.

Output
midiBuffer: In function 'void checkBuffer()':
midiBuffer:41: warning: comparison between signed and unsigned integer expressions 
   if (bufferElapsedMicros >= bufferSpeed * 10) {            // default bufferSpeed of 100 * 10 = 1000, so 1 bufferframe per millisecond
                           ^
midiBuffer:45: warning: comparison between signed and unsigned integer expressions 
       if (bufferFrame >= bufferLength - bufferEndOffset) {  // when reaching the end of the buffer...
                       ^
midiBuffer:57: warning: comparison between signed and unsigned integer expressions 
       if (bufferFrame <= 0 + bufferStartOffset) {           // when reaching the start of the buffer...
                       ^
midiChord: In function 'int playChord(int, int, int, int, int, bool, bool, byte)':
midiChord:82: warning: control reaches end of non-void function 
 }
 ^
Opening Teensy Loader...
Sketch uses 63868 bytes (6%) of program storage space. Maximum is 1048576 bytes.
Global variables use 83732 bytes (31%) of dynamic memory, leaving 178412 bytes for local variables. Maximum is 262144 bytes.

1 Like

Got it up and working today. Thanks for the suggestion! Awesome module, can’t wait to dive in.

2 Likes

I was testing out the I2M ops in the new teletype 5 beta and noticed the entire i2c bus crashed every time I added more than one note to a chord.

All very odd as every other op seems to work without a problem and I ran a patch for several hours using just I2M.N :person_shrugging:

After removing everything else from the case and downgrading the firmware, I’m thinking this is a hardware issue :melting_face:

Before just scraping the build and try again I thought I’d attach a picture of my module. I’m a very inexperienced DIY-er so maybe there’s just something obviously wrong? Welcome any guesses.



Some of the solder joints look a less than optimal. Too much solder on some, not enough contact with the pads on some. Could very well be a bad joint causing your issues. I would get some flux on those joints and reheat the solder until it pools properly on each joint. If you have too much solder on a joint (if it’s heaping upwards or outwards from the pin), use a solder sucker and try again with flux. Less is more with solder.

I had this issue when I first started soldering. It’s hard to get the solder to sit on the pad and so it’s very easy to keep adding more until it seems ok. Flux was the answer for me. Plenty of it

3 Likes

To add to what @Byzero said, it also looks like you forgot to solder these five pins:
IMG_0088

I also tried reproducing your issue and I’m getting a crash too.
I also tried downgrading to the previous teletype I2M and teensy firmware and removing all other modules from the I2C bus. Same results with that as well.

I’ll poke around on mine and see if there’s any mistakes I missed. Maybe there was something off with the Mouser cart I used and recommended to you? Sorry if I ended up playing a part in causing this trouble.

1 Like

Thank you both. Will pick up a solder sucker this week and see what I can do. Not totally shocked to learn my build was less than perfect :dotted_line_face:

Interesting! And, please, don’t apologize about the cart. This is a cool puzzle tbh.

Well I am at a loss as to what’s causing the crash with the chord op. I’ve been looking over my build the past few days, reflowed and touched up some solder joints, and cleaned some flux that I missed the first time around. I also looked over the Mouser cart I used and the components are the right values.

The only part that I think might be the cause of the problem is the REG1117 that I subbed for the LM1117. Both are low dropout regulators with almost identical specifications. Maybe the REG1117 is causing power issues further down the line and is causing the instability with the I2C bus? What regulator did you use in your build @new_moon?

If that is the root of the problem, I find it strange how it is only effects to the chord ops. I’ll take some more time to test if any of the other ops will cause a crash. At least I can still use it for mono purposes with my SY-1M :slight_smile:

Funny timing; picking up a solder sucker is on my list of things to do today.

Complicating (but possible good?) news: I actually used an LM1117 so it’s likely not the regulator? I’ll follow up when I’ve touched up the build but other than the regulator I was straight out of your cart.

1 Like

Very peculiar. I will test again over the weekend.

Two more follow up questions:

  • You are using Teensy 3.6 or 4.1?
  • In your test scene, what MIDI channel are you using?

Teensy 4.1 and I’ve had the crash across all the MIDI channels

1 Like

I’m using a Teensy 4.1 as well. I’ve tested every MIDI channel for both TRS and USB, all of them cause a crash.

1 Like