diff options
Diffstat (limited to 'portmidi/README.md')
| -rw-r--r-- | portmidi/README.md | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/portmidi/README.md b/portmidi/README.md new file mode 100644 index 0000000..3f0463c --- /dev/null +++ b/portmidi/README.md | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | # PortMidi - Cross-Platform MIDI IO | ||
| 2 | |||
| 3 | This is the canonical release of PortMidi. | ||
| 4 | |||
| 5 | See other repositories within [PortMidi](https://github.com/PortMidi) | ||
| 6 | for related code and bindings (although currently, not much is here). | ||
| 7 | |||
| 8 | ## [Full C API documentation is here.](https://portmidi.github.io/portmidi_docs/) | ||
| 9 | |||
| 10 | ## Compiling and Using PortMidi | ||
| 11 | |||
| 12 | Use CMake (or ccmake) to create a Makefile for Linux/BSD or a | ||
| 13 | project file for Xcode or MS Visual Studio. Use make or an IDE to compile: | ||
| 14 | ``` | ||
| 15 | sudo apt install libasound2-dev # on Linux, you need ALSA | ||
| 16 | cd portmidi # start in the top-level portmidi directory | ||
| 17 | ccmake . # set any options interactively, type c to configure | ||
| 18 | # type g to generate a Makefile or IDE project | ||
| 19 | # type q to quit | ||
| 20 | # (alternatively, run the CMake GUI and use | ||
| 21 | # Configure and Generate buttons to build IDE project) | ||
| 22 | make # compile sources and build PortMidi library | ||
| 23 | # (alternatively, open project file with your IDE) | ||
| 24 | sudo make install # if you want to install to your system | ||
| 25 | ``` | ||
| 26 | |||
| 27 | ## Installation | ||
| 28 | |||
| 29 | My advice is to build PortMidi and statically link it to your | ||
| 30 | application. This gives you more control over versions. However, | ||
| 31 | installing PortMidi to your system is preferred by some, and the | ||
| 32 | following should do it: | ||
| 33 | ``` | ||
| 34 | cmake . | ||
| 35 | make | ||
| 36 | sudo make install | ||
| 37 | ``` | ||
| 38 | |||
| 39 | ## Language Bindings | ||
| 40 | |||
| 41 | Here is a guide to some other projects using PortMidi. There is not | ||
| 42 | much coordination, so let us know if there are better or alternative | ||
| 43 | bindings for these and other languages: | ||
| 44 | |||
| 45 | - Python: Various libraries and packages exist; search and ye shall | ||
| 46 | find. If you wouldn't like to do research, check out [mido](https://mido.readthedocs.io/en/stable/) | ||
| 47 | - [SML](https://github.com/jh-midi/portmidi-sml2) | ||
| 48 | - [OCaml](https://ocaml.org/p/portmidi/0.1) | ||
| 49 | - [Haskell](https://hackage.haskell.org/package/PortMidi) | ||
| 50 | - [Erlang](https://hexdocs.pm/portmidi/PortMidi.html) | ||
| 51 | - [Julia](https://github.com/SteffenPL/PortMidi.jl) | ||
| 52 | - [C#](https://github.com/net-core-audio/portmidi) | ||
| 53 | - [Rust](https://musitdev.github.io/portmidi-rs/) | ||
| 54 | - [Go](https://github.com/rakyll/portmidi) | ||
| 55 | - [Odin](https://pkg.odin-lang.org/vendor/portmidi/) | ||
| 56 | - [Serpent](https://sourceforge.net/projects/serpent/) - a real-time | ||
| 57 | Python-like language has PortMidi built-in, a MIDI-timestamp-aware | ||
| 58 | scheduler, and GUI support for device selection. | ||
| 59 | - [Pd (Pure Data)](https://puredata.info/) uses PortMidi. | ||
| 60 | |||
| 61 | |||
| 62 | ## What's New? | ||
| 63 | |||
| 64 | (Not so new, but significant:) Support for the **PmDefaults** program, | ||
| 65 | which enabled a graphical interface to select default MIDI devices, | ||
| 66 | has been removed for lack of interest. This allowed us to also remove | ||
| 67 | C code to read and parse Java preference files on various systems, | ||
| 68 | simplifying the library. **PmDefaults** allowed simple command-line | ||
| 69 | programs to use `Pm_DefaultInputDeviceID()` and | ||
| 70 | `Pm_DefaultOutputDeviceID()` rather than creating device selection | ||
| 71 | interfaces. Now, you should either pass devices on the command line or | ||
| 72 | create your own selection interface when building a GUI | ||
| 73 | application. (See pm_tests for examples.) `Pm_DefaultInputDeviceID()` | ||
| 74 | and `Pm_DefaultOutputDeviceID()` now return a valid device if | ||
| 75 | possible, but they may not actually reflect any user preference. | ||
| 76 | |||
| 77 | Haiku support in a minimal implementation. See TODO's in source. | ||
| 78 | |||
| 79 | sndio is also minimally supported, allowing basic PortMidi functions | ||
| 80 | in OpenBSD, FreeBSD, and NetBSD by setting USE_SNDIO for CMake, but | ||
| 81 | not delayed/timestamped output and virtual devices. | ||
| 82 | |||
| 83 | # Other Repositories | ||
| 84 | |||
| 85 | PortMidi used to be part of the PortMedia suite, but this repo has | ||
| 86 | been reduced to mostly just C/C++ code for PortMidi. You will find | ||
| 87 | some other repositories in this PortMidi project set up for language | ||
| 88 | bindings (volunteers and contributors are invited!). Other code | ||
| 89 | removed from previous releases of PortMedia include: | ||
| 90 | |||
| 91 | ## PortSMF | ||
| 92 | |||
| 93 | A Standard MIDI File (SMF) (and more) library is in the [portsmf | ||
| 94 | repository](https://github.com/rbdannenberg/portsmf). | ||
| 95 | |||
| 96 | PortSMF is a library for reading/writing/editing Standard MIDI | ||
| 97 | Files. It is actually much more, with a general representation of | ||
| 98 | events and updates with properties consisting of attributes and typed | ||
| 99 | values. Familiar properties of pitch, time, duration, and channel are | ||
| 100 | built into events and updates to make them faster to access and more | ||
| 101 | compact. | ||
| 102 | |||
| 103 | To my knowledge, PortSMF has the most complete and useful handling of | ||
| 104 | MIDI tempo tracks. E.g., you can edit notes according to either beat | ||
| 105 | or time, and you can edit tempo tracks, for example, flattening the | ||
| 106 | tempo while preserving the beat alignment, preserving the real time | ||
| 107 | while changing the tempo or stretching the tempo over some interval. | ||
| 108 | |||
| 109 | In addition to Standard MIDI Files, PortSMF supports an ASCII | ||
| 110 | representation called Allegro. PortSMF and Allegro are used for | ||
| 111 | Audacity Note Tracks. | ||
| 112 | |||
| 113 | ## scorealign | ||
| 114 | |||
| 115 | Scorealign used to be part of the PortMedia suite. It is now at the | ||
| 116 | [scorealign repository](https://github.com/rbdannenberg/scorealign). | ||
| 117 | |||
| 118 | Scorealign aligns audio-to-audio, audio-to-MIDI or MIDI-to-MIDI using | ||
| 119 | dynamic time warping (DTW) of a computed chromagram | ||
| 120 | representation. There are some added smoothing tricks to improve | ||
| 121 | performance. This library is written in C and runs substantially | ||
| 122 | faster than most other implementations, especially those written in | ||
| 123 | MATLAB, due to the core DTW algorithm. Users should be warned that | ||
| 124 | while chromagrams are robust features for alignment, they achieve | ||
| 125 | robustness by operating at fairly high granularity, e.g., durations of | ||
| 126 | around 100ms, which limits time precision. Other more recent | ||
| 127 | algorithms can doubtless do better, but be cautious of claims, since | ||
| 128 | it all depends on what assumptions you can make about the music. | ||
