Skip to content

Run Altar Studio from source ​

In this tutorial you'll get the code, run the interface in a browser, run the full desktop app, and make a small change you can see. It takes about 30 minutes, most of it waiting for the first Rust build.

What you need ​

  • Git
  • Node.js 20 or newer
  • Rust, stable, installed with rustup
  • The Tauri prerequisites for your system: on Windows, the Microsoft C++ Build Tools and WebView2 (already included in Windows 11); on macOS, run xcode-select --install; on Linux, WebKitGTK and the other libraries in Tauri's list, plus libasound2-dev for audio input
  • On Windows, Visual Studio 2022 17.14 or newer, which the speech engine's prebuilt libraries need
  • An internet connection for the first build, which downloads those libraries

Check them:

powershell
node -v
cargo -V

1. Get the code ​

powershell
git clone https://github.com/blackdice-byte/altar-studio.git
cd altar-studio
npm install

You're on the dev branch, where all work happens.

2. Run the interface in a browser ​

powershell
npm run dev

Open http://localhost:1420. You'll see the first-run wizard, the same as in the desktop app.

There's no Rust here. In a browser, Altar Studio uses a mock backend (src/lib/mock-backend.ts) that keeps everything in memory and in localStorage. Click through the wizard, install the sample content, and go to the Present page.

Try the core gesture: click a song in the schedule, press Enter once (it appears in Preview), then press Enter twice quickly (it goes Live).

Open Displays and outputs from the top bar and open an output on "Projector (simulated)". A popup window opens. That's the audience window, running from the same code with ?role=audience. Send another slide live and watch the popup follow.

Stop the server with Ctrl+C.

3. Run the desktop app ​

powershell
npm run tauri dev

The first time, Cargo downloads and compiles the backend's dependencies. This can take several minutes. Later runs are much faster.

The Altar Studio window opens. This time it's the real thing: a SQLite database, real files and real displays. Go through the first-run wizard again. The browser preview and the desktop app keep separate data. Let the wizard create a workspace in its default place, Documents/Altar Studio.

Leave it running.

4. Make a change ​

You'll change the status text in the control bar at the bottom of the Present page. With no output open, it reads Audience: Rehearsal (no output).

  1. Open src/control/present/ControlBar.tsx in your editor.
  2. Find the text Rehearsal (no output).
  3. Change it to Rehearsal (no projector). Save.

Back in the app, the control bar now reads Audience: Rehearsal (no projector). Vite reloaded the interface without restarting the app.

Now a backend change. Rust changes need a rebuild, which tauri dev does for you:

  1. Open src-tauri/src/outputs.rs and find output_identify. Near the end of it is this line:

    rust
    let secs = seconds.unwrap_or(4).clamp(1, 30);
  2. Make the test pattern stay up twice as long:

    rust
    let secs = seconds.unwrap_or(4).clamp(1, 30) * 2;
  3. Save. The terminal shows Cargo rebuilding, and the app restarts.

  4. Open Displays and outputs and click Identify displays. The numbers now stay up for 8 seconds instead of 4.

Undo both changes:

powershell
git checkout -- src/control/present/ControlBar.tsx src-tauri/src/outputs.rs

5. Run the tests ​

powershell
npm test

You should see 177 passing tests.

6. Try Listen and Autopilot without speaking ​

This step is optional. Listen and Autopilot hear the service through a microphone, but development builds can be fed a script or a recording instead, so you can watch them work at your desk.

First, build the Autopilot app into Altar Studio's target folder, so the development Altar Studio finds it next to its own executable. The path must be absolute:

bash
cd autopilot
CARGO_TARGET_DIR="$PWD/../src-tauri/target" npx tauri build --debug --no-bundle
cd ..

The commands in this step are written for a bash-style shell. In PowerShell, set each variable on its own line first, such as $env:CARGO_TARGET_DIR = "$PWD\..\src-tauri\target" or $env:ALTAR_AUTOPILOT_DEV = "word:auto,show,demo", then run the command without it.

Make sure the open service is the sample one from the first-run wizard: it has a sermon and the hymn "Amazing Grace". Then start Altar Studio with Autopilot switched on and the demo:

bash
ALTAR_AUTOPILOT_DEV=word:auto,show,demo npm run tauri dev

A few seconds after launch, Altar Studio switches Autopilot on for The Word in Auto mode, brings up Autopilot's window (show), and puts the sample sermon Live (demo). 27 seconds later it opens 1 Corinthians 13:4-7, as an operator would. Both apps print [autopilot] and [speech] lines to the terminal.

To give Autopilot something to hear, write a file of lines in the form <seconds>|<text> and pass it as ALTAR_AUTOPILOT_DEV_SAY=<file>. Autopilot hears each line at its time after it connects, as if it had been spoken. To use real speech recognition on a recording instead, set ALTAR_SPEECH_DEV_WAV=<file.wav>: Listen and Autopilot hear the file in real time instead of the audio input, then silence.

Other development aids, all ignored by release builds:

VariableEffect
ALTAR_AUTOPILOT_DEVA comma-separated list. word and songs with :auto, :suggest or :off switch Autopilot on. show brings up its window. demo is the sermon and passage above; demo2 is the sermon, then "Amazing Grace" at 27 s, with the operator taking each suggestion 2.5 s after it appears; demo3 is demo2 with nobody taking suggestions. earned lets every kind move Live in Auto, saved in that build's data folder. network moves Autopilot to another computer and pair opens pairing, printing the code.
ALTAR_AUTOPILOT_DEV_SAYA file of <seconds>|<text> lines Autopilot hears once, after it connects
ALTAR_SPEECH_DEV_WAVA WAV file that Listen and Autopilot hear instead of the audio input
ALTAR_AUTOPILOT_DEV_RECORD1 starts recording the service as Autopilot connects
ALTAR_AUTOPILOT_DEV_MODELA speech model id, such as nemo-streaming-en, that Autopilot uses for this run without saving it
ALTAR_AUTOPILOT_DEV_PAIR<address>:<port>:<code>, given to Autopilot started on its own: it pairs with that Altar Studio at launch

ALTAR_AUTOPILOT_PATH, which works in release builds too, points Altar Studio at an Autopilot executable anywhere on disk.

A recording made with ALTAR_AUTOPILOT_DEV_RECORD can be replayed through Autopilot's follower and scored against what happened on Live:

bash
npm run autopilot:measure -- <recording folder>... [--details] [--sweep] [--earned hymns,songs,word]

--details lists every wrong, late or missed decision, --sweep tries each of the follower's thresholds over a range, and --earned replays as if those kinds had earned Auto (with --types word:auto,songs:auto). The options are listed at the top of autopilot/scripts/measure-cli.ts.

To work on Autopilot's own window with hot reload, run npm run tauri dev in autopilot/ instead. Altar Studio then doesn't launch it.

What you've done ​

You've run Altar Studio both ways, and seen the two halves of the app: a React interface that reloads instantly, and a Rust backend that owns the data and the live output.

Next:

Altar Studio by Milton Black. Free and open source.