Coder Social home page Coder Social logo

rtmidi's Introduction

RtMidi

Haskell wrapper for RtMidi, the lightweight, cross-platform MIDI I/O library.

Version

The version of this library does not correspond to the RtMidi version (sorry). You can look at the justfile to see that we vendor sources from version 6.0.0.

How to use

See Hackage for the latest released version and add RtMidi and vector to your library build-depends.

Follow the callback example to receive messages.

Follow the playback example to send messages.

Development

This project is tested with Cabal (latest versions of last two compiler lines) and Stack (latest LTS).

You can get started with development like so (if you have just installed):

# Build and test on OSX CoreMIDI support or Linux with ALSA support.
# (You can also manually invoke stack and pass `--flag RtMidi:jack` for Jack support.)
just test

# Print information about all accessible MIDI devices and all compiled APIs.
just example-report

TODO

  • See if there is a way to autodetect Jack in the Cabal file.
  • See if there is a way to make OSX not take 3 seconds when initializing the MIDI subsystem.

rtmidi's People

Contributors

ejconlon avatar khlrb avatar mtolly avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ejconlon mtolly

rtmidi's Issues

Proposed maintenance

Here are some maintenance tasks I'm planning to do:

  • Bump base bounds for 8.10 (and 8.8?)
  • Add executable targets in the cabal file for example programs
  • Update rtmidi sources
  • Add CI for multiple GHC versions (and Stack LTS) (example)
  • Maybe: Set default backends based on OS, not flags
  • Maybe: Add additional "unlifted" layer (as in MonadUnliftIO, but maybe just IO) with "safe" withPort methods.
  • Release to Hackage
  • Release to Stackage

Strictness and Vectors

Now we represent messages as [Word8], but we can probably make much better use of the heap with Vector Word8.
Also we yield messages to the callback as the lazy tuple (Double, [Word8]), but a strict tuple or datatype would be better (ensuring that it implements NFData).

cc-options are not passed in 8.10.2

I've been doing all my testing with 8.8.4 on Linux and Mac, and things work great (including with jack support). We test that we can BUILD with 8.8.4 and 8.10.2 in CI, but we can't run the test suite (since CI doesn't have a sound device).

When I tried to add to nightly stackage, I realized that the test suite fails in 8.10.2 because it tries to use the "dummy" API. This only happens when no other APIs are configured! (See https://github.com/riottracker/RtMidi/blob/master/rtmidi/RtMidi.cpp#L61 ) I have since repo'ed this by setting my ghc version with ghcup and cabal testing.

This problem indicates that cabal or ghc are not correctly passing the cc-options we set to our C++ compiler, and that this has changed between ghc versions. I have tried updating the cabal-version and using cxx-{options,sources} but that has no effect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.