<commit_before># lsdj-wave-cruncher

lsdj-wave-cruncher is a bundle of scripts allowing an LSDJ user to create wavetables instruments in LSDJ (a steel drum, or other instruments with complex waveforms).

***WARNING ⚠️*** : *.snt files only contain the 16-frames long 4-bit waveform data. The synth parameters are not saved.*

## crunching

**Crunching** a sample is downsampling and bitcrushing the given sample into a .snt binary file ready to be patched to a LSDJ song.

To *crunch* a sample, use :
```
$ node crunch.js [SAMPLE.WAV] [NOTE|FREQUENCY] --normalize --channel=0
```
* *[SAMPLE.WAV]* is the file that'll be crunched.
* *[NOTE|FREQUENCY]* is either the note at which the sample is (ex: C4, D4) or its frequency (ex: 440 Hz).
* *--normalize*, if present, will [normalize](https://en.wikipedia.org/wiki/Audio_normalization) the sample.
* *--channel=0* specifies the channel where the sound data will be taken. If not present, it defaults to the 1st channel (0). This parameter is only relevant for stereo sound.


## patching

**Patching** a synth is writing the binary .snt data into a LSDJ song.

To *patch* a synth, you can use both of these commands :
```
$ node patch.js [LSDJSAVE.SAV] [SONGNUMBER] [SYNTHFILE.SNT] [SYNTHNUMBER]
$ node patch.js [SONG.LSDSNG|.SRM] [SYNTHFILE.SNT] [SYNTHNUMBER]
```

* *[LSDJSAVE.SAV]* is the save that'll be patched. If you want to patch a .SAV file, you'll have to supply the number of the song *[SONGNUMBER]* you want to add the synth to.
* *[SONG.LSDSNG|.SRM]* is the song file that'll be patched. In that case, you don't have to supply a song number.
* *[SYNTHFILE.SNT]* is the synth data that'll be patched.
* *[SYNTHNUMBER]* is the ID of the synth where the data will be written.
<commit_msg>Update documentation for pitch auto-detection<commit_after># lsdj-wave-cruncher

lsdj-wave-cruncher is a bundle of scripts allowing an LSDJ user to create wavetables instruments in LSDJ (a steel drum, or other instruments with complex waveforms).

***WARNING ⚠️*** : *.snt files only contain the 16-frames long 4-bit waveform data. The synth parameters are not saved.*

## crunching

**Crunching** a sample is downsampling and bitcrushing the given sample into a .snt binary file ready to be patched to a LSDJ song.

To *crunch* a sample, use :
```
$ node crunch.js [SAMPLE.WAV] [NOTE|FREQUENCY] --normalize --channel=0
```
* *[SAMPLE.WAV]* is the file that'll be crunched.
* *[NOTE|FREQUENCY|auto]* is either the note at which the sample is (ex: C4, D4), its frequency (ex: 440 Hz), or auto to auto-detect the frequency.
* *--normalize*, if present, will [normalize](https://en.wikipedia.org/wiki/Audio_normalization) the sample.
* *--channel=0* specifies the channel where the sound data will be taken. If not present, it defaults to the 1st channel (0). This parameter is only relevant for stereo sound.


## patching

**Patching** a synth is writing the binary .snt data into a LSDJ song.

To *patch* a synth, you can use both of these commands :
```
$ node patch.js [LSDJSAVE.SAV] [SONGNUMBER] [SYNTHFILE.SNT] [SYNTHNUMBER]
$ node patch.js [SONG.LSDSNG|.SRM] [SYNTHFILE.SNT] [SYNTHNUMBER]
```

* *[LSDJSAVE.SAV]* is the save that'll be patched. If you want to patch a .SAV file, you'll have to supply the number of the song *[SONGNUMBER]* you want to add the synth to.
* *[SONG.LSDSNG|.SRM]* is the song file that'll be patched. In that case, you don't have to supply a song number.
* *[SYNTHFILE.SNT]* is the synth data that'll be patched.
* *[SYNTHNUMBER]* is the ID of the synth where the data will be written.

{'fraction_non_alphanumeric': 0.11192145862552595, 'fraction_numerical': 0.006732117812061711, 'mean_word_length': 4.228739002932551, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '548393', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1158, 'n_words': 509}