Tutorial

A look around

The transport, the panels and the meters — where everything lives

Nothing here needs to be learned before the next chapter. Here’s an overview of the UI.

Projects

A project is a folder with a swync-project.json in it.

Projects store the tempo, the signature and the volume of your session.

A project will compile and run its main.swync file. Creating a new project will create an empty main file. This allows you to break large projects over multiple files using imports with use.

To hear the file you are in rather than the whole project press ⌘ ⇧ ,.

A folder with no main.swync in it plays the file you are currently working in.

The transport

  • play ⌘ , runs the project’s main.swync, ⌘ ⇧ , runs the file you are in, and ⌘ . is stop.

  • Tempo runs from 40 to 240, and it is a quarter note per minute in any signature.

  • Time signature Global time signature setting. Currently only: 4/4, 3/4, 2/4, 5/4, 6/8, 7/8, 12/8.

Volume is the master fader, after everything. Affects recording as well.

Tabs

Below the title bar, one per open file. A dot means unsaved. The + opens a new one, ⌘ N.

Worth knowing early: imports read what is saved, not what is on screen. A module with a dot on its tab is a module the file that uses it cannot see yet.

The file you are playing is the exception — unsaved edits in it are heard, so a main.swync with a dot on its tab plays what you can see. It is the files it imports that have to be written down first.

The panels

A tray of icons runs down each edge of the window, one icon per panel. Click an icon to bring its panel up, and click the one already showing to put the panel away — so only ever one is open on each side.

LeftProject, Search, Libraries, Problems
RightControls, Patterns, Reference, Settings

Problems wears the number of things the last run had to say, which is how a run that failed is visible with every panel shut.

Controls draws the sliders and buttons your program declares. You don’t add them there — you write them into the code, and they show up. That’s a chapter of its own later.

Patterns

Patterns draws patterns on a grid instead of typing them. New pattern adds a row; the row’s name is what you play. Create a named pattern and use it in your project:

play(hats, hat)

Click a row to open it in a composer tab. It has two modes — a piano roll and a drums row — and two tools:

DrawB
MoveV

Holding while in draw mode will activate Move mode. The opposite is true: move will activate draw.

Grid is how many cells divide the bar, any number up to 64.

The rows are a file stored with the project in patterns.swync. It is folded into every program the project runs giving you access to these patterns throughout your code.

The editor itself

The editor has autocomplete for anything in scope, including imports with use.

Hold to bring up context help. click it and the Reference opens at that name.

⌘ / comments the selection out.

New, Open…⌘ N, ⌘ O
New Project…, Open Project…⌘ ⇧ N, ⌘ ⇧ O
Install Library…, Export as Library…
Save⌘ S

Now back to the sound.