Jump to content
IGNORED

Proof of concept: mt32-pi UDP MIDI via TIPI


Recommended Posts

So, the mt32-pi project supports MIDI over UDP socket, and TIPI supports UDP sockets... Seems like a natural fit...

 

mt32-pi project: https://github.com/dwhinham/mt32-pi/wiki

 

Some example TI BASIC code that produces a MIDI scale. The CALL SOUND is used just to create a delay with no audible sound output from the 4A. The sound in this example only comes from the mt32-pi.

 

99 REM Connect to mt32-pi UDP port
100 OPEN #1:"PI.UDP=192.168.1.39:1999",DISPLAY ,OUTPUT
109 REM A simple scale
110 FOR I=60 TO 71
119 REM play note I
120 PRINT #1:CHR$(145)&CHR$(I)&CHR$(64)
129 REM wait 350ms
130 CALL SOUND(350,44733,30)
139 REM terminate note
140 PRINT #1:CHR$(129)&CHR$(I)&CHR$(64)
149 REM wait 150ms before looping back
150 CALL SOUND(150,44733,30)
159 REM go back to next note
160 NEXT I
199 REM close the UDP socket
200 CLOSE #1

 

The mt32-pi is running on a different PI than the TIPI, just to be clear.

  • Like 9
Link to comment
Share on other sites

1 hour ago, Vorticon said:

Very cool concept. Apologies for my ignorance, but would it be possible to add the mt32 module to the TIPI Rpi and use it that way instead of having a separate RPi and mt-32 on the network?

 

It would be possible to put the Linux version of fluidsynth or/and munt on the TIPI Linux. But mt32-pi is not possible as it runs baremetal (without Linux) on the PI.

 

You could also setup UDP MIDI to any Desktop (laptops are also desktops) type machine..

 

I just did the opportunistic thing as many retro fans might have an mt32-pi setup for their MiSTer

 

I cannot distribute what is required to run munt, so I won't be doing that.

  • Like 2
Link to comment
Share on other sites

2 hours ago, jedimatt42 said:

It would be possible to put the Linux version of fluidsynth or/and munt on the TIPI Linux. But mt32-pi is not possible as it runs baremetal (without Linux) on the PI.

 

You could also setup UDP MIDI to any Desktop (laptops are also desktops) type machine..

 

I just did the opportunistic thing as many retro fans might have an mt32-pi setup for their MiSTer

 

I cannot distribute what is required to run munt, so I won't be doing that.

Thanks for that info Matt.  I looked over the details for the mt32-pi and came to a similar thought and realized that particular path was not something I wanted to pursue for myself.  Also, I saw the push buttons on the mt32-pi hat for the PI and the pricetag of about $100 for a 3D for an enclosure on one website that pretty much killed any last bits of potential desire.

 

@jedimatt42 Is there a MIDI option (software preferably) that has the potential to work with the current TIPI-PI interface?  I'm thinking here of something that would play MIDI sound files versus being able to record with the simplest option of plugging speakers into the PI.  I don't know if there is a way to feed/redirect the UDP stream back to some software running on the PI.

 

Beery

 

Link to comment
Share on other sites

My point with this is to show how easy it is to use the existing feature of TIPI UDP or TCP socket support to integrate with other things... 

 

I personally am running mt32-pi without anything other than the PI 3B+ that I had sitting around. No hat. The only thing I brought to the party was an SD card and 3.5mm stereo patch cord to my mixer/speakers.

 

I have run Fluidsynth and Munt on Linux on a PI before, but a power outage killed that sd-card, and I recorded my steps poorly. I did this following some blog post to experience the Sierra games on the Amiga with MT32 MIDI music. There are also freely available tools to route midi data from TCP or UDP to these things, or to usb connected midi adapters, etc... 

 

I am not trying to provide anyone a MIDI solution. I don't know anything about music, except that I'm unqualified to tell you how you should do it. MIDI is a huge eco-system of software and hardware. I'm just showing how with what some folks already have, you might choose to connect the two.

 

 

 

 

  • Like 2
Link to comment
Share on other sites

[Really needs to just sit down, and write a UDP socket handler to arbitrate the Linux MIDI subsystem, and present it to the TI.]

 

Conceptually, the only thing preventing arbitrary, full syntax midi over UDP to the Pi (including real hardware devices on a midi cable), is just the damn handler running on the Pi.  That's it.  A simple shell script that wraps amidi would work. (It supports sending raw messages to/from a device)

 

http://manpages.ubuntu.com/manpages/impish/man1/amidi.1.html

 

 

(I would implement it as an init.d style daemon script, with start, stop, and restart syntax sections inside.  It would create a dedicated UDP socket in the user ports range, then listen on it.  It would have an internal syntax to probe the midi chain, select a midi device to talk to, etc--- and then otherwise do nothing but route a message to a specified device (with possible ACK or other return message).  Again, amidi would be an excellent pre-baked application to simply put a wrapper on. BASH is more than fast enough to provide midi messages in a timely manner.)

Edited by wierd_w
  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...