• Stars
    star
    5
  • Rank 2,774,918 (Top 57 %)
  • Language
    Crystal
  • License
    MIT License
  • Created about 5 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Crystal C bindings for the PortMIDI cross-platform MIDI I/O library

port_midi

port_midi is a wrapper around the cross-platform PortMidi MIDI I/O library.

The low-level wrapper around PortMidi is in the lib LibPortMIDI.

The module PortMIDI contains a few helper functions that are useful when converting between MIDI data and PortMidi messages. It also contains the function PortMIDI#list_all_devices which prints out all of the input and output devices available to PortMidi.

At a higher level of abstraction, InputStream and OutputStream represent the two kinds of streams that do reading and writing of MIDI data.

Finally, a SimpleMIDIDevice wraps one input stream and one output stream.

Installation

  1. Install the PortMidi library. If you are on MacOS and you use Homebrew, you can run brew install portmidi. Otherwise, download the PortMidi source from http://portmedia.sourceforge.net/portmidi/ and compile it.
  2. Add the dependency to your shard.yml:
dependencies:
  port_midi:
    github: jimm/crystal_port_midi
  1. Run shards install

Usage

require "port_midi"

PortMIDI.initialize

See the examples directory for a few sample applications that use port_midi and the InputStream, OutputStream, and SimpleMIDIDevice classes.

To build the examples, run shards build.

Development and Testing

To run the tests, run crystal spec.

When running tests on Travis CI or CircleCI, we limit ourselves to tests that do not return PortMidi errors. That is because the installation of libportmidi available to Travis through apt-get is compiled with the PM_CHECK_ERRORS flag enabled. When an error such as an invalid device ID happens, the flag causes the PortMidi code to display a message, prompt the user to hit ENTER, and exit immediately. I can work around the prompt by running /usr/bin/yes | crystal spec, but I can't work around the call to exit.

Documentation

To generate the docs, run crystal docs.

Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

More Repositories

1

midilib

Pure Ruby MIDI file and event manipulation library
Ruby
177
star
2

csvlixir

A CSV reading/writing application for Elixir.
Elixir
33
star
3

elisp

My Emacs initialization files
Emacs Lisp
27
star
4

activerecord-mongo-adapter

Adapter to use the MongoDB with Rail's ActiveRecord
Ruby
22
star
5

patchmaster

MIDI processing and patching system
Ruby
21
star
6

erlang-midilib

Erlang MIDI file and event manipulation library
Erlang
13
star
7

clojure

Experimentation with Clojure
Clojure
8
star
8

10gen-rorob

10gen Ruby on Rails on Babble example
Ruby
8
star
9

elixir-midifile

Elixir MIDI file reader/writer
Elixir
8
star
10

vcv-jimm

VCV Rack modules
C++
8
star
11

elixir

My Elixir experimentation
Elixir
7
star
12

chuck

A fork of ChucK with new features
C++
6
star
13

impromptu

Scheme code for Impromptu
Scheme
5
star
14

subjective_c

A small Objective C implementation
C
5
star
15

erlang-ircbot

Erlang IRC bot
Erlang
4
star
16

golang

Experimentation with the Go language
Go
4
star
17

expensive

Expense tracker, written in Elixir and using Phoenix
Elixir
3
star
18

montastic-dashboard-widget

A Montastic Dashboard Widget for Mac OS X
JavaScript
3
star
19

bangkok

Bangkok reads chess game descriptions and re-play the games, by default outputting MIDI
Ruby
3
star
20

strange_loops

MIDI looper
C++
3
star
21

keymaster

MIDI processing and patching system
C++
3
star
22

DataVision

An open source reporting tool
Java
3
star
23

common-lisp

Experimentation with Common Lisp
Common Lisp
3
star
24

elixir_resource_discovery

Elixir version of resource discovery application from "Erlang and OTP in Action".
Elixir
2
star
25

icfp_2006

ICFP 2006 contest
Erlang
2
star
26

mrmkcs

Mr. M's Keyboard Controlled Sequencer --- my take on Dr. T's KCS
C++
1
star
27

keymaster_objc

MIDI processing and patching system
Objective-C
1
star
28

euler

Project Euler solutions
Clojure
1
star
29

ruby_course

Source for a Ruby session I presented at ideeli in September, 2011
Ruby
1
star
30

timelord

Time tracking system with invoice creation
Ruby
1
star
31

scala

Experimentation with Scala
Scala
1
star
32

kronut

A simple Korg Kronos set list editor
C++
1
star
33

beets_cr

MIDI drum machine driven by text files
Crystal
1
star
34

seamaster

C++ version of PatchMaster
1
star
35

NQXML

A pure Ruby implementation of a non-validating XML processor
Ruby
1
star
36

advent_of_code

http://adventofcode.com/
Ruby
1
star
37

trinket

MIDI performance software: create and modify MIDI data in real time
C++
1
star
38

blister

MIDI performance software; PatchMaster (http://patchmaster.org/) in Elixir
Elixir
1
star
39

www-ellisislandband-net

Ellis Island band website
SCSS
1
star
40

pmserver

PortMidi "server" that accepts ASCII commands and sends/receives MIDI
C++
1
star