<commit_before># ex-portmidi

ex-portmidi is a wrapper for the [PortMidi C library](http://portmedia.sourceforge.net/portmidi/),
that provides some nice abstractions to (write to|listen on) MIDI devices.

## Installation

1. Add portmidi to your list of dependencies in `mix.exs`:
```
def deps do
  [{:portmidi, "~> 3.1"}]
end
```

2. Ensure portmidi is started before your application:
```
def application do
  [applications: [:portmidi]]
end
```

## Usage

To send MIDI events to a MIDI device:
```
iex(1)> {:ok, output} = PortMidi.open(:output, "Launchpad Mini")
{:ok, #PID<0.172.0>}
iex(2)> PortMidi.write(output, {176, 0, 127})
:ok
iex(3)> PortMidi.close(:output, output)
:ok
```

To listen for MIDI events from a MIDI device:
```
iex(1)> {:ok, input} = PortMidi.open(:input, "Launchpad Mini")
{:ok, #PID<0.103.0>}
ex(2)> PortMidi.listen(input, self)
:ok
iex(3)> receive do
...(3)>   event -> IO.inspect(event)
...(3)> end
[144, 112, 127]
iex(4)> PortMidi.close(:input, input)
:ok
```

To list all connected devices:
```
ex(1)> PortMidi.devices
%{input: [%PortMidi.Device{input: 1, interf: "CoreMIDI", name: "Launchpad Mini",
    opened: 0, output: 0}],
  output: [%PortMidi.Device{input: 0, interf: "CoreMIDI",
    name: "Launchpad Mini", opened: 0, output: 1}]}
```

For more details, [check out the Hexdocs](https://hexdocs.pm/portmidi/3.0.0/PortMidi.html).
<commit_msg>make link to hexdocs universal in README.md<commit_after># ex-portmidi

ex-portmidi is a wrapper for the [PortMidi C library](http://portmedia.sourceforge.net/portmidi/),
that provides some nice abstractions to (write to|listen on) MIDI devices.

## Installation

1. Add portmidi to your list of dependencies in `mix.exs`:
```
def deps do
  [{:portmidi, "~> 3.1"}]
end
```

2. Ensure portmidi is started before your application:
```
def application do
  [applications: [:portmidi]]
end
```

## Usage

To send MIDI events to a MIDI device:
```
iex(1)> {:ok, output} = PortMidi.open(:output, "Launchpad Mini")
{:ok, #PID<0.172.0>}
iex(2)> PortMidi.write(output, {176, 0, 127})
:ok
iex(3)> PortMidi.close(:output, output)
:ok
```

To listen for MIDI events from a MIDI device:
```
iex(1)> {:ok, input} = PortMidi.open(:input, "Launchpad Mini")
{:ok, #PID<0.103.0>}
ex(2)> PortMidi.listen(input, self)
:ok
iex(3)> receive do
...(3)>   event -> IO.inspect(event)
...(3)> end
[144, 112, 127]
iex(4)> PortMidi.close(:input, input)
:ok
```

To list all connected devices:
```
ex(1)> PortMidi.devices
%{input: [%PortMidi.Device{input: 1, interf: "CoreMIDI", name: "Launchpad Mini",
    opened: 0, output: 0}],
  output: [%PortMidi.Device{input: 0, interf: "CoreMIDI",
    name: "Launchpad Mini", opened: 0, output: 1}]}
```

For more details, [check out the Hexdocs](https://hexdocs.pm/portmidi/PortMidi.html).

{'fraction_non_alphanumeric': 0.1841726618705036, 'fraction_numerical': 0.0341726618705036, 'mean_word_length': 4.75776397515528, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6549795', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1080, 'n_words': 314}