Skip to content

Commit

Permalink
Init public commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
psobot committed Apr 12, 2017
0 parents commit 157f129
Show file tree
Hide file tree
Showing 27 changed files with 2,791 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2015-2017 Peter Sobot https://petersobot.com [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
116 changes: 116 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# SampleScanner

![SampleScanner Logo](https://cloud.githubusercontent.com/assets/213293/24964018/1dcb4092-1f6e-11e7-8b3b-47704e6c8aeb.png)


SampleScanner is a command-line tool to turn MIDI instruments (usually hardware) into virtual (software) instruments automatically. It's similar to the now-discontinued [Redmatica's _AutoSampler_](http://www.soundonsound.com/reviews/redmatica-autosampler) software (now part of Apple's [MainStage](https://441k.com/sampling-synths-with-auto-sampler-in-mainstage-3-412deb8f900e) package), but open-source and cross-platform.

## Features

- Uses native system integration (via `rtmidi` and `pyAudio`) for compatibility with all audio and MIDI devices
- Outputs to the open-source [sfz 2.0 sample format](http://ariaengine.com/overview/sfz-format/), playable by [Sforzando](https://www.plogue.com/products/sforzando/) (and others)
- Optional FLAC compression (on by default) to reduce sample set file size by up to 75%
- Flexible configuration options and extensive command-line interface
- Expermimental looping algorithm to extend perpetual samples
- Clipping detection at sample time
- 100% Python to enable cross-platform compatibility (only tested on macOS at the moment)

## Installation

Requires a working `python`, `pip`, and `ffmpeg` to be installed on the system.

```
git clone [email protected]:psobot/SampleScanner
cd SampleScanner
pip install -r requirements.txt
```

## How to run

Run `./samplescanner -h` for a full argument listing:

```contentsof<samplescanner -h>
usage: samplescanner [-h] [--program-number PROGRAM_NUMBER]
[--low-key LOW_KEY] [--high-key HIGH_KEY]
[--velocity-levels VELOCITY_LEVELS [VELOCITY_LEVELS ...]]
[--key-skip KEY_RANGE] [--max-attempts MAX_ATTEMPTS]
[--limit LIMIT] [--has-portamento] [--sample-asc]
[--no-flac] [--no-delete] [--loop] [--ignore-clicks]
[--midi-port-name MIDI_PORT_NAME]
[--midi-channel MIDI_CHANNEL]
[--audio-interface-name AUDIO_INTERFACE_NAME]
[--sample-rate SAMPLE_RATE] [--print-progress]
output_folder
create SFZ files from external audio devices
optional arguments:
-h, --help show this help message and exit
Sampling Options:
--program-number PROGRAM_NUMBER
switch to a program number before recording
--low-key LOW_KEY key to start sampling from (key name, octave number)
--high-key HIGH_KEY key to stop sampling at (key name, octave number)
--velocity-levels VELOCITY_LEVELS [VELOCITY_LEVELS ...]
velocity levels (in [1, 127]) to sample
--key-skip KEY_RANGE number of keys covered by one sample
--max-attempts MAX_ATTEMPTS
maximum number of tries to resample a note
--limit LIMIT length in seconds of longest sample
--has-portamento play each note once before sampling to avoid
portamento sweeps between notes
--sample-asc sample notes from low to high (default false)
Output Options:
output_folder name of output folder
--no-flac don't compress output to flac samples
--no-delete leave temporary .aif files in place after flac
compression
--loop attempt to loop sounds (should only be used with
sounds with infinite sustain)
--ignore-clicks turn off click/audio corruption checks (default false)
MIDI/Audio IO Options:
--midi-port-name MIDI_PORT_NAME
name of MIDI device to use
--midi-channel MIDI_CHANNEL
MIDI channel to send messages on
--audio-interface-name AUDIO_INTERFACE_NAME
name of audio input device to use
--sample-rate SAMPLE_RATE
sample rate to use. audio interface must support this
rate.
Misc Options:
--print-progress show text-based VU meters in terminal (default false,
can cause audio artifacts)
```

## Copyright and License

tl;dr: SampleScanner is &copy; 2015-2017 [Peter Sobot](https://petersobot.com), and released under the MIT License.

```contentsof<cat LICENCE>
The MIT License
Copyright (c) 2015-2017 Peter Sobot https://petersobot.com [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
Empty file added lib/__init__.py
Empty file.
Loading

0 comments on commit 157f129

Please sign in to comment.