Orca

From Esolang
Jump to navigation Jump to search

Orca is a two-dimensional esoteric programming language in which every letter of the alphabet is an operation, where lowercase letters operate on bang, uppercase letters operate each frame. This livecoding language is designed to procedurally generate MIDI, UDP or OSC messages. It is maintained by Hundredrabbits.

Orca operates on a base of 36 increments, operators will convert alphanumeric values into values ranging from 0 to 36. Special characters are used to handle platform and client specific interactions.

Orca IDE

Operators

Orca has 28 basic operators, and various platform specific operators to send and receive data.

  • A add(a b): Outputs sum of inputs.
  • B bounce(a b): Outputs difference of inputs.
  • C clock(rate mod): Outputs modulo of frame.
  • D delay(rate mod): Bangs on modulo of frame.
  • E east: Moves eastward, or bangs.
  • F if(a b): Bangs if inputs are equal.
  • G generator(x y len): Writes operands with offset.
  • H halt: Halts southward operand.
  • I increment(step mod): Increments southward operand.
  • J jumper(val): Outputs northward operand.
  • K konkat(len): Reads multiple variables.
  • L less(a b): Outputs smallest of inputs.
  • M multiply(a b): Outputs product of inputs.
  • N north: Moves Northward, or bangs.
  • O read(x y read): Reads operand with offset.
  • P push(len key val): Writes eastward operand.
  • Q query(x y len): Reads operands with offset.
  • R random(min max): Outputs random value.
  • S south: Moves southward, or bangs.
  • T track(key len val): Reads eastward operand.
  • U uclid(step max): Bangs on Euclidean rhythm.
  • V variable(write read): Reads and writes variable.
  • W west: Moves westward, or bangs.
  • X write(x y val): Writes operand with offset.
  • Y jymper(val): Outputs westward operand.
  • Z lerp(rate target): Transitions operand to input.
  • * bang: Bangs neighboring operands.
  • # comment: Halts a line.

Sample programs

Orca operates on a base of 36 increments. Operators using numeric values will typically also operate on letters and convert them into base 36 values. The following scripts will add 4 numbers together, and also show a an example that adds the result of the addition of their results. A collection of sample programs can be found here.

................
.1A2....1A2A3A4.
..3A3....3A5A7..
...6A4....8Ac...
....a......k....
................

The following example will play a sequence of C, A, F & E. This uses the MIDI operator(:) to send the note coming from the Track(T) operator which changes over a time defined by the Clock(C) operator.

............
...wC4......
.gD234TCAFE.
...:02E.g...
............

Math Tables

This example file will generate various multiplication and addition tables.

...Cf..fCf.......................................................................
.xV9..yV5........................................................................
.................................................................................
...3Kx.y..............3Kx.y..............3Kx.y..............3Kx.y................
.2Kxy9M5............2Kxy9L5............2Kxy9B5............2Kxy9A5................
...95X9...............95X5...............95X4...............95Xe.................
.....000000000000000....000000000000000....0123456789abcde....0123456789abcde....
.....0123456789abcde....011111111111111....10123456789abcd....123456789abcdef....
.....02468acegikmoqs....012222222222222....210123456789abc....23456789abcdefg....
.....0369cfilorux036....012333333333333....3210123456789ab....3456789abcdefgh....
.....048cgkosw048cgk....012344444444444....43210123456789a....456789abcdefghi....
.....05afkpuz49ejoty....012345555555555....543210123456789....56789abcdefghij....
.....06ciou06ciou06c....012345666666666....654321012345678....6789abcdefghijk....
.....07elsz6dkry5cjq....012345677777777....765432101234567....789abcdefghijkl....
.....08gow4cks08gow4....012345678888888....876543210123456....89abcdefghijklm....
.....09ir09ir09ir09i....012345678999999....987654321012345....9abcdefghijklmn....
.....0aku4eoy8is2cmw....0123456789aaaaa....a98765432101234....abcdefghijklmno....
.....0bmx8ju5gr2doza....0123456789abbbb....ba9876543210123....bcdefghijklmnop....
.....0co0co0co0co0co....0123456789abccc....cba987654321012....cdefghijklmnopq....
.....0dq3gt6jw9mzcp2....0123456789abcdd....dcba98765432101....defghijklmnopqr....
.....0es6kycq4iwao2g....0123456789abcde....edcba9876543210....efghijklmnopqrs....
.................................................................................

External resources

Linux Pro, January 2020

"Orca feels like the evil musical hybrid of an assembly language, NetHack and Conway's Game Of Life" — FOSS Picks, Linux Pro, January 202