Hans Rev B

Hans Rev C

Github: GitHub - nordseele/hans: OSC and MIDI over i2c for Eurorack modules ER-301, TXo, etc. i2c to MIDI for Teletype, and more...


Description

A Raspberry Pi, an add-on board and a bit of Rust forming a kind of i2c, MIDI, OSC hub / swiss knife. OSC to i2c, MIDI to I2c, I2c to MiDi etc. It talks to TXo, ER-301 etc, receives input from Max, Lemur, Roli Blocks, Serial MIDI, USB MIDI

Features

Implemented and tested
  • OSC to I2C
  • MIDI to I2C
  • MIDI over Bluetooth
  • USB MIDI
  • Serial Midi
  • I2c to Midi (Teletype)
  • Power (w/ protection) from the 5v rail of a Euro case

31 Likes

Still can’t seem to be able to DM you, so here’s my super enthusiastic post as usual! :grinning:

1 Like

All I get is ā€œThis user’s public profile is hidden.ā€ and I have no idea how else to DM, but really I don’t have much to say other than that I’m super enthusiastic about this project, I’m eager to beta test whatever you send my way, I wish I could help with JS but unfortunately I can’t, but I can help with documentation, and that and beta testing the hell out of Teletype (the only i2c device I have) and MIDI devices is definitely on the table.

Also :partying_face: :partying_face: :partying_face: :partying_face:

2 Likes

Thanks :blush: writing some documentation will be hard task, I really appreciate your offer to help. The new revision of the PCB will add a header for a specific I2c bus for Hans (the Raspberry Pi) to act as a follower.

It’s been tested successfully but it is not a real pass-thru. Teletype will trigger some scripts on the RPi, or trigger some MIDI functions for example. All of this needs to be determined.

I double checked and my profile on Lines says that the users are allowed to contact me :man_shrugging:

Sounds fantastic. I honestly think you have a winner here. I’ve seen a few people express interest in i2c <> MIDI connectivity and a translator which a) gets power from the bus, b) can accept blue-tooth MIDI, c) can bring in contact so many things, will definitely garner interest.

Any chance that it would be possible (via the editor) to set the MIDI out pin to merge any incoming messages of the MIDI in pin with any MIDI messages created via the i2c > MIDI translation? I know it’s probably too early, but I’m dropping this here and we can revisit this again when the time comes.

:partying_face:

1 Like

Yes it’s possible. That’s why it’s so hard to provide a description for this project, many things are possible. I’ll add that to the list. Right now I really need some help implementing all this, not because I can’t, but because of time and what takes a minute for a professional developper can take a bit longer for me.

Theoretically it is possible to - interlink - all the inputs and outputs and protocols showed on the diagram. I implemented the basic stuff. What I needed for OSC and MIDI to I2c you know. I just put together the basic hardware and the work of other people who have created some node.js layers for MIDI, OSC, I2C and even PIGPIO (used for the I2c follower feature)

That being said, I2c to midi is not the simplest, the I2c follower thing is still experimental, it’s working but a raspberry pi is a Leader normally, that’s why we’re using a third bus for Ā«I2c follower mode Ā», well there’s a branch for that but you’ll need to send some I2c commands to Hans, you’ll have to use the generic II ops provided by Teletype and set a custom address. But technically it’s possible. It’s been tested already. It would need the same kind of midimap.js I’m using for midi to I2c.

On a side note, The code is not looking great at the moment, hmm that’s embarrassing :disappointed: but the concept exists , so does the hardware, it’s just a matter of putting all this together.

2 Likes

sounds super awesome!

1 Like

This sounds amazing, super excited to see the project released!

1 Like

That’s exactly what I expect.

  • You’d set up Hans’s Raspberry Pi to act as a follower, and use the third bus ā€œi2c followerā€.
  • You’d need to use the generic ops on Teletype which will be acting as a leader on i2c bus
  • You’d nee to use a mididmap.js to tell Hans how to handle the incoming i2c messages and how they ought to be mapped to MIDI messages at Hans’s MIDI output pin.

I am not familiar with the process of setting up a custom address but I’ll look into how that is done. I’ll also read up on i2c leader/follower set up, although I thought I understood the basics, I’m not sure I do since I didn’t know there is a need for different headers. Better refresh my memory!

I’m also curious, did you figure out if there’s indeed ā€œconflictā€ between the serial MIDI connectivity and the BlueTooth one? If I recall correctly you mentioned that there might be some problems introduced if both are used at the same time, but that was an assumption before you received the second revision boards. Curious what the result was.

The third I2C header on Hans/RPI is actually an interface to the SPI/I2C Slave peripheral on the BCM chip. This peripheral allows the Pi to act as a hardware slave device on an I2C bus (cf bscXFER). This is not possible with the two other i2c busses exposed on Hans, they can’t switch from leader to follower.

bscXfer and bsci2c (bit banged i2c) are the only solutions I found to make the PI act as an i2c follower. And it was quite difficult to find a node layer for Pigpio implementing these two specific functions.

This is done in the init script of Teletype (see II Generic ops). The address chosen also needs to be set in a variable in the JS code.

Moving the bluetooth connection from the primary UART of the Pi to the secondary one is needed indeed in order to make the primary UART available for serial MIDI. This doesn’t seem to cause any conflict. This ā€œslowerā€ bluetooth is still fast enough to handle incoming MIDI.

1 Like

I have some moderate JS chops, am pretty comfortable with async/Promises, and might be able to help a bit. However, I’m not sure whether this is compatible with my i2c-speaking hardware (a crow and a W/) or how I’d go about hooking it up.

1 Like

Thanks @license

Hans is already compatible with Crow - and probably W/ and JF too - and should be able to communicate via ii with any follower. [1]

Some commands for Crow are already present in assets/commands.js but not tested yet. [2]

Those for W/ and JF were also present at some point but not owning these modules and therefore not having the ability to test, I removed them. It’s also important to mention that nothing is implemented yet to deal with a potential response received from ā€œfollowersā€ modules. This is also why i removed the ā€œgettersā€ commands at that time but now I want to give it another try (will probably do that with Crow today).

What I did is very basic, it writes to the bus but it doesn’t read, though the i2c node.js module is very capable of doing that, in an asynchronous way etc.

This is on the ā€œtodo listā€, but the actual code probably needs to be refactored before doing so, especially all the callback functions. I implemented things very quickly, sometimes copying and pasting from the docs of the Node modules used and the result is working but not clean. Anyway, I will test with Crow and report back.


[1] The fun fact is that there’s no need of the add-on board for that. Connecting three wires to the GPIO of any Raspberry PI, changing a line in settings.js and that’s it.

[2] I’m testing Hans with Crow right now. I can confirm that the connection via i2c is working, I’m sending OSC (i.e: /crow/1/output/1 $1) from Max and the RPI is connected to Crow. The voltage changes on output 1, as expected. (I’m glad it’s working actually, never tried that before) I will also try to get values from Crow.

Capture d’écran 2020-09-22 Ć  11.49.46

2 Likes