Half eso-lang, half vim plugin, all lua.

gwen b687b89180 bunp 3 éve
examples e18f06ea29 just dumping some .tRu scripts 3 éve
ftdetect f0f90c67b2 set up plugin 3 éve
lib 335c87d0a6 need thos exes huh 3 éve
lua d62485e4c6 host settings lol 3 éve
plugin d62485e4c6 host settings lol 3 éve
.gitignore 335c87d0a6 need thos exes huh 3 éve
.gitmodules 214e0cf8de fixing git submodules to reflect my new name n link 3 éve
LICENSE d61ea10d1b Initial commit 3 éve
README.md b687b89180 bunp 3 éve
tracks-r-us.png 1f92dc304e logo 3 éve

README.md

tracks-R-us

tracks-R-us is half esoteric programing language, half vim plugin, all lua.

The idea is that your code is executed one line at a time, and each line corresponds to one beat at the set BPM. You can see where execution is in a particular buffer by finding the playhead. It will be highlighted with the vim sign '~~' and a big green bar. Each vim buffer with .tRu or .tru in the buffern name will be executed, playheads are indepentend of each other. Lines will be loaded and executed as lua from within the vim process. The other core feature is that it integrates tightly with vim so you can use The One True Editor while you live code

Commands, Shortcuts, Paramters

Commands

:TruStart - Starts tRu playback

:TruPause - Pauses tRu playback. Playheads will keep thier positions

:TruToggle - Toggles play/pause

:TruStep - Move the playhead(s) forward by one beat. Mostly useful for debugging in pause mode.

Shortcuts

.t - TruToggle

.T - TruStep

parameters

g:tRuBPM - The BPM of the playhead(s). Defaults to 60, in order to change this mid-run you'll need to pause/unpause the playback to restart the timers

g:tRuPluginFolder - Read-only, string containing the path of the plugin folder

g:tRuPlaying - Read-only, 1 when tRu is playing 0 otherwise

Library

tRu comes with a small library of functions to give you more powah. Documentation below

osc

These functions allow you to send OSC messages. See lua-osc if you wany more complez osc packing By default tRu will send messages to localhost:6312

osc(address [, arguments])

The osc function must have an osc address which it will send, and it may be followed buy any number of strings, or numbers which will be sent as arguments to the OSC address.

-- results in an OSC message with the address '/hello' and arguments 'world', 1(and integer), and 2.3(a float) 
-- being sent to localhost:6312
osc('/hello', 'world', 1, 2.3)
n(macro)

The n function will execute a normal mode macro relative the playhead (NOT your cursor. I worked hard on that so it's important)

-- this line will copy itself downward. That line will then copy ITSELF downward
n('yyp')

You can run litterally any vim macro. which can most def crash/break things in fun and curious ways. So becareful I guess

ex(command)

The 'ex' function will run an ex mode command. It has a convenience code ~~ which if placed at the start will select the line where the play head is at before running the command

-- an inconvenient way to echo things (use lua's print instead)
ex('echo "hello, world"')

-- copies the line at the playhead into the unnamed buffer
ex('~~y')

-- would quit vim as soon as the playhead reached it
ex('qa!')
G(lineNumber) gg(lineNumber)

The G and gg functions will jump the playhead for this bufferto the specified line. If the line number is out of range it'll be skipped The top line in the file is number 1 not line 0

G(1)
gg(2)
j(number)

Moves the playhead down by number lines. Invalid numbers like 1.1 will result in no change, negative numbers will move upward.

j(2)
k(number)

Moves the playhead up by number lines. Invalid numbers like 1.1 will result in no change, negative numbers will move downward.

k(2)