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>
-- 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.
@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()
--- 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
--- just friends poly sequencer
function init()
metro[1].event = n
metro[1].time = 0.2
metro[1]:start()
metro[2].event = n2
metro[2].time = 0.21
metro[2]:start()