Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Midi Support to FS-UAE using the PortMidi library. #209

Merged
merged 3 commits into from
Mar 3, 2020

Conversation

cnvogelg
Copy link
Contributor

  • supports macos, Linux, and Windows

  • automatically gets activated on Amiga serial port with midi baudrate

  • adds both midi in and out connections

  • full midi command support including sysex

  • allows to configure the in/out ports in config with:

    serial_port = midi:<out_port>[,<in_port]

tested on macos and Ubuntu 18.04. resolves #30

* supports macos, Linux, and Windows
* automatically gets activated on Amiga serial port with midi baudrate
* adds both midi in and out connections
* full midi command support including sysex
* allows to configure the in/out ports in config with:

    serial_port = midi:<out_port>[,<in_port]
@FrodeSolheim
Copy link
Owner

Thanks, this looks good and is a great addition to FS-UAE, I will merge into master soon :)

@rofl0r
Copy link

rofl0r commented Jul 17, 2019

wouldn't it be better to add this to winuae ? so other projects that sync winuae sources could profit from it as well.

@cnvogelg
Copy link
Contributor Author

Hi @FrodeSolheim, great to hear that you like my contribution. I am really looking forward to have midi in the official fs-uae builds...

@rofl0r, winuae already has midi support for years now. Unfortunately, this midi module is using Windows midi calls directly and therefore not portable. That's the reason why I wrote a new, portable one for fs-uae

@rofl0r
Copy link

rofl0r commented Jul 17, 2019

Unfortunately, this midi module is using Windows midi calls directly and therefore not portable

aww, but maybe @tonioni would be interested in having a portable version regardless ?

@FrodeSolheim FrodeSolheim merged commit 57fc25e into FrodeSolheim:master Mar 3, 2020
@FrodeSolheim
Copy link
Owner

Thanks again, finally merged :) So it will be included in the upcoming develoment release. Will try with a WHDLoad Sierra game now, I assume that should work with munt/mt32emu :)

@FrodeSolheim
Copy link
Owner

Works :D

It took a little debugging to get started, mostly because PortMidi did not represent devices like I expected to. I brought up Munt on alsa port 128:0 on Linux, but I had to use config serial_port = midi:Standard to get output on correct port.

I had the following devices on my system (and no indication on what "Standard" is):

MIDI: found devices: 3
MIDI: 0: 'ALSA', 'Midi Through Port-0'       OUT  
MIDI: 1: 'ALSA', 'Midi Through Port-0'  IN *     
MIDI: 2: 'ALSA', 'Standard'       OUT *

Anyway, that's not really a problem with this implementation, just something that needs to be improved at bit w.r.t. user friendlyness. But could simply be documentation. Or possibly some GUI in the Launcher. But initially, just documenting how to find/select the right device (and serial port option string) should be good enough. And run some additional testing on macOS and Windows :)

@FrodeSolheim
Copy link
Owner

FrodeSolheim commented Mar 3, 2020

I also added some minor changes to the MIDI code, the may change was to make midi_open a function without arguments (for compatibility with other UAE code) and a couple of compatibility functions to allows this to compile with WinUAE code that has been pulled in in the meantime.

4d928c2

@cnvogelg
Copy link
Contributor Author

cnvogelg commented Mar 4, 2020

finally :) glad to see the merge on master...
As I said feel free to adjust the code so it fits your needs...
And yes, configuration is a bit low-level, but does its job. Documentation will help others to use it.

@cnvogelg cnvogelg deleted the midi branch March 4, 2020 07:27
@Newk77
Copy link

Newk77 commented Mar 6, 2020

very cool!! going to try this with OctaMED as soon as i can get the new dev version working

@vaccinemedia
Copy link

@cnvogelg could you possibly post a video on how to get this working on OSX?
@Newk77 did you ever test this with OctaMED? I'm trying to get it working with OctaMED currently and struggling

@vaccinemedia
Copy link

Further to my previous comment, I have managed to boot a hard drive file containing OctaMED and have just successfully played an old Midi file from the 90s @Newk77 in case you have not tested it yet. Latancy seems OK in of itself but I'm yet to play both Amiga audio and Midi together in the same song to see if there are any latency issues. I'll post videos on YouTube at some point if I have any success. Great job @cnvogelg :)

@vaccinemedia
Copy link

Just confirming that there is noticeable latency when playing a test block in OctaMED @Newk77 and using two tracks, one with a hihat played on a drum machine and the other track playing a hihat sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add MIDI support in FS-UAE?
6 participants