Skip to content

Commit

Permalink
Tidy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leegee committed Jun 10, 2022
1 parent a190e90 commit f0bdd05
Show file tree
Hide file tree
Showing 3 changed files with 2,562 additions and 27 deletions.
47 changes: 32 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Glitch
# Audio Glitch

Uses the rhythm from a MIDI file's track 0 note-on events, regardless of channel, to slice and merge a number of WAV files.
## Synopsis

Produce sliced and spliced WAVs from MIDI beats or a list of times.

## Use

`glitch` uses the rhythm from a MIDI file's track 0 note-on events, regardless of channel, to slice and merge a number of WAV files.


A command line interface and API are provided, along with an example. Arguments are the same for all.

### CLI

```bash
node bin/glitch.js --bpm 127 --midi eg/test.mid --wav eg/1.wav --wav eg/2.wav
node node_modules./bin/glitch --bpm 127 --midi eg/test.mid --wav eg/0.wav --wav eg/1.wav --wav eg/2.wav
```

### Example
Expand All @@ -22,10 +27,19 @@ node bin/glitch.js --bpm 127 --midi eg/test.mid --wav eg/1.wav --wav eg/2.wav
import path from 'path';
import MIDIslicer from './src/slicer';

// Taking beats from a MIDI file:
const args = {
verbose: true,
bpm: 100,
midi: 'eg/test.mid',
wav: ['eg/0.wav', 'eg/1.wav', 'eg/2.wav'],
output: 'eg/output.wav'
};

// Supplying beats directly
const args = {
verbose: true,
bpm: 100,
// midi: 'eg/test.mid',
midi: [1, 1, 1, 1],
wav: ['eg/0.wav', 'eg/1.wav', 'eg/2.wav'],
output: 'eg/output.wav'
Expand All @@ -41,23 +55,26 @@ new MIDIslicer(args)
## Argumnets:

<dl>
<dt>bpm</dt>
<dd>(Number) MIDI does not provide this, so you should.</dd>
<dt>midi</dt>
<dd>(String|Array) If a string, path to the MIDI file; if an array, a list of timings in seconds.</dd>
<dt>wav</dt>
<dd>(Array<string>) Path(s) to WAV file(s).</dd>
<dt>output</dt>
<dd>(String) Path to output WAV. Defaults to the MIDI file input path concatinated with `_glitch.wav`, or `glitch.wav` if no MIDI file was supplied.</dd>
<dt>verbose</dt>
<dt><code>bpm</code></dt>
<dd>(Number) MIDI does not provide this, so you must.</dd>
<dt><code>midi</code></dt>
<dd>(String|Array) Source of beats at which to chop the audio: if a string, path to the MIDI file; if an array, a list of timings</dd>
<dt><code>wav</code></dt>
<dd>(Array|String>) One or more paths to wave files.</dd>
<dt><code>output</code></dt>
<dd>(String) Path at which to output the generated wave file. Defaults to the MIDI file input path concatinated with `_glitch.wav`, or if no MIDI file was supplied, defaults to `glitch.wav`.</dd>
<dt><code>verbose</code></dt>
<dd>(Boolean) Logging</dd>
</dl>

## Caveats

All wave files should be of the same duration, same sample rate, bit depth, number of channels.
I've no plan to update this, since I produce my wavs at the same time from the same source.
All wave files should be of the same duration, same sample rate, bit depth, number of channels. I have no plan to update this, since I produce my wavs at the same time from the same source.

## Acknowledgements

Based in part on the work of David Poirier-Quinot in `node-audio-slicer`.

## Changes

2022-06-10 - updated this documentation and `package.json``.
Loading

0 comments on commit f0bdd05

Please sign in to comment.