Metadata-Version: 2.1
Name: audio-to-midi
Version: 2019.1
Summary: Convert audio to multichannel MIDI.
Home-page: https://github.com/NFJones/audio-to-midi
Author: Neil F Jones
License: UNKNOWN
Keywords: audio midi conversion
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.5.*, <4
Description-Content-Type: text/markdown
Requires-Dist: audio-to-midi (==2019.1)
Requires-Dist: cffi (==1.12.3)
Requires-Dist: Cython (==0.29.7)
Requires-Dist: MIDIUtil (==1.2.1)
Requires-Dist: numpy (==1.16.3)
Requires-Dist: pycparser (==2.19)
Requires-Dist: SoundFile (==0.10.2)

# audio-to-midi

`audio-to-midi` takes in a sound file and converts it to a multichannel MIDI file. It accomplishes this by performing FFT's on all channels of the audio data at user specified time steps. It then separates the resulting frequency analysis into equivalence classes which correspond to the twelve tone scale; the volume of each class being the average volume of its constituent frequencies. It then formats this data for MIDI and writes it out to a user specified file. It has the ability to convert whichever audio file formats are supported by the [soundfile](https://pypi.org/project/SoundFile/) module. libsndfile must be installed before running `audio-to-midi`

- [This is an example of a conversion using a time quantum of 5ms and an activation level of 0.](https://soundcloud.com/neil-jones/this-is-a-test)

## Installation

```
> python3 ./setup.py install
```

## Usage

```
> audio-to-midi --help
usage: audio-to-midi [-h] [--output OUTPUT] [--time-quantum TIME_QUANTUM]
                     [--activation-level ACTIVATION_LEVEL] [--condense]
                     [--single-note]
                     infile

positional arguments:
  infile                The sound file to process.

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        The MIDI file to output. Default: <infile>.mid
  --time-quantum TIME_QUANTUM, -t TIME_QUANTUM
                        The time span over which to compute the individual
                        FFTs in milliseconds.
  --activation-level ACTIVATION_LEVEL, -a ACTIVATION_LEVEL
                        The amplitude threshold for notes to be added to the
                        MIDI file. Must be between 0 and 1.
  --condense, -c        Combine contiguous notes at their average amplitude.
  --single-note, -s     Only add the loudest note to the MIDI file for a given
                        time span.
```


