Skip to content

Instantly share code, notes, and snippets.

@trentgill
trentgill / main.c
Last active February 7, 2017 03:43
Simple program demonstrating a doubly-linked-list
/* A simple program demonstrating a doubly-linked-list library.
Intended to store arbitrary timestamps that must be maintained
in chronological order w/ neighbour access. */
#include <stdio.h>
#include "wrCueList.h"
cueList myCues;
int main(void) {
@trentgill
trentgill / search.c
Last active March 3, 2017 17:32
Generates a random tree, then searches for a node
/*
* Generates a random tree, then searches for a node
*
* Compile w GCC then run:
* > gcc search.c -o search
* > ./search
*/
#include <stdio.h>
#include <stdlib.h>
@trentgill
trentgill / forth-q.hs
Created August 21, 2018 03:35
Forth in haskell, reverse lookup via function
data FIWord = Imm
| Not
| NA deriving (Show, Eq)
type FDictEntry = (String, FIWord, FStackItem)
type FDict = [FDictEntry]
native_dict :: FDict
native_dict = [ (".S" ,Not, FFn fDOTESS )
, ("." ,Not, FFn fDOT )
]
--- default
-- a really weird way of writing a 30segment lfo
-- output 1 is the main output
-- outputs 2-4 are the default lfos
-- should probably add cv control over rate
-- start all the output actions
function init()
for c=1, 4 do
output[c].asl:action()
-- spacetime
-- norns study 3
--
-- ENC 1 - sweep filter
-- ENC 2 - select edit position
-- ENC 3 - choose command
-- KEY 3 - randomize command set
--
-- spacetime is a weird function sequencer.
-- it plays a note on each step.
--- druid.lua
-- a tiny shell for crow
local keycodes = include("druid/lib/keycodes")
local word = ""
local prompt = "> "
local console = {}
local CONSOLE_LEN = 6
local hist = {}
TARGET = without
WRLIB=submodules/wrLib
WRDSP=submodules/wrDsp
LUAS=submodules/lua
CC = gcc
LD = gcc
SRC = main.c \
function init()
-- start stuff
input[2].mode( 'change' )
--output[1]( macroseq(0.3) )
--output[2]( lfo(0.4) )
--output[3]( lfo(2) )
output[3].scale{ 0,3,7,10 }
output[3]( zoom() )
--- timeline sequencer
-- aka 'function tracker'
-- WARNING. NON FUNCTIONAL
line = 1 -- this makes it start at line 1!
function timeline_step(count)
if count == 1 then
print'1'
return
--- emulating Three Sisters' SPAN control
-- input 1 == frequency
-- input 2 == span
-- output (1,2,3) == low, centre, high
function init()
input[1].mode( 'stream', 0.01 )
for i=1,3 do output[i].slew = 0.01 end