You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cancel 4f5d4379e2 Update readme description/synopsis 5 years ago
examples Cleaned up examples 6 years ago
thirdparty Add WIP timing stuff 6 years ago
.clang-format Remove being/end ports blocks 6 years ago
.gitignore Init with basic test 6 years ago
LICENSE.md Updated examples and README / Added LICENSE 6 years ago
Makefile Update and simplify build tool script 5 years ago
README.md Update readme description/synopsis 5 years ago
bank.c Fix incorrect capacity adjustment in Oevent list 6 years ago
bank.h Add raw UDP datagram ';' operator 6 years ago
base.h Add start of X clipboard support 5 years ago
cboard.c Add setting of sel rect from gui cboard paste 5 years ago
cboard.h Add setting of sel rect from gui cboard paste 5 years ago
cli_main.c Change orca_run() to not clear input buffers 5 years ago
field.c Remove mark.h and mark.c 5 years ago
field.h Remove mark.h and mark.c 5 years ago
gbuffer.c Move mbuffer_* functions out of mark.h to gbuffer.h 5 years ago
gbuffer.h Move mbuffer_* functions out of mark.h to gbuffer.h 5 years ago
osc_out.c Cleanup stdio.h and Field naming. Add comment about Field. 6 years ago
osc_out.h Add raw UDP datagram ';' operator 6 years ago
sim.c Change orca_run() to not clear input buffers 5 years ago
sim.h Remove trigger/'piano' mode. 5 years ago
term_util.c Add auto-fit menu commands 5 years ago
term_util.h Add dimming of inactive/non-foreground menu contents 5 years ago
tool Update readme and tool script for new usage 5 years ago
tui_main.c Add ctrl+o to open file dialog 5 years ago

README.md

ORCΛ

Orca is an esoteric programming language designed to quickly create procedural sequencers, in which every letter of the alphabet is an operation, where lowercase letters operate on bang, uppercase letters operate each frame.

This application is not a synthesizer, but a flexible livecoding environment capable of sending MIDI, OSC & UDP to your audio/visual interfaces, like Ableton, Renoise, VCV Rack or SuperCollider.

If you need help, visit the chatroom or the forum.

This is the C implementation of the ORCΛ language and tools. The livecoding environment for this C version runs in a terminal. It's designed to be power efficient. It can handle large files, even if your terminal is small.

Quick Start for Debian/Raspbian (Raspberry Pi)

sudo apt-get install git libncurses5-dev libncursesw5-dev libportmidi-dev
git clone https://github.com/hundredrabbits/Orca-c.git
cd Orca-c
make                                   # Compile orca
build/orca --portmidi-list-devices     # Select MIDI device
build/orca --portmidi-output-device 2  # Start livecoding

Prerequisites

Core library: A C99 compiler (no VLAs required), plus enough libc for malloc, realloc, free, memcpy, memset, and memmove. (Also, #pragma once must be supported.)

Command-line interpreter: The above, plus POSIX, and enough libc for the common string operations (strlen, strcmp, etc.)

Livecoding terminal UI: The above, plus ncurses (or compatible curses library), and floating point support (for timing.) Optionally, PortMIDI can be used to enable direct MIDI output.

Build

The build script is in bash. It should work with gcc (including the musl-gcc wrapper) and clang, and will automatically detect your compiler.

Currently known to build on macOS (gcc, clang) and Linux (gcc, musl-gcc, and clang, optionally with LLD), and Windows via cygwin or WSL (gcc or clang).

There is a fire-and-forget make wrapper around the build script.

PortMIDI is an optional dependency. It can be enabled by adding the option --portmidi when running the tool build script.

Mouse awareness can be disabled by adding the --no-mouse option.

Build using make

make release    # optimized build, binary placed at build/orca
make debug      # debugging build, binary placed at build/debug/orca
make clean      # removes build/

The make wrapper will enable --portmidi by default. If you run the tool build script on its own, --portmidi is not enabled by default.

Build using the tool build script

Run ./tool help to see usage info. Examples:

./tool build -c clang-7 --portmidi orca
    # Build the livecoding environment with a compiler
    # named clang-7, with optimizations enabled, and
    # with PortMIDI enabled for MIDI output.
    # Binary placed at build/orca

./tool build -d orca
    # Debug build of the livecoding environment.
    # Binary placed at build/debug/orca

./tool build -d cli
    # Debug build of the headless CLI interpreter.
    # Binary placed at build/debug/cli

./tool clean
    # Same as make clean. Removes build/

Run ORCΛ Livecoding Environment

Usage: orca [options] [file]

General options:
    --margins <nxn>        Set cosmetic margins.
                           Default: 2x1
    --undo-limit <number>  Set the maximum number of undo steps.
                           If you plan to work with large files,
                           set this to a low number.
                           Default: 100
    --initial-size <nxn>   When creating a new grid file, use these
                           starting dimensions.
    --bpm <number>         Set the tempo (beats per minute).
                           Default: 120
    --seed <number>        Set the seed for the random function.
                           Default: 1
    -h or --help           Print this message and exit.

OSC/MIDI options:
    --strict-timing
        Reduce the timing jitter of outgoing MIDI and OSC messages.
        Uses more CPU time.

    --osc-server <address>
        Hostname or IP address to send OSC messages to.
        Default: loopback (this machine)

    --osc-port <number or service name>
        UDP port (or service name) to send OSC messages to.
        This option must be set for OSC output to be enabled.
        Default: none

    --osc-midi-bidule <path>
        Set MIDI to be sent via OSC formatted for Plogue Bidule.
        The path argument is the path of the Plogue OSC MIDI device.
        Example: /OSC_MIDI_0/MIDI

Additional options are available if orca is built with --portmidi:

    --portmidi-list-devices
        List the MIDI output devices available through PortMIDI,
        along with each associated device ID number, and then exit.
        Do this to figure out which ID to use with
        --portmidi-output-device

    --portmidi-output-device <number>
        Set MIDI to be sent via PortMIDI on a specified device ID.
        Example: 1

Example: build and run orca liveocding environment with MIDI output

$ ./tool build --portmidi orca           # compile orca using build script
$ build/orca --portmidi-list-devices     # query for midi devices
ID: 3    Name: IAC Driver Bus
ID: 4    Name: USB MIDI Device
$ build/orca --portmidi-output-device 3  # run orca with midi device 3

Livecoding Environment Controls

┌ Controls ───────────────────────────────────────────┐
│           Ctrl+Q  Quit                              │
│       Arrow Keys  Move Cursor                       │
│     Ctrl+D or F1  Open Main Menu                    │
│   0-9, A-Z, a-z,  Insert Character                  │
│    !, :, =, #, *                                    │
│         Spacebar  Play/Pause                        │
│ Ctrl+Z or Ctrl+U  Undo                              │
│           Ctrl+X  Cut                               │
│           Ctrl+C  Copy                              │
│           Ctrl+V  Paste                             │
│           Ctrl+S  Save                              │
│           Ctrl+F  Frame Step Forward                │
│           Return  Append/Overwrite Mode             │
│                /  Key Trigger Mode                  │
│        ' (quote)  Rectangle Selection Mode          │
│ Shift+Arrow Keys  Adjust Rectangle Selection        │
│           Escape  Return to Normal Mode or Deselect │
│          ( and )  Resize Grid (Horizontal)          │
│          _ and +  Resize Grid (Vertical)            │
│          [ and ]  Adjust Grid Rulers (Horizontal)   │
│          { and }  Adjust Grid Rulers (Vertical)     │
│          < and >  Adjust BPM                        │
│                ?  Controls (this message)           │
└─────────────────────────────────────────────────────┘

CLI interpreter

The CLI (cli binary) reads from a file and runs the orca simulation for 1 timestep (default) or a specified number (-t option) and writes the resulting state of the grid to stdout.

cli [-t timesteps] infile

You can also make cli read from stdin:

echo -e "...\na34\n..." | cli /dev/stdin

Extras

  • Support this project through Patreon.
  • See the License file for license rights and limitations (MIT).
  • Pull Requests are welcome!