arioso.base#

Core types and constants for arioso.

Defines the unified output types (Song, AudioResult) and the canonical set of affordance names that all platform adapters map to.

Module Attributes

COMMERCIAL_USE_VALUES

What a platform's commercial_use config field may say, about using its output commercially: the weights' licence allows it ("yes"), forbids it ("no"), allows it under conditions such as a revenue cap or use restrictions ("conditional"), the weights are not public and the hosted service's own terms decide ("provider terms"), or the terms are not settled: the licence is unstated, disputed or withdrawn, or the training-data chain is doubtful ("unclear").

Classes

Affordance(name, type, description[, ...])

Descriptor for a unified parameter affordance.

AudioResult([audio_bytes, audio_url, ...])

Unified audio output from any music generation platform.

Song([id, title, status, audio, metadata, ...])

A generated song with its metadata and audio data.

Exceptions

CatalogMatchError(message, *[, task_id, code])

A platform refused the input audio because it matches a catalogued recording.

class arioso.base.Affordance(name, type, description, default=None, minimum=None, maximum=None, title='', multiline=False)[source]#

Bases: object

Descriptor for a unified parameter affordance.

name#

Canonical parameter name used at the facade level.

Type:

str

type#

Expected Python type.

Type:

type

description#

Human-readable description.

Type:

str

default#

Default value (None means no default / required).

Type:

Any

minimum#

Smallest meaningful value, for bounded numbers (None: unbounded).

Type:

Optional[float]

maximum#

Largest meaningful value, for bounded numbers (None: unbounded).

Type:

Optional[float]

title#

Short display name (empty: derived from name). A platform’s param_map entry may give its own (Suno calls audio_input_strength “Audio Influence”).

Type:

str

multiline#

The value is free text whose line breaks matter (lyrics, a description), so a form must offer a multi-line field and keep its newlines. Emitted as the x-arioso.multiline schema hint for every platform; a param_map entry may still override it.

Type:

bool

class arioso.base.AudioResult(audio_bytes=None, audio_url='', audio_array=None, sample_rate=0, format='', duration_seconds=0.0)[source]#

Bases: object

Unified audio output from any music generation platform.

Exactly one of audio_bytes, audio_url, or audio_array will typically be populated by the platform adapter. Conversion between forms can be done on demand by the caller.

audio_bytes#

Raw audio file bytes (MP3, WAV, etc.).

Type:

Optional[bytes]

audio_url#

URL to download the audio file.

Type:

str

audio_array#

Numpy array of audio samples.

Type:

Optional[Any]

sample_rate#

Sample rate in Hz (e.g. 44100, 32000).

Type:

int

format#

Audio format string (e.g. “mp3”, “wav”, “pcm”).

Type:

str

duration_seconds#

Duration of the audio in seconds.

Type:

float

arioso.base.COMMERCIAL_USE_VALUES = ('yes', 'no', 'conditional', 'unclear', 'provider terms')#

What a platform’s commercial_use config field may say, about using its output commercially: the weights’ licence allows it ("yes"), forbids it ("no"), allows it under conditions such as a revenue cap or use restrictions ("conditional"), the weights are not public and the hosted service’s own terms decide ("provider terms"), or the terms are not settled: the licence is unstated, disputed or withdrawn, or the training-data chain is doubtful ("unclear"). Obligations on redistributing the weights themselves (LGPL, attribution) belong in weights_license, not here. denote’s backends use the same values.

exception arioso.base.CatalogMatchError(message, *, task_id=None, code=None)[source]#

Bases: RuntimeError

A platform refused the input audio because it matches a catalogued recording.

This is a policy refusal (copyright filter), not a transient failure: callers that retry or regenerate in a loop should treat it as final.

task_id#

The provider task id of the refused generation, if known.

code#

The provider’s error code (e.g. 413), if given.

class arioso.base.Song(id='', title='', status='pending', audio=AudioResult(), metadata=dict(), platform='')[source]#

Bases: object

A generated song with its metadata and audio data.

id#

Provider-specific identifier for the song.

Type:

str

title#

Song title (may be auto-generated by the platform).

Type:

str

status#

Generation status: pending, generating, complete, error.

Type:

str

audio#

The audio output.

Type:

AudioResult

metadata#

Provider-specific metadata dict.

Type:

dict

platform#

Name of the platform that generated this song.

Type:

str

property audio_array: Optional[Any]#

Shortcut to audio.audio_array.

property audio_bytes: Optional[bytes]#

Shortcut to audio.audio_bytes.

property audio_url: str#

Shortcut to audio.audio_url.

property error_message: str#

Extract error message from metadata, if any.

property is_error: bool#

Check if this Song represents an error response.

property sample_rate: int#

Shortcut to audio.sample_rate.