# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['mixpresplit']

package_data = \
{'': ['*']}

install_requires = \
['click>=7.1.2,<8.0.0', 'wavinfo>=1.6,<2.0']

entry_points = \
{'console_scripts': ['mixpresplit = mixpresplit.cli:main']}

setup_kwargs = {
    'name': 'mixpresplit',
    'version': '0.1.0',
    'description': 'CLI Utility that allows splitting mixpre polywav files',
    'long_description': '# mixpresplit\n\nmixpresplit is a small but powerful commandline utility that allows you to split and sort polywavs (as produced by the Sounddevices MixPre recorder) into seperate audio files – one for each channel. Sounddevices offers there own graphical tool that does this called [Wave Agent](https://www.sounddevices.com/product/wave-agent-software/), which you should also check out. Wave Agent has the downside that it currently can\'t split 32bit files and that you cannot use it for automated or semi-automated workflows.\n\n## About the project\n\nmixpresplit is programmed in Python 3 and depends on the great [ffmpeg](https://ffmpeg.org/) project for all audio processing related stuff. That means you could - in principle – just use your own ffmpeg commands and get similar results. mixpresplit however is optimized for fast and reliable workflows to qickly get things done. \n\n### Basic usage\n\nJust specify a input directory and a output pattern and press Enter:\n```bash\nmixpresplit G:/MixPre_SD-Card/MyProject D:/Recordings/Myfolder/{tracknumber}_{take}.wav\n```\nThis will read all recordings from the SD-Card, split them and place them into the target folder. If you wonder about the meaning of `{tracknumber}` and `{take}` these are _keywords_ which make mixpresplit very productive and powerful:\n\n### Keywords\n\nKeywords are special predefined variables that you can use in the output path. A more advanced example:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/{date} {scene}/Take_{take}/{tracknumber}_{trackname}-Take{take}" --flac\n```\nThis will take all recordings found on the SD-card at `G:/MixPre/MyProject` and create a folder in `D:/Recordings` for each day of recording, each containing folders for each take. The tracks of the recording will be converted to flac and sorted by tracknumber. The result could look like this:\n```\nD:/Recordings/\n   |-- 2020-08-12 Bandpractise/\n   |          |--Take_1/\n   |          |    |--1_Drums.L-Take1.flac\n   |          |    |--2_Drums.R-Take1.flac\n   |          |    |--3_Bass-Take1.flac\n   |          |    |--4_Synth-Take1.flac\n   |          |--Take_2/\n   |               |--1_Drums.L-Take2.flac\n   |               |--2_Drums.R-Take2.flac\n   |               |--3_Bass-Take2.flac\n   |               |--4_Synth-Take2.flac\n   |-- 2020-08-13 Bandpractise/\n              |--Take_1/\n              |    |--1_Drums.L-Take1.flac\n              |    |--2_Drums.R-Take1.flac\n              |    |--3_Bass-Take1.flac\n              |    |--4_Synth-Take1.flac\n              |--Take_2/\n                   |--1_Drums.L-Take2.flac\n                   |--2_Drums.R-Take2.flac\n                   |--3_Bass-Take2.flac\n                   |--4_Synth-Take2.flac\n```\nAs you can see the magic lies in statements like `{date}`, `{take}` and `{tracknumber}`: these are automatically filled in by mixpresplit with the values stored in the recordings themselves. So if you decided that instead of sorting by `Day/Scene > Take > Track` you\'d rather sort by `Track > Month > Scene` you\'d just had to rewrite that one path with different keywords.\n\nYou can find a list of all possible keywords when running `mixpresplit -h`:\n```\n{date} . . . . . Date of the recording (e.g. 2020-06-01)\n{hour} . . . . . Hour of the recording (e.g. 19)\n{min}  . . . . . Minute of the recording (e.g. 20)\n{sec}  . . . . . Second of the recording (e.g. 24)\n{scene}  . . . . Scene name (e.g. MixPre)\n{take} . . . . . Take Number (e.g. 001)\n{tape} . . . . . Identifier for the Tape/SD-Card\n{circled}  . . . Circled Files (e.g. CIRCLED)\n{tracknumber}. . Number of the track (e.g. 001)\n{trackname}. . . Name of the track as chosen on the recorder\n```\n\n### Filters\nIf you want to only export certain tracks you can use _filters_ to narrow down the exported material. \nFilters can be one of the following:\n```\n--only-circled          Use only circled takes\n--tracks TEXT           include/Exclude certain tracks\n--takes  TEXT           include/Exclude certain takes\n```\n\n#### Filter by Take\n\nA simple usage is to export only circled takes:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --only-circled\n```\n\nIf you only want to export a certain take you can use the `--takes` filter (only export take 4):\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --takes 4\n```\n\nYou can also export a range of takes (only export takes 1 to 4):\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --takes 1-4\n```\n\nBy adding ! in front you can invert the behaviour (you may have to wrap the option in single quotes).\nSo this export every take _except_ the takes 1 to 4:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --takes \'!1-4\'\n```\n\nYou can use multiple of these filters by either seperating the statements with commas or by using multiple options.\nSo this skips takes 1 to 7 except take 5 and also includes take 23:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --takes \'!1-7,5\' --take 23\n```\n\n#### Filter by Track\n\nAll the filters you can use with takes can also be used with tracks.\nHere we only export the tracks 1 to 7:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --tracks \'1-7\'\n```\n\nAdditionally you can search the trackname to filter tracks.\nFor example if you only want to export tracks with "Drums" in their names use this:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --tracks \'Drums\'\n```\n\nIf you want to export anything except Drums just invert it with the ! sign:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/Drums/{trackname}.wav" --tracks \'!Drums\'\n```\n\n### Format Conversion\n\nPer default mixpresplit will use the very same output format as present in the input. So if you split a 32 Bit wav file, the resulting files will be 32 Bit wav files as well.\n\nIf you want to convert the files you use these:\n```\n--flac        Use FLAC instead of WAV for output\n--24          Output as 24 bit audio\n--16          Output as 16 bit audio\n```\n\nMore formats might follow in the future, given the ffmpeg base they should not be hard to implement, feel free to post a issue on github.\n\n### Renaming things\n\nIt might happen that you named things wrongly on set or in the studio, for this you can use the options:\n```\n--replace TEXT     Replace this string in OUTPATH\n--with    TEXT     With that string\n```\n\nIf you for example want to replace the word "Drums" in your channels with "Bass" you can use this:\n```bash\nmixpresplit G:/MixPre/MyProject "D:/Recordings/{date}/{trackname}.wav" --rename Drums --with Bass\n```\n\nCareful however, because this replaces in the whole OUTPATH:\n```\n"D:/Recordings/Drums/{trackname}.wav" -> "D:/Recordings/Bass/{trackname}.wav"\n```\n\nYou always have to use these options in pairs. If you don\'t match the numbers, mixpresplit will complain and remind you. This functionality is a little crude, and might be improved at some point.\n\n## Installation\n\n### From Source\n\nmixpresplit uses Python 3 and depends on ffmpeg. For Python dependency managment [python poetry](https://python-poetry.org/) is used. If you want to use poetry you can use these steps:\n\n1. Clone this repo using `git clone` in the terminal and enter it\n2. Install Python3 using either an [installer](https://www.python.org/downloads/) or your package manager (`sudo apt install python3` or similar)\n3. Install [ffmpeg] and make sure the executable is found in your systems PATH variable\n4. Install [python poetry](https://python-poetry.org/docs/#installation)\n5. Run `poetry install` to download the dependecies\n6. Run with `poetry run mixpresplit`\n\n### Using PIP\n\n1. Install Python3 using either an [installer](https://www.python.org/downloads/) or your package manager (`sudo apt install python3` or similar)\n2. Install python-pip if it hasn\'t been installed in step 1\n3. Install [ffmpeg] and make sure the executable is found in your systems PATH variable\n4. Install with `pip install mixpresplit` or `pip3 install mixpresplit`\n5. Run with `mixpresplit`\n\n### Binary Packages\n\nSomething like a packed executable for Windows or a debian package for Linux systems might follow at some point',
    'author': 'David Huss',
    'author_email': 'dh@atoav.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/atoav/mixpresplit',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
