Live

say(...) --- Speak

say() speaks words aloud, in a neural voice that runs on your own machine (Piper): offline, no account, no cost. The speech plays like an audio() file, so it takes the same effects, levels, hush() and boxes, and fires on a signal like any cue. A text() can speak each word it shows.

Syntax

say("bro what") say(v1, "no shot", amp:0.8, reverb:0.4) say("this is actually crazy", rate:1.4) say("hello", voice:lessac) say("hello", voice:vctk, speaker:12) one of a voice's many speakers say("bro", trig:every(4, beat.hit)) say(w, voice:lessac, reverb:0.5) no words: how w speaks from now on

Parameters

param default description
(a quoted string) What to say.
uid say The sound's name — a bare name first, say(v1, "…"). hush(v1) stops it; a voice says one thing at a time, and the next thing said by the same name cuts it off.
voice en_US-lessac-medium, or the first installed A voice by its name, or part of it: lessac, en_GB.
speaker For a voice of many speakers: which, by number (speaker:12, wrapped into range) or by its name in the voice (speaker:p236). speaker:irand(0, 108) — a new speaker for every phrase.
rate 1 How fast: 0.5 slow and drawn out, 2 quick (0.25 … 4).
amp, pan, filter, reverb, delay, speed, fadeIn, fadeOut As for audio(). speed: changes the pitch with the speed; rate: keeps the pitch.
bus Through a shared fx() bus: say(a1, bus:room) — one room for several voices.
waveform none self gives it a box on the stage, like an audio(); then gui(v1, …) and the views.
trig A signal that says it each time: trig:every(4, beat.hit).

say(name, …) with no words sets how that name speaks from then on — its voice, rate and effects — for later say() lines and for a text that speaks under that name.

With text() — say:

text(uid:w, pick:["BRO", ["NO", "SHOT"]], dur:0.1, trig:every(4, beat.hit), say:1) say(w, reverb:0.4) the text's voice, with a room

say:1 speaks each word as it shows, in the default voice (say:lessac names one; sayRate: sets how fast). A word stays up until its voice has finished, however short dur: is. In a list in the list (["NO", "SHOT"]), each word is spoken in its half or third of the beat, and the last stays up until it is done. The speech is the text's uid: hush(w) silences it, and say(w, …) sets its voice and effects.

Timing

Each phrase is made once, for each voice and rate, and kept — a word said on every beat costs nothing after the first time. A speaking text makes all its words as soon as it runs, so on the beat they start at once (the first word of a new text can land a few hundredths of a second late). Piper's silence before and after a phrase is taken off, so a word starts on its beat.

Many speakers in one voice

Some voices hold many speakers: en_US-libritts_r-medium about 900, en_GB-vctk-medium 109 (British accents), en_US-arctic-medium 18. One download, a crowd:

say(a1, voice:vctk, speaker:3) say(a2, voice:vctk, speaker:40) say(a3, voice:libritts_r, speaker:irand(0, 903)) someone new every sentence

A new voice as well, every sentence — choose picks one each time:

say(a1, voice:choose(vctk, libritts_r), speaker:irand(0, 903))

(A speaker number past a voice's last wraps round: 500 on vctk, which has 109, is one of the 109.) The live console rolls a line's rand, irand and choose once when you run it, so the projector gets the same numbers — but not voice: and speaker: on a say() line: those roll for every phrase. A rolled voice or speaker (choose, irand) is made as each phrase is said, not ahead — the first word of a sentence comes a few hundredths of a second later. Type speaker: after a voice: of many speakers and the console offers the range.

Setting up Piper

Piper is not part of Oscilla; install it once:

pipx install piper-tts mkdir -p ~/.local/share/piper-voices && cd ~/.local/share/piper-voices ~/.local/share/pipx/venvs/piper-tts/bin/python -m piper.download_voices en_US-lessac-medium

then restart Oscilla. Other voices and languages are listed at the Piper voice samples: download each the same way, by its name (en_GB-alan-medium, de_DE-thorsten-medium …), and pick it with voice:. Elsewhere than these places, set OSCILLA_PIPER_PYTHON (Piper's Python) and OSCILLA_PIPER_VOICES (the voices' folder). Without Piper, say() writes one line in the console saying so, and stays quiet.

The phrases are kept in ~/.cache/oscilla-tts/; delete it to start afresh.

Tip: use ← → or ↑ ↓ to navigate the docs