arioso.platforms.magenta_rt.adapter#

Magenta RealTime 2 adapter: offline renders from a worker in magenta-rt’s own environment.

The model loads once, in a Worker running arioso/_workers/magenta_rt_worker.py with the runtime’s Python (MLX pinned below 0.32, which arioso’s environment need not share). Style comes from the text prompt or a reference_audio clip; there is no tempo control beyond the words, and no seed (the sampler is not seedable).

Classes

Adapter([config, make_worker])

Local Magenta RealTime 2 (MLX) adapter.

class arioso.platforms.magenta_rt.adapter.Adapter(config=None, *, make_worker=<class 'ps.isolated.Worker'>)[source]#

Bases: object

Local Magenta RealTime 2 (MLX) adapter.

close()[source]#

Stop the worker (the loaded model is released).

generate(prompt, *, duration=10.0, model='mrt2_small', temperature=1.3, top_k=40, guidance=3.0, reference_audio=None, **kwargs)[source]#

Render duration seconds in the style of prompt (or of reference_audio).

Parameters:
  • prompt (str) – Style text (genre, instruments, mood; tempo only as words).

  • duration (float) – Seconds of audio (25 frames a second).

  • model (str) – "mrt2_small" (real time on M1-class Macs) or "mrt2_base".

  • temperature (float) – Sampling temperature.

  • top_k (int) – Top-k sampling.

  • guidance (float) – CFG scale on the style embedding.

  • reference_audio – A clip whose style replaces the text prompt’s.

Returns:

A complete Song (48 kHz stereo wav).