NAME
orca – an esoteric programming language designed to quickly create procedural sequencers

SYNOPSIS
games/orca [ –i ] [ –p ] [ –bpm bpm ] [ –s WxH ] [ –r random_seed ] [ –c cursor ] [ –l undo_limit ] [ –n ] [ file ]

DESCRIPTION
Orca is not a synthesizer, but a flexible livecoding environment capable of sending MIDI, OSC & UDP to your audio/visual interfaces.

Every letter of the alphabet is an operation, where lowercase letters operate on bang, uppercase letters operate each frame. Extensive documentation of the language is available on the project's GitHub web page, see SOURCE section.

There are a number of options:
i    Destination IP address for UDP and OSC messages.
u    Port number for UDP messages to be delivered to.
m    Path to MIDI device for output.
s    Set initial dimensions of the grid to W x H.
p    Starts Orca in paused state.
r    Starts with a specific random seed.
b    Sets initial "beats per minute" value.
c    Sets the cursor character.
l    Sets the maximum number of undo steps. Default is 100.
n    Forces the use of nsec() instead of relying on RDTSC.

KEYS
'     Enter rectangle selection mode, use arrows to extend it.
Ctrl+i Insert
Toggle between append and insert (overwrite) mode.
Escape
Return to normal mode or deselect.
´
` ~
Toggle slide mode, use arrows to move the selected text around.
Space
Toggle pause.
Ctrl+r
Reset frame counter.
Ctrl+f
Forward one frame, useful in paused mode.
Ctrl+c Ctrl+x
Snarf/cut the selected text.
Ctrl+v
Paste from the snarf buffer.
Ctrl+Shift+v
Paste from the snarf buffer, ignoring empty cells within it, thus not overwriting what's been at the destination if possible.
Ctrl+z
Undo.
Ctrl+y
Redo.
Ctrl+u Ctrl+l
Convert selected text to upper/lower case.
Ctrl+a Ctrl+e
Jump to the beginning/end of the line.
Home End
Jump to the first/last line.
Delete Backspace Ctrl+h
Keys to remove text.
#     Comment/uncomment selected text.
Ctrl+k
Enter a command. See COMMANDS section for more information.
Alt+arrow
Move selected text.
Shift+arrow
Extend the selection. Works only in drawterm.
Ctrl+arrow
Jump by the number of cells set for the rulers.
<
>   Adjust BPM.
( ) _ +
Adjust grid size.
[ ] { }
Adjust rulers.
Ctrl+s
Save to file.

MOUSE
Mouse buttons works as one expects it. Left button selects a rectangle on the grid. Snarf and paste are available by the usual means. Right button held opens a menu.

Holding Shift and pressing left mouse button will extend the selection without changing the cursor position.

Holding Alt and pressing left mouse button will move the selection to the new cursor position, the cell under the mouse pointer.

COMMANDS
Commands can be entered into Orca either manually with Ctrl+k or with a $ operator. Arguments may be separated with a (semi)colon as well as any whitespace characters. All commands except undo , redo and color have a shorthand equivalent to their first two characters.

Any command can start with , (comma) to select the entire grid before executing the command.
|cmd arg...
Pipe the selected text to a shell command and paste its output back into the grid. Dots are replaced with spaces before feeding the input to the command, and the other way around when it comes to command's output.
<
cmd arg...
Execute a shell command and paste its output into the grid. Dots are replaced with spaces.
>
cmd arg...
Pipe the selected text to a shell command. Dots are replaced with spaces.
playResume.
stopPause.
run   Forward one frame.
copyCopy the selection to the snarf buffer.
paste
Paste from the snarf buffer.
erase
Erase the selected cells.
bpm NUMBER
Set new BPM value.
apm NUMBER
Animate BPM to the value.
frame NUMBER
Set frame value.
skip NUMER
Increase frame value.
rewind NUMBER
Decrease frame value.
ip ADDR
Set UDP/OSC destination IP address.
udp NUMBER|PATH
Set UDP destination port. Parameter is treated as a filename if it's an absolute path.
midi PATH
Set MIDI output path.
print
Print selected rectangle to stdout.
write TEXT [X] [Y]
Writes the text at the cursor position or at X,Y if specified.
inject FILE [X] [Y]
Injects a file at the cursor position or at X,Y if specified
select X Y [W] [H]
Select the specified rectangle.
color [rrggbb ...]
Change colors. Without any parameters it prints the current values.

Orca treats stdin as a stream of commands, you can run it like so:
aux/listen1 –t tcp!127.0.0.1!49160 games/orca

Then start the following in a separate "command" window:
telnet tcp!127.0.0.1!49160

PLUMBING
Orca supports injecting files at the current cursor position by plumbing. Add this to your plumbing rules to get it working:
type is     text
data matches     '[a–zA–Z¡–￿0–9_–.,/]+'
data matches     '([a–zA–Z¡–￿0–9_–.,/]+).orca'
arg    isfile      $0
data set    $file
plumb       to     orca
plumb       start       window games/orca $file

SOURCE
https://git.sr.ht/~ft/orca