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

Haiku support #38

Merged
merged 4 commits into from Oct 6, 2022
Merged

Haiku support #38

merged 4 commits into from Oct 6, 2022

Conversation

jmairboeck
Copy link
Contributor

This adds an implementation for Haiku using Haiku's MIDI 2 kit.

I only tested it a little using a virtual device created by the MidiSynth application. Timing and latency handling is still mostly missing and could probably be improved.

This also makes the code compatible with Haiku's 32 bit legacy compiler (GCC 2.95) because it was rather easy to do. I just mostly had to move a few variable declarations to the beginning of their block so that it conforms to C89. If that is seen as unnecessary, I could remove that also. Haiku also provides a modern compiler.

 * pm_common/pminternal.h is converted to Unix line endings
 * otherwise mostly declarations moved to the beginning of its block to
ensure C89 compatibility
this is reused in the Haiku port (for now)
Copy link
Contributor

@rbdannenberg rbdannenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing! Maybe the first new system support in a very long time. See question about C++ in another comment.

@jmairboeck
Copy link
Contributor Author

I have also started adding support for the software synthesizer support (BMidiSynth), but have not finished it yet. Maybe you can wait with merging this until I have finished it (if I succeed at it).

@jmairboeck
Copy link
Contributor Author

I added a fixed output device for the soft synth.

@rbdannenberg
Copy link
Contributor

Can you tell me the status of PortMidi on haiku? E.g. it could be short [and sysex?] messages work for output [and input?], [and timestamps are implemented?] [and virtual ports are implemented?] [and pm_test/README.txt tests [all?] work [except for tests ...?]]. That would help set the right expectations and be good for the main README and github description.

@jmairboeck
Copy link
Contributor Author

The basic functionality should work. It is a rather minimal implementation, however. Input and output devices, as well as virtual devices work, and there is an additional output device for the fluidsynth-based software synthesizer that Haiku supports. All Midi endpoints that are available in Haiku's MidiRoster are exposed as input and output devices in PortMidi. Timestamps are supported (as in, they are passed to the appropriate function calls), however, I didn't implement the latency and timing handling that the other implementations support. There are TODOs in the code about this.

I didn't run all the tests, and I only tested with a virtual Midi keyboard in a virtual machine. I will try to run all the tests and report back the results.

@rbdannenberg
Copy link
Contributor

Thanks. I know tests are a pain because you have to select device numbers every time and there is a lot of manual interaction, but tests have been pretty effective in identifying problems. Please ask about anything that's unclear -- I tried to keep test descriptions concise but as a "user" you might have ideas to improve them.

@jmairboeck
Copy link
Contributor Author

I ran the tests in my Haiku VM (in Virtualbox). Sysex doesn't seem to work. Latency is not handled correctly, as expected. PortMidi's virtual devices also don't work quite right. They don't show up when they should, but do so sometimes afterwards, which is a bit strange. I'll attach the terminal log files.

terminal1.txt
terminal2.txt
terminal3.txt

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.

None yet

2 participants