GarageJam

8.0.1 · API Reference

GarageJam 8.0.1

Multitrack music studio for GNOME, written in Python 3 with GTK 4, libadwaita and GStreamer (including GStreamer Editing Services for the timeline). Projects are saved in the open GJXML format.

About this reference. It was assembled from the public 8.0 README and project layout. The source files could not be read when this page was generated, so class attributes below are derived from the GJXML schema, and the method-level entries are marked inferred. Parameter names and exact signatures should be checked against the source or pydoc garagejam. Version 8.0.1 specifics beyond the 8.0 README were not found.
LicenseGPL-3.0
LanguagePython 3
ToolkitGTK ≥ 4.12, libadwaita ≥ 1.5, GStreamer, GStreamer Editing Services
Homepagewww.garagejam.org
Repositorygithub.com/oleaamot-dev/music
Project file.gjxml (GJXML 1.0)

Package overview

The garagejam package separates the data model from the audio engine and the UI. The model has no GTK dependency, so it can be tested on its own.

ModuleBrief description
garagejam.projectModel (Project, Track, Clip) and GJXML read/write.
garagejam.engineGES timeline mirror, transport, metering, recording, export, waveform peaks.
garagejam.timelineArrange view: Cairo drawing, drag, trim and drop.
garagejam.trackheaderPer-track controls.
garagejam.windowMain window, actions and dialogs.
garagejam.appAdw.Application subclass and CSS.
garagejam.app ──► garagejam.window ──► garagejam.timeline
                        │                  garagejam.trackheader
                        ▼
                 garagejam.engine ──► garagejam.project (model)

Dependency direction is illustrative, based on the documented responsibilities of each module.

Module garagejam.project

Holds the in-memory model of a session and its serialisation to GJXML 1.0. Times are in seconds. Loading ignores unknown elements and attributes and clamps out-of-range values. Saving is atomic.

class Project

A session: global timing, metadata and an ordered list of tracks. Maps to the <project> element.

Attributes (from GJXML)
strname from name=Project name. Also names the recordings folder.
floattempoBeats per minute. Example file uses 96.
intbeats_per_barNumerator of the time signature (beats-per-bar).
intbeat_unitDenominator of the time signature (beat-unit).
intsample_rateSample rate in Hz (sample-rate), e.g. 48000.
dictmetadataFree-form tags such as artist. Written as tags on Ogg export.
list[Track]tracksOrdered tracks.

Python attribute names are inferred by snake-casing the XML attribute names.

class Track

One lane of the arrange view. Maps to <track>.

Attributes (from GJXML)
stridStable identifier, e.g. t1.
strnameDisplay name.
strcolorHex colour, e.g. #e66100.
floatvolumeLinear gain. The UI shows it in dB.
floatpanStereo position. 0 is centre.
boolmuteMute flag.
boolsoloSolo flag.
boolarmedRecord-arm flag.
list[Clip]clipsClips on this track. Overlaps on one track are refused.

class Clip

A region of an audio file placed on a track. Maps to <clip>.

Attributes (from GJXML)
stridIdentifier, e.g. c1.
strnameDisplay name.
strsrcAudio file path. Relative to the project file when the audio lives beside it.
floatstartPosition on the timeline, in seconds. Drags snap to half-beats unless Shift is held.
floatinpointOffset into the source file, in seconds. Changed by trimming the left edge.
floatdurationLength in seconds. Changed by trimming the right edge.
floatgainLinear multiplier applied on top of the track volume.

GJXML read / write inferred

Project loading and saving
def load(path) -> Project def save(project, path) -> None

Names and signatures are placeholders. The module is documented to read and write GJXML, but the exact entry points were not available.

Load behaviour
Unknown elements and attributes are ignored. Out-of-range values are clamped.
Save behaviour
Atomic. Audio paths are stored relative to the project when the files sit beside it.

Module garagejam.engine

Audio engine. Mirrors the model into a GStreamer Editing Services (GES) timeline and owns playback, recording, metering and export.

Responsibilities

AreaBehaviour
TransportPlay, pause, stop, seek, return to start.
MeteringLive input meter while recording, master L/R meters during playback.
RecordingOverdub: the timeline plays while the armed track records. The take is aligned to the first captured buffer and starts where recording began. If the armed track already has audio there, the take goes on a new track directly below. Files go to <project>-audio/, or ~/Music/GarageJam/<name>/ for an unsaved project.
ExportMix down to WAV or Ogg Vorbis. Project metadata is written as tags (Ogg).
WaveformsComputes peak data used by the timeline to draw clips.
DevicesOutput sink and input source are overridable, see environment variables.
Class and method names for this module were not available. The engine tests run headless using fakesink and audiotestsrc, so no sound card is required.

Module garagejam.timeline

The arrange view, drawn with Cairo.

  • Ruler in bars, beat grid, waveforms, playhead and autoscroll.
  • Zoom with Ctrl+scroll, Ctrl+plus and Ctrl+minus, plus zoom-to-fit.
  • Drag clips in time and between tracks. Snaps to half-beats, hold Shift to move freely.
  • Trim either clip edge. Split at the playhead, duplicate, delete.
  • Import audio by dropping files onto a lane.

Module garagejam.trackheader

Per-track controls shown left of each lane: name, colour, mute, solo, record-arm, pan, volume with a dB readout, reorder and delete.

Module garagejam.window

The main window. Registers the application actions, shows file dialogs (open, save, import, export), the project settings dialog (tempo, beats per bar, sample rate, metadata), the unsaved-changes prompt and the keyboard shortcuts window.

Module garagejam.app

Defines the Adw.Application subclass that starts the program, loads the application CSS and follows the system dark-mode setting. A .gjxml path given on the command line is opened at startup.

GJXML 1.0 file format

Root element <gjxml version="1.0" generator="GarageJam 8.0.0"> containing one <project>.

<?xml version="1.0" encoding="UTF-8"?>
<gjxml version="1.0" generator="GarageJam 8.0.0">
  <project name="Demo Jam" tempo="96" beats-per-bar="4" beat-unit="4" sample-rate="48000">
    <metadata>
      <artist>Ole Kristian Aamot</artist>
    </metadata>
    <tracks>
      <track id="t1" name="Drums" color="#e66100" volume="0.9" pan="0"
             mute="false" solo="false" armed="false">
        <clip id="c1" name="Groove" src="Demo Jam-audio/take-1.wav"
              start="0" inpoint="0" duration="5" gain="1"/>
      </track>
    </tracks>
  </project>
</gjxml>
ElementAttributes
gjxmlversion, generator
projectname, tempo, beats-per-bar, beat-unit, sample-rate
metadatachild elements such as artist
trackid, name, color, volume, pan, mute, solo, armed
clipid, name, src, start, inpoint, duration, gain

Times are seconds. inpoint is the offset into the source file. gain is a linear multiplier on top of the track volume. Unknown elements and attributes are ignored on load, and out-of-range values are clamped.

Actions & shortcuts

KeyAction
SpacePlay / pause
RRecord / stop recording
EscStop (press twice to return to start)
HomeGo to start
SSplit selected clip at playhead
DeleteDelete selected clip
Ctrl+DDuplicate clip
Ctrl+TAdd track
Ctrl+IImport audio
Ctrl+EExport mix
Ctrl+S / Ctrl+O / Ctrl+NSave / open / new

Environment variables

VariableDefaultDescription
GARAGEJAM_AUDIO_SINKautoaudiosinkGStreamer element used for playback, e.g. pulsesink.
GARAGEJAM_AUDIO_SRCautoaudiosrcGStreamer element used for recording, e.g. pipewiresrc.

Command line

./bin/garagejam                 # run from the source tree
./bin/garagejam song.gjxml      # open a project
pip install --user .  &&  garagejam

To open .gjxml files from Files, install data/org.garagejam.GarageJam.desktop into ~/.local/share/applications/ and register the MIME type:

xdg-mime install data/org.garagejam.GarageJam.mime.xml

Dependencies

GTK ≥ 4.12 and libadwaita ≥ 1.5.

Fedora

sudo dnf install python3-gobject python3-cairo gtk4 libadwaita \
    gstreamer1 gstreamer1-plugins-base gstreamer1-plugins-good \
    gstreamer1-plugins-bad-free gst-editing-services

Debian / Ubuntu

sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-4.0 gir1.2-adw-1 \
    gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 gir1.2-ges-1.0 \
    gstreamer1.0-plugins-base gstreamer1.0-plugins-good

Tests

python3 -m pytest

Covers the model and the headless engine. No sound card is needed.

File list

FileDescription
garagejam/project.pyModel and GJXML read/write
garagejam/engine.pyGES timeline mirror, transport, metering, recording, export, peaks
garagejam/timeline.pyArrange view
garagejam/trackheader.pyPer-track controls
garagejam/window.pyMain window, actions, dialogs
garagejam/app.pyAdw.Application, CSS
bin/garagejamLauncher script
data/Desktop entry, MIME definition
tests/pytest model and engine tests
pyproject.tomlPackaging