Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ enhanced_tracks/
mixed_tracks/
single_masters/

# Test artifacts
.coverage

# Other untracked files
test.sh
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2026-04-21

### Fixed
- Aligned `EnhanceMusicalStyle` enum with server — replaced incorrect values with 18 correct styles (e.g. `ROCK_INDIE`, `GRITTY_CRUNCHY`, `BALANCED`)
- Aligned `AnalysisMusicalStyle` enum with server — removed `DANCE`, added 9 mood-based styles (`AIRY_EXPANSIVE`, `AGGRESSIVE`, `BRIGHT`, etc.)
- Renamed `SoundSource.BACKING_VOCALS_GROUP` to `BACKING_VOX_GROUP` to match server
- Added missing `SoundSource.BRASS_GROUP` enum member
- Added missing `LoudnessPreference.NO_CHANGE` enum member
- Changed `MixEnhanceRequest.loudness_preference` default from `STREAMING_LOUDNESS` to `NO_CHANGE` to match server default
- Removed `MixEnhanceRequest.fix_drc_issues` field (not supported by server)
- `webhookURL` is now only included in payloads when explicitly provided, preventing server errors from empty strings
- Added `tenacity` to `install_requires` / `dependencies` — was imported but missing from package metadata, causing `ModuleNotFoundError` at import time

### Added
- `MixEnhanceRequest.get_processed_stems` field for requesting separated stems from enhancement
- `MixEnhanceRequest.apply_drum_enhancement` and `apply_vocal_enhancement` fields (required by server)

### Changed
- Updated examples, docstrings, and README to reflect all model and enum changes

## [1.3.0] - 2025-10-30

### Added
Expand Down Expand Up @@ -83,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Asynchronous task polling
- Secure file upload/download

[1.3.1]: https://github.com/roexaudio/roex-python/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/roexaudio/roex-python/compare/v1.2.1...v1.3.0
[1.2.1]: https://github.com/roexaudio/roex-python/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/roexaudio/roex-python/compare/v1.1.1...v1.2.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ cleanup_results = client.cleanup.retrieve_audio_cleanup(task.cleanup_task_id)
print("Cleanup Results:", cleanup_results)
```

**Available `SoundSource` options:** `KICK_GROUP`, `SNARE_GROUP`, `VOCAL_GROUP`, `BACKING_VOCALS_GROUP`, `PERCS_GROUP`, `STRINGS_GROUP`, `E_GUITAR_GROUP`, `ACOUSTIC_GUITAR_GROUP`.
**Available `SoundSource` options:** `KICK_GROUP`, `SNARE_GROUP`, `VOCAL_GROUP`, `BACKING_VOX_GROUP`, `PERCS_GROUP`, `BRASS_GROUP`, `STRINGS_GROUP`, `E_GUITAR_GROUP`, `ACOUSTIC_GUITAR_GROUP`.

**Output:** A dictionary containing status information and potentially details about the cleanup process. The primary result is often implicitly the cleaned audio accessible via a related process or understanding, though the API might provide specific output URLs depending on future implementation.

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here's a summary of the available examples and their usage:
* **`audio_cleanup_example.py`**:
* Purpose: Applies RoEx audio cleanup to a specific sound source within an audio file (WAV, FLAC).
* Usage: `python audio_cleanup_example.py <path_to_audio_file> <sound_source>`
* Valid `<sound_source>` values: `KICK_GROUP`, `SNARE_GROUP`, `VOCAL_GROUP`, `BACKING_VOCALS_GROUP`, `PERCS_GROUP`, `STRINGS_GROUP`, `E_GUITAR_GROUP`, `ACOUSTIC_GUITAR_GROUP`
* Valid `<sound_source>` values: `KICK_GROUP`, `SNARE_GROUP`, `VOCAL_GROUP`, `BACKING_VOX_GROUP`, `PERCS_GROUP`, `BRASS_GROUP`, `STRINGS_GROUP`, `E_GUITAR_GROUP`, `ACOUSTIC_GUITAR_GROUP`

* **`enhance_example.py`**:
* Purpose: Enhances a single audio mix file (WAV, FLAC, MP3).
Expand Down
3 changes: 2 additions & 1 deletion examples/audio_cleanup_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
- KICK_GROUP: Kick drums and low-frequency percussion
- SNARE_GROUP: Snare drums and mid-frequency percussion
- VOCAL_GROUP: Lead vocals and spoken word
- BACKING_VOCALS_GROUP: Background vocals and harmonies
- BACKING_VOX_GROUP: Background vocals and harmonies
- PERCS_GROUP: General percussion and drums
- BRASS_GROUP: Brass instruments
- STRINGS_GROUP: String instruments
- E_GUITAR_GROUP: Electric guitars
- ACOUSTIC_GUITAR_GROUP: Acoustic guitars
Expand Down
1 change: 0 additions & 1 deletion examples/enhance_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def enhance_workflow(input_file: str = None):
musical_style=EnhanceMusicalStyle.POP, # Choose appropriate style
is_master=False, # Set to True if input is already mastered
fix_clipping_issues=True,
fix_drc_issues=True,
fix_stereo_width_issues=True,
fix_tonal_profile_issues=True,
fix_loudness_issues=True,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "roex_python"
version = "1.3.0"
version = "1.3.1"
description = "Pip package for the RoEx Tonn API"
readme = "README.md"
authors = [
Expand All @@ -28,6 +28,7 @@ classifiers = [
]
dependencies = [
"requests>=2.25.0",
"tenacity>=8.0.0",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion roex_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
for audio mixing, mastering, analysis, and enhancement.
"""

__version__ = "1.3.0"
__version__ = "1.3.1"
__author__ = "RoEx Audio"
__email__ = "support@roexaudio.com"
__license__ = "MIT"
Expand Down
4 changes: 2 additions & 2 deletions roex_python/controllers/audio_cleanup_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def clean_up_audio(self, audio_cleanup_data: AudioCleanupData) -> Optional[Audio
The operation is synchronous and returns the results directly.

Supported Sound Sources (SoundSource Enum):
KICK_GROUP, SNARE_GROUP, VOCAL_GROUP, BACKING_VOCALS_GROUP,
PERCS_GROUP, STRINGS_GROUP, E_GUITAR_GROUP, ACOUSTIC_GUITAR_GROUP
KICK_GROUP, SNARE_GROUP, VOCAL_GROUP, BACKING_VOX_GROUP,
PERCS_GROUP, BRASS_GROUP, STRINGS_GROUP, E_GUITAR_GROUP, ACOUSTIC_GUITAR_GROUP

Supported File Formats: WAV, FLAC

Expand Down
34 changes: 18 additions & 16 deletions roex_python/controllers/enhance_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def create_mix_enhance(self, request: MixEnhanceRequest) -> MixEnhanceResponse:
>>> # Assume 'client' is an initialized RoExClient
>>> enhance_req = MixEnhanceRequest(
... audio_file_location="https://example.com/my_final_mix.wav",
... musical_style=EnhanceMusicalStyle.ROCK,
... musical_style=EnhanceMusicalStyle.ROCK_INDIE,
... apply_mastering=True,
... stem_processing=True # Request stems along with the enhanced mix
... )
Expand Down Expand Up @@ -272,19 +272,21 @@ def _prepare_mix_enhance_payload(self, request: MixEnhanceRequest) -> Dict[str,
API payload dictionary
"""
logger.debug(f"Preparing mix enhance payload for request: {request}")
return {
"mixReviveData": {
"audioFileLocation": request.audio_file_location,
"musicalStyle": request.musical_style.value,
"isMaster": request.is_master,
"fixClippingIssues": request.fix_clipping_issues,
"fixDRCIssues": request.fix_drc_issues,
"fixStereoWidthIssues": request.fix_stereo_width_issues,
"fixTonalProfileIssues": request.fix_tonal_profile_issues,
"fixLoudnessIssues": request.fix_loudness_issues,
"applyMastering": request.apply_mastering,
"webhookURL": request.webhook_url,
"loudnessPreference": request.loudness_preference.value,
"stemProcessing": request.stem_processing
}
data = {
"audioFileLocation": request.audio_file_location,
"musicalStyle": request.musical_style.value,
"isMaster": request.is_master,
"fixClippingIssues": request.fix_clipping_issues,
"fixStereoWidthIssues": request.fix_stereo_width_issues,
"fixTonalProfileIssues": request.fix_tonal_profile_issues,
"fixLoudnessIssues": request.fix_loudness_issues,
"applyMastering": request.apply_mastering,
"applyDrumEnhancement": request.apply_drum_enhancement,
"applyVocalEnhancement": request.apply_vocal_enhancement,
"loudnessPreference": request.loudness_preference.value,
"stemProcessing": request.stem_processing,
"getProcessedStems": request.get_processed_stems
}
if request.webhook_url is not None:
data["webhookURL"] = request.webhook_url
return {"mixReviveData": data}
24 changes: 12 additions & 12 deletions roex_python/controllers/mastering_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ def create_mastering_preview(self, request: MasteringRequest) -> MasteringTaskRe
"""
logger.info("Creating mastering preview")
logger.debug(f"Mastering preview request data: {request}")
payload = {
"masteringData": {
"trackData": [
{
"trackURL": request.track_url
}
],
"musicalStyle": request.musical_style.value,
"desiredLoudness": request.desired_loudness.value,
"sampleRate": request.sample_rate,
"webhookURL": request.webhook_url
}
data = {
"trackData": [
{
"trackURL": request.track_url
}
],
"musicalStyle": request.musical_style.value,
"desiredLoudness": request.desired_loudness.value,
"sampleRate": request.sample_rate,
}
if request.webhook_url is not None:
data["webhookURL"] = request.webhook_url
payload = {"masteringData": data}

try:
response = self.api_provider.post("/masteringpreview", payload)
Expand Down
16 changes: 8 additions & 8 deletions roex_python/controllers/mix_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,15 @@ def _prepare_mix_preview_payload(self, request: MultitrackMixRequest) -> Dict[st
"reverbPreference": track.reverb_preference.value
})

return {
"multitrackData": {
"trackData": track_data,
"musicalStyle": request.musical_style.value,
"returnStems": request.return_stems,
"sampleRate": request.sample_rate,
"webhookURL": request.webhook_url
}
data = {
"trackData": track_data,
"musicalStyle": request.musical_style.value,
"returnStems": request.return_stems,
"sampleRate": request.sample_rate,
}
if request.webhook_url is not None:
data["webhookURL"] = request.webhook_url
return {"multitrackData": data}

def _prepare_final_mix_payload(self, request: FinalMixRequest) -> Dict[str, Any]:
"""
Expand Down
10 changes: 9 additions & 1 deletion roex_python/models/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class AnalysisMusicalStyle(Enum):
METAL = "METAL"
INSTRUMENTAL = "INSTRUMENTAL"
ELECTRONIC = "ELECTRONIC"
DANCE = "DANCE"
HIP_HOP_GRIME = "HIP_HOP_GRIME"
POP = "POP"
ACOUSTIC = "ACOUSTIC"
Expand All @@ -38,6 +37,15 @@ class AnalysisMusicalStyle(Enum):
LO_FI = "LO_FI"
REGGAE = "REGGAE"
LATIN = "LATIN"
AIRY_EXPANSIVE = "AIRY_EXPANSIVE"
AGGRESSIVE = "AGGRESSIVE"
BRIGHT = "BRIGHT"
GRITTY_CRUNCHY = "GRITTY_CRUNCHY"
MELLOW_SMOOTH = "MELLOW_SMOOTH"
SHARP_BASSY = "SHARP_BASSY"
THUMPING_BOOMY = "THUMPING_BOOMY"
WARM = "WARM"
BALANCED = "BALANCED"


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion roex_python/models/audio_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class SoundSource(str, Enum):
KICK_GROUP = "KICK_GROUP"
SNARE_GROUP = "SNARE_GROUP"
VOCAL_GROUP = "VOCAL_GROUP"
BACKING_VOCALS_GROUP = "BACKING_VOCALS_GROUP"
BACKING_VOX_GROUP = "BACKING_VOX_GROUP"
PERCS_GROUP = "PERCS_GROUP"
BRASS_GROUP = "BRASS_GROUP"
STRINGS_GROUP = "STRINGS_GROUP"
E_GUITAR_GROUP = "E_GUITAR_GROUP"
ACOUSTIC_GUITAR_GROUP = "ACOUSTIC_GUITAR_GROUP"
Expand Down
3 changes: 2 additions & 1 deletion roex_python/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ class LoudnessPreference(Enum):
CD_LOUDNESS or STREAMING_LOUDNESS.
"""
CD_LOUDNESS = "CD_LOUDNESS"
STREAMING_LOUDNESS = "STREAMING_LOUDNESS"
STREAMING_LOUDNESS = "STREAMING_LOUDNESS"
NO_CHANGE = "NO_CHANGE"
45 changes: 20 additions & 25 deletions roex_python/models/enhance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,24 @@

class EnhanceMusicalStyle(Enum):
"""Musical styles for mix enhancement"""
ROCK = "ROCK"
ROCK_INDIE = "ROCK_INDIE"
POP = "POP"
TECHNO = "TECHNO"
TRAP = "TRAP"
JAZZ = "JAZZ"
METAL = "METAL"
SOUL = "SOUL"
FOLK = "FOLK"
ORCHESTRAL = "ORCHESTRAL"
PUNK = "PUNK"
BLUES = "BLUES"
AMBIENT = "AMBIENT"
ACOUSTIC = "ACOUSTIC"
EXPERIMENTAL = "EXPERIMENTAL"
HIP_HOP_GRIME = "HIP_HOP_GRIME"
COUNTRY = "COUNTRY"
FUNK = "FUNK"
RNB = "RNB"
INDIE_POP = "INDIE_POP"
INDIE_ROCK = "INDIE_ROCK"
AFROBEAT = "AFROBEAT"
DRUM_N_BASS = "DRUM_N_BASS"
HOUSE = "HOUSE"
TRANCE = "TRANCE"
LO_FI = "LO_FI"
HIPHOP_GRIME = "HIPHOP_GRIME"
ELECTRONIC = "ELECTRONIC"
REGGAE_DUB = "REGGAE_DUB"
ORCHESTRAL = "ORCHESTRAL"
METAL = "METAL"
OTHER = "OTHER"
GRITTY_CRUNCHY = "GRITTY_CRUNCHY"
BRIGHT = "BRIGHT"
WARM = "WARM"
SHARP_BASSY = "SHARP_BASSY"
THUMPING_BOOMY = "THUMPING_BOOMY"
MELLOW_SMOOTH = "MELLOW_SMOOTH"
AIRY_EXPANSIVE = "AIRY_EXPANSIVE"
AGGRESSIVE = "AGGRESSIVE"
BALANCED = "BALANCED"


@dataclass
Expand All @@ -46,15 +38,18 @@ class MixEnhanceRequest:
musical_style: EnhanceMusicalStyle
is_master: bool = False
fix_clipping_issues: bool = True
fix_drc_issues: bool = True
fix_stereo_width_issues: bool = True
fix_tonal_profile_issues: bool = True
fix_loudness_issues: bool = True
apply_mastering: bool = True
apply_drum_enhancement: bool = True
apply_vocal_enhancement: bool = True
webhook_url: Optional[str] = None
loudness_preference: LoudnessPreference = LoudnessPreference.STREAMING_LOUDNESS
loudness_preference: LoudnessPreference = LoudnessPreference.NO_CHANGE
stem_processing: bool = False
"""bool: If True, requests the generation of stems (e.g., vocals, bass, drums, other) alongside the enhanced mix. Defaults to False."""
get_processed_stems: bool = False
"""bool: If True, requests the processed stems alongside the enhanced mix. Defaults to False."""


@dataclass
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="roex_python",
version="1.3.0",
version="1.3.1",
author="RoEx Audio",
author_email="support@roexaudio.com",
description="Pip package for the RoEx Tonn API",
Expand Down Expand Up @@ -36,6 +36,7 @@
python_requires=">=3.7",
install_requires=[
"requests>=2.25.0",
"tenacity>=8.0.0",
],
extras_require={
"dev": [
Expand Down
Binary file added tests/fixtures/audio/test_track.wav
Binary file not shown.
Loading