LFC – a minimalist livecoding evironment

I posted some livecoding rehearsal videos the other day. If you wonder how this

l.ndef("xa")

works: I wrote a little helper for my upcoming performance called LFC (after LiFeCode, dunno…).

LFC {
classvar <>dict;
*doesNotUnderstand {|selector, args|
    var doc = Document.current;
    var currentSelectionStart = doc.selectionStart;
    var currentSelectionEnd = currentSelectionStart + doc.selectionSize;
    doc.string = doc.string.insert(
        currentSelectionEnd,
        dict[selector].format(*args)
    );
    doc.selectRange(currentSelectionStart, 0);
    ^""
}
*keys {
    dict.keys.printAll;
    ^""
}
}

I then have a dictionary in a file called modules.scd that looks like this:

(
ndef:
"
(
Ndef('%', {

});
)
")

Evaluating these lines then adds the stuff you see in the video:

LFC.dict = "%/modules.scd" .format(Document.current.dir).load;
l = LFC;

Have fun!

Leave a Reply