History

more siren words

Paul Batchelor committed 5 years ago

Commit 87789ea1 parent c822e731 file · +17 −5Browse files

Unified · Split

doc/siren.org+17−5
@@ -1,12 +1,13 @@
1#+TITLE: The "Siren" Patch1#+TITLE: The "Siren" Patch
2* Overview2* Overview
3This document provides a rosetta stone for a =siren= patch.3This document provides a rosetta stone for a =siren= patch.
4It's not exactly the most interseting patch, but it is4It's not exactly the most interesting patch, but it
5succinctly shows how to work with a stack-based5succinctly shows how to work with a stack-based
6modular environment.6modular environment.
7 7
8I originally wrote this patch as a bridge to show the8I originally wrote this patch as a bridge to show the
9relationship between runt code and C + patchwerk code.9relationship between runt code and C + patchwerk code
10(included amongst the examples).
10Now, I have adapated a version of it that works in sndkit!11Now, I have adapated a version of it that works in sndkit!
11* Patch Description12* Patch Description
12The siren patch can be generally described in the following13The siren patch can be generally described in the following
@@ -60,6 +61,11 @@ computes 10 · 47 unmodified lines
60This implementation shows the siren written in C using61This implementation shows the siren written in C using
61the sndkit @!(ref "core" "core API")!@. The core62the sndkit @!(ref "core" "core API")!@. The core
62patch construction can be seen in the =patch= function.63patch construction can be seen in the =patch= function.
64What's really cool is how closely it matches the LIL code.
65If you take away the syntactic sugar in LIL, the underlying
66sndkit calls are essentially 1:1. This patch was written by
67hand looking at the LIL code above. It was a surprisingly
68trivial process!
63 69
64#+NAME: siren.c70#+NAME: siren.c
65#+BEGIN_SRC c :tangle siren.c71#+BEGIN_SRC c :tangle siren.c
@@ -160,7 +166,10 @@ int main(int argc, char *argv[]) · 94 unmodified lines
160* Implementation 3: Monolith and Runt166* Implementation 3: Monolith and Runt
161=Monolith= is a realtime computer music environment I wrote167=Monolith= is a realtime computer music environment I wrote
162for myself as a precursor to sndkit. =runt= is a quirky168for myself as a precursor to sndkit. =runt= is a quirky
163stack based language used to notate patches.169homemade stack based language used to notate patches.
170
171Even though sndkit uses TCL and C syntax, the thought
172process and structure I use is still in stacks.
164 173
165#+NAME: siren.rnt174#+NAME: siren.rnt
166#+BEGIN_SRC runt :tangle siren.rnt175#+BEGIN_SRC runt :tangle siren.rnt
@@ -186,9 +195,12 @@ add · 19 unmodified lines
186sr 10 * _compute rep195sr 10 * _compute rep
187#+END_SRC196#+END_SRC
188* Implementation 4: Monolith and Scheme197* Implementation 4: Monolith and Scheme
189=monolith= is primarily controlled via a Scheme REPL spawned198=monolith= is usually controlled via a Scheme REPL spawned
190inside of Emacs, the flavor of scheme being a fork of s9199inside of Emacs, the flavor of scheme being a fork of s9
191scheme.200scheme. Runt code is then executed in scheme as inline code.
201The scheme language is used as a kind of macro language,
202making it possible to build more complex structures and
203abstractions.
192 204
193The scheme =ugens= are wrappers around runt code, so it is205The scheme =ugens= are wrappers around runt code, so it is
194structurally identical to the runt and monolith code.206structurally identical to the runt and monolith code.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t