Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norandiaconu/trialresearch
Beat Swap Module
https://github.com/norandiaconu/trialresearch
python
Last synced: 19 days ago
JSON representation
Beat Swap Module
- Host: GitHub
- URL: https://github.com/norandiaconu/trialresearch
- Owner: norandiaconu
- Created: 2015-02-09T21:49:08.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-16T16:53:56.000Z (almost 10 years ago)
- Last Synced: 2024-11-26T11:27:09.117Z (3 months ago)
- Topics: python
- Language: Python
- Homepage:
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TrialResearch
Beat Swap Module#Problem
We want to swap the first two beats in each bar of a song.#Question
1. Will this work for any song?
2. How do you identify the bars in a song?
3. How do you identify the beats in a song?#Resources
1. [Pyechonest]
2. [Remix Examples]###Abstract
After importing the mp3, it can be analyzed using the Echonest API. You are able to find and make the necessary changes in a for loop.
```python
for bar in bars:
beats = bar.children()
if (len(beats) >= 3):
(beats[1], beats[2]) = (beats[2], beats[1])
for beat in beats:
collect.append(beat);
```
You can then call the program on a file and supply an output filename to run the program.
```python
python beat_swap.py
python beat_swap.py lateralus.mp3 lateralus_swap.mp3
```
This allows the program to work for any song on your system.[Pyechonest]: https://github.com/echonest/pyechonest
[Remix Examples]: https://github.com/echonest/remix-examples