<commit_before># wavyd
Little harmonic synthesis toy and wavetable generator. Originally written to generate wavetable data for
the awesome [Open.Theremin](http://www.gaudi.ch/OpenTheremin/) project, but then things got a little out of hand...

## installation
```
npm install wavyd
```

## dependencies
All in package.json, except for node-canvas (for png support), which requires an installation of Cairo. Check
[here](https://www.npmjs.com/package/canvas) for more information.

## usage

Arguments (with defaults):

```
--freq    Audio frequency to play (440)
--spec    Spec for wave generation - partials weight and phase (1:0, 0.5:0)
--dur     Audio duration in seconds (3)
--silent  Suppress audio preview of wave
--dump    If given, write wavetable data to stdout (false)
--table   Size (#samples) of wavetable to generate (1024)
--round   If true, round samples in wavetable to integer values (false)
--scale   Scale samples in wavetable by this value (1.0)
--plot    If given, generate a graphic representation of waveform: ascii|png (false)
--pn      For png plot, output filename (plot.png)
--pw      For png plot, pixel width of image (640)
--ph      For png plot, pixel height of image (360)
--pm      For png plot, inner margin of image (4)
--preset  If given, a path to a preset/template file
--help    Show this help message (false)
```

Spec argument should be a quoted list of weight:phase pairs w:p
separated by spaces and/or commas, e.g.

```
"1.0, 0.5:0, 0.25:0.2PI"
```

(Note that phases are in radians relative to the current partial, and
that you can use "PI" as a constant in these expressions)
<commit_msg>Fix package,.json for NPM install, ducument node dependency and command line usage<commit_after># wavyd
Little harmonic synthesis toy and wavetable generator. Originally written to generate wavetable data for
the awesome [Open.Theremin](http://www.gaudi.ch/OpenTheremin/) project, but then things got a little out of hand...

## installation
```
npm install -g wavyd
```

## dependencies
nodejs (tested with v0.10.n and 0.12.n)

All in package.json, except for node-canvas (for png support), which requires an installation of Cairo. Check
[here](https://www.npmjs.com/package/canvas) for more information.

## usage

```
$ wavyd <arguments>
```

Arguments (with defaults):

```
--freq    Audio frequency to play (440)
--spec    Spec for wave generation - partials weight and phase (1:0, 0.5:0)
--dur     Audio duration in seconds (3)
--silent  Suppress audio preview of wave
--dump    If given, write wavetable data to stdout (false)
--table   Size (#samples) of wavetable to generate (1024)
--round   If true, round samples in wavetable to integer values (false)
--scale   Scale samples in wavetable by this value (1.0)
--plot    If given, generate a graphic representation of waveform: ascii|png (false)
--pn      For png plot, output filename (plot.png)
--pw      For png plot, pixel width of image (640)
--ph      For png plot, pixel height of image (360)
--pm      For png plot, inner margin of image (4)
--preset  If given, a path to a preset/template file
--help    Show this help message (false)
```

Spec argument should be a quoted list of weight:phase pairs w:p
separated by spaces and/or commas, e.g.

```
"1.0, 0.5:0, 0.25:0.2PI"
```

(Note that phases are in radians relative to the current partial, and
that you can use "PI" as a constant in these expressions)

To write output to a wave file, redirect stdout as follows

```
$ wavyd --preset ./MyCPPTemplate.js --silent > wavetable.cpp
```

{'fraction_non_alphanumeric': 0.10338983050847457, 'fraction_numerical': 0.01977401129943503, 'mean_word_length': 3.5867875647668392, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '2157602', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1045, 'n_words': 490}