{ "info": { "author": "dhsavell", "author_email": "dhsavell05@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License" ], "description": "# beat-machine\n\n[![Build Status](https://travis-ci.com/dhsavell/beat-machine.svg?branch=master)](https://travis-ci.com/dhsavell/beat-machine)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b6421f0e0edd9c8a77f4/maintainability)](https://codeclimate.com/github/dhsavell/beat-machine/maintainability)\n[![PyPI](https://img.shields.io/pypi/v/beatmachine)](https://pypi.org/project/beatmachine/)\n\nThe Beat Machine is a library for playing with beats of songs, inspired by the creations over on\n[/r/BeatEdits](https://www.reddit.com/r/BeatEdits/). It works both as a library and as a command-line utility that\nreads effects from a JSON array.\n\n## Installation\n\nOne of the Beat Machine's dependencies, `madmom`, requires `Cython` to be present before installation. If you encounter\nan error along the lines of:\n\n```\nCommand \"python setup.py egg_info\" failed with error code 1 in /tmp/tmp1d2dis8pbuild/madmom/\n```\n\nTry installing Cython (`pip install Cython`) beforehand as a separate build step.\n\n## Examples\n\nA few examples of common edits are available below. In all cases, multiple effects can be supplied. When more than\none effect is present, effects are applied in order of appearance.\n\n### Using the CLI\n\nThe CLI has the following usage (produced by `python -m beatmachine --help`):\n\n```text\nUsage: __main__.py [OPTIONS]\n\nOptions:\n --input TEXT File to process. [required]\n --effects TEXT JSON representation of effects to apply. [required]\n --output TEXT Output mp3 file path. [required]\n --help Show this message and exit.\n```\n\nNote that **the program may appear to hang** due to the time taken to locate beats.\n\n#### Removing every other beat\n\nThe `remove` effect can't have a period of 1, because that would be silly (and result in nothing to work with).\n\n```sh\n$ python -m beatmachine \\\n --input \"in.mp3\" \\\n --output \"out.mp3\" \\\n --effects '[{\"type\": \"remove\", \"period\": 2}]'\n```\n\n#### Cutting every beat in half\n\n```sh\n$ python -m beatmachine \\\n --input \"in.mp3\" \\\n --output \"out.mp3\" \\\n --effects '[{\"type\": \"cut\", \"period\": 1}]'\n```\n\n#### Swapping beats 2 and 4\n\nIn the `swap` effect, the `x_period` and `y_period` fields are interchangeable, however they can't be equal.\n\n```sh\n$ python -m beatmachine \\\n --input \"in.mp3\" \\\n --output \"out.mp3\" \\\n --effects '[{\"type\": \"swap\", \"x_period\": 2, \"y_period\": 4}]'\n```\n\n#### Halving every beat then duplicating every other beat\n\n```sh\n$ python -m beatmachine \\\n --input \"in.mp3\" \\\n --output \"out.mp3\" \\\n --effects '[{\"type\": \"cut\", \"period\": 1},\n {\"type\": \"repeat\", \"period\": 2, \"times\": 2}]'\n```\n\n### Using the Python module\n\nNote that `load_beats_by_signal` is a rather long, blocking operation (~50 seconds for a 2 minute song on a\nRyzen 5 2600 w/ 16GB of RAM). Your mileage may vary.\n\nIf slightly inaccurate results are acceptable, `load_beats_by_bpm` is also available, which is much less CPU- and\nmemory-intensive. This method of loading beats is not capable of handling any kind of tempo change.\n\n#### Removing every other beat\n\n```python\nimport beatmachine as bm\n\nbeats = bm.loader.load_beats_by_signal('in.mp3') # A file-like object is also acceptable\neffects = [bm.effects.periodic.RemoveEveryNth(period=2)]\nresult = sum(bm.editor.apply_effects(beats, effects))\nresult.export('out.mp3')\n```\n\nOther results come from modifying the `effects` list. See the `effects` module and its submodules for more\npossibilities.\n\n#### Implementing a custom effect\n\nThere are two ways to create a basic effect class:\n - Create a class with the metaclass `beatmachine.effects.base.EffectRegistry`\n - Inherit from `beatmachine.effects.base.BaseEffect` with metaclass `beatmachine.effects.base.EffectABCMeta`\n - This is recommended since it provides all the necessary attributes as an abstract base class\n \nThe resulting effect class will automatically be loadable through `beatmachine.effects.load_from_dict`. Make sure that\nany configurable parameters are specified as keyword arguments, since `load_from_dict` passes fields directly to\n`__init__`. ", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dhsavell/beat-machine", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "beatmachine", "package_url": "https://pypi.org/project/beatmachine/", "platform": "", "project_url": "https://pypi.org/project/beatmachine/", "project_urls": { "Homepage": "https://github.com/dhsavell/beat-machine" }, "release_url": "https://pypi.org/project/beatmachine/2.1.1/", "requires_dist": [ "pydub", "madmom", "click", "pyfftw", "deprecation" ], "requires_python": "", "summary": "The Beat Machine is a library for playing with beats of songs.", "version": "2.1.1" }, "last_serial": 5962641, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "1cd8a448d886cb4f137977e3051f6fbf", "sha256": "1cc46cbe92d9f79f1fd048b47cd7d061fde195ca004310cc72a8b7e7941d8eaf" }, "downloads": -1, "filename": "beatmachine-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1cd8a448d886cb4f137977e3051f6fbf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15729, "upload_time": "2019-06-23T17:50:50", "url": "https://files.pythonhosted.org/packages/a6/86/b91453ba0203bb923290f26fd3eae56b23a995ceaf080ba9a0e63ecf8d90/beatmachine-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "05bc15dee602607e3bc35de920e02a3a", "sha256": "e054cd7d6d579fd857d51122be97fea2c599d06d430c0893e78ac4824d3482c8" }, "downloads": -1, "filename": "beatmachine-2.0.0.tar.gz", "has_sig": false, "md5_digest": "05bc15dee602607e3bc35de920e02a3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19162, "upload_time": "2019-06-23T17:50:57", "url": "https://files.pythonhosted.org/packages/9c/43/5b55b62115af1a71290bb3c3c0c4d68ce7e31829b1e040f5a7118749eb01/beatmachine-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "8c355ae0409fe600086af87bc9954997", "sha256": "f4ca9cac7ee783371c12410bb0ea79a507ebc2a6ea3056105ee64d4ec707ac29" }, "downloads": -1, "filename": "beatmachine-2.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8c355ae0409fe600086af87bc9954997", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17444, "upload_time": "2019-06-29T13:34:29", "url": "https://files.pythonhosted.org/packages/b3/87/7642a034997b5c58491da8c4bffb714960e2aa9d074ec6e129425491f37b/beatmachine-2.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "745b9edf032e3eb2762fb7c85fe7fa8b", "sha256": "eb7eee5a50b84615c5a6a6725613b767156ca405ab81d42837c35eff9e76b87a" }, "downloads": -1, "filename": "beatmachine-2.0.1.tar.gz", "has_sig": false, "md5_digest": "745b9edf032e3eb2762fb7c85fe7fa8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19306, "upload_time": "2019-06-29T13:34:33", "url": "https://files.pythonhosted.org/packages/2f/3e/f630bd166e5518ecb8f2bbe6c7864d4bfcbde5070c1f5bd0d22eab41a71a/beatmachine-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "df3959f9b90d36705ae69fa32a48316e", "sha256": "796049e491f58a97324d714ad2080b7859656d4370d70f6e56534c1e885249a6" }, "downloads": -1, "filename": "beatmachine-2.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df3959f9b90d36705ae69fa32a48316e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 17990, "upload_time": "2019-08-10T15:20:08", "url": "https://files.pythonhosted.org/packages/f5/3e/10f0463c20f1f071f21a7246c1b8f57153a3157d5325467056a391905c94/beatmachine-2.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f20ca304e30a74f2fe008fc2d256e3c2", "sha256": "6a5d201632d3110ae30cedf26d0119b9987acc6bf89c777022412b7b738fbcd3" }, "downloads": -1, "filename": "beatmachine-2.0.2.tar.gz", "has_sig": false, "md5_digest": "f20ca304e30a74f2fe008fc2d256e3c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19765, "upload_time": "2019-08-10T15:20:14", "url": "https://files.pythonhosted.org/packages/47/15/34cf68e5091640929ebe08a601143e61308f7d28a736ea51fb3776ad3c6c/beatmachine-2.0.2.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "90686b89dbd6ae613723489b92ade5b1", "sha256": "93cbc00673bbe2b60ace3ad4034ba667a75be91cd79e7fcb0562cfd82a10b63e" }, "downloads": -1, "filename": "beatmachine-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "90686b89dbd6ae613723489b92ade5b1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20273, "upload_time": "2019-09-08T22:26:43", "url": "https://files.pythonhosted.org/packages/d0/ed/29b35c792b8fe39225d2d0dd1f25b63fa52662c34f585d3d5fdebc73eb08/beatmachine-2.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1c9c9eb012d31635c40cedd53bb4436c", "sha256": "83e03a4e95b0270428f4fab6d04816e38ecf9c9d570112cf881c631043bf5cca" }, "downloads": -1, "filename": "beatmachine-2.1.0.tar.gz", "has_sig": false, "md5_digest": "1c9c9eb012d31635c40cedd53bb4436c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21286, "upload_time": "2019-09-08T22:26:48", "url": "https://files.pythonhosted.org/packages/f6/b6/a8b5db53a5b779a659274401deffa98f71918eaff53a9b1d5cd8fe2db5af/beatmachine-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "9bfd4d87bea2ef340315515c0fac5f27", "sha256": "d8bf18605ca3fd9a1c567039126e86d2bc775fea75b9b8e5dab516155b21560d" }, "downloads": -1, "filename": "beatmachine-2.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9bfd4d87bea2ef340315515c0fac5f27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19839, "upload_time": "2019-10-12T02:39:10", "url": "https://files.pythonhosted.org/packages/7c/e6/7fc96b947c1b3197a365be27e57b621a434c09809be5e4299cea8b8568fb/beatmachine-2.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "444a47e3f8b1f0b88ed49ea543681e31", "sha256": "f63e208c58e5047c8e4bb05853d149e322401d6796213543adda314435f5c5b5" }, "downloads": -1, "filename": "beatmachine-2.1.1.tar.gz", "has_sig": false, "md5_digest": "444a47e3f8b1f0b88ed49ea543681e31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21225, "upload_time": "2019-10-12T02:39:17", "url": "https://files.pythonhosted.org/packages/08/52/cb76decbe432dc149aa2419c0aa63b27d1dc78b4567640715ac220fd0178/beatmachine-2.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bfd4d87bea2ef340315515c0fac5f27", "sha256": "d8bf18605ca3fd9a1c567039126e86d2bc775fea75b9b8e5dab516155b21560d" }, "downloads": -1, "filename": "beatmachine-2.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9bfd4d87bea2ef340315515c0fac5f27", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19839, "upload_time": "2019-10-12T02:39:10", "url": "https://files.pythonhosted.org/packages/7c/e6/7fc96b947c1b3197a365be27e57b621a434c09809be5e4299cea8b8568fb/beatmachine-2.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "444a47e3f8b1f0b88ed49ea543681e31", "sha256": "f63e208c58e5047c8e4bb05853d149e322401d6796213543adda314435f5c5b5" }, "downloads": -1, "filename": "beatmachine-2.1.1.tar.gz", "has_sig": false, "md5_digest": "444a47e3f8b1f0b88ed49ea543681e31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21225, "upload_time": "2019-10-12T02:39:17", "url": "https://files.pythonhosted.org/packages/08/52/cb76decbe432dc149aa2419c0aa63b27d1dc78b4567640715ac220fd0178/beatmachine-2.1.1.tar.gz" } ] }