Skip to content

Conversation

@djwugee
Copy link

@djwugee djwugee commented Sep 26, 2025

Librosa Final Implementation. No longer relys on EchoNest API key which i have tried to obtain for years

This commit replaces most Echonest library usage with Librosa, NumPy, and SoundFile for audio loading, analysis, and manipulation.

I successfully refactored:
- `remixer.py` (core Remixer class)
- `helpers/fastmodify.py`
- `remixers/blank.py`
- `remixers/beatbox.py`
- `remixers/doubletime.py`
- `remixers/dubstep.py`

`remixers/electrohouse.py` remains Echonest-dependent due to difficulties in applying the complex refactoring automatically.

Other changes:
- I updated `install.sh` to remove Echonest and add new dependencies (librosa, soundfile).
- I fixed various Python 2/3 compatibility issues and minor bugs identified during smoke testing.

Known testing limitations:
- `Beatbox` and `Dubstep` could not be fully verified due to missing sample files in the test environment.
- `DoubleTime` was not tested due to missing `soundstretch` in the test environment.
This commit replaces most Echonest library usage with Librosa, NumPy, and SoundFile for audio loading, analysis, and manipulation.

I successfully refactored:
- `remixer.py` (core Remixer class)
- `helpers/fastmodify.py`
- `remixers/blank.py`
- `remixers/beatbox.py`
- `remixers/doubletime.py`
- `remixers/dubstep.py`

`remixers/electrohouse.py` remains Echonest-dependent due to difficulties in applying the complex refactoring automatically.

Other changes:
- I updated `install.sh` to remove Echonest and add new dependencies (librosa, soundfile).
- I fixed various Python 2/3 compatibility issues and minor bugs identified during smoke testing.

Known testing limitations:
- `Beatbox` and `Dubstep` could not be fully verified due to missing sample files in the test environment.
- `DoubleTime` was not tested due to missing `soundstretch` in the test environment.
This commit replaces most Echonest library usage with Librosa, NumPy, and SoundFile for audio loading, analysis, and manipulation.

I successfully refactored:
- `remixer.py` (core Remixer class)
- `helpers/fastmodify.py`
- `remixers/blank.py`
- `remixers/beatbox.py`
- `remixers/doubletime.py`
- `remixers/dubstep.py`

`remixers/electrohouse.py` remains Echonest-dependent due to difficulties in applying the complex refactoring automatically.

Other changes:
- I updated `install.sh` to remove Echonest and add new dependencies (librosa, soundfile).
- I fixed various Python 2/3 compatibility issues and minor bugs identified during smoke testing.

Known testing limitations:
- `Beatbox` and `Dubstep` could not be fully verified due to missing sample files in the test environment.
- `DoubleTime` was not tested due to missing `soundstretch` in the test environment.
- Removed Flash-based WebSocket fallbacks (SWFObject, FABridge).
- Upgraded client-side Socket.IO from v0.6 to v4.7.5.
  - Updated static/js/front.js to use the new Socket.IO client API.
- Upgraded server-side WebSocket handling from tornadio to python-socketio.
  - Refactored server.py to use python-socketio with ASGI.
  - Updated ProgressSocket and MonitorSocket to AsyncNamespaces.
  - Modified RemixQueue and relevant RequestHandlers to use the new
    Socket.IO emit mechanisms.
- Modernized SoundCloud player embed in index.html to use iframe.

This commit prepares your application for testing of core functionalities
with the updated technologies.
This commit addresses the "refactor entire codebase" issue with a focus on three main goals:
1. Python 3 compatibility: Updated syntax across all Python files, replacing Python 2 constructs.
2. Functionality of all remixers:
    - Overhauled `remixers/electrohouse.py` to remove Echonest dependencies and reimplement its logic using Librosa and NumPy.
    - Ensured `remixers/beatbox.py` and `remixers/dubstep.py` are consistent with Librosa and Python 3.
    - Verified functionality of `remixers/doubletime.py` and `remixers/blank.py`.
3. Performance improvements:
    - Optimized `remixers/dubstep.py` by pre-calculating and caching pitch information to speed up sample searching.
    - Reviewed other remixers for performance considerations.

The refactoring also included:
- Ensuring consistent stereo audio processing.
- Standardizing on Librosa for audio loading, analysis, and manipulation.
- Reviewing and updating helper modules and server code for Python 3 and async best practices where applicable within the defined scope.
This commit addresses several issues that were causing the remixing functionality to fail:

- Fixes an "Array Validation Bug" in `dubstep.py` and `electrohouse.py` by using `.size` to check for empty NumPy arrays.
- Fixes a "Beat Tracking Bug" in `dubstep.py` and `electrohouse.py` by casting the tempo to a float.
- Fixes a `TypeError` in `dubstep.py` caused by an outdated `librosa.util.pad_center` API call.
- Adds a `requirements.txt` file to manage Python dependencies.
- Installs missing command-line tools (`soundstretch`, `lame`, `shntool`).
@djwugee djwugee closed this Sep 26, 2025
@djwugee djwugee reopened this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant