Skip to content

Instantly share code, notes, and snippets.

-- clARCk port
-- for arc-dev branch
-- original maxpat by JP
-- https://github.com/monome-community/collected/tree/master/clarck
-- engine.name = 'TestSine'
local steps = {}
local aleds = {{},{},{},{}}
@okyeron
okyeron / arc-functions.lua
Last active November 15, 2018 23:33
arc functions example
-- arc test / example functions
local ar = arc.connect()
function init()
ar.all(0) - clear all leds
for i=1,4 do
for j=1,64 do
@okyeron
okyeron / midi-example.lua
Last active December 23, 2018 02:05
midi test script - works well with drum machine like tr-09
-- enc 2 = bpm
-- enc 3 send clock on/off
-- key 2 = start
-- key 3 = stop
m = midi.connect(1)
local klk
local ticks_per_step = 6
local steps_per_beat = 4
local keyb = hid.connect(3)
local keyboard_codes = {
KEY_ESC="ESC",
KEY_1="1",
KEY_2="2",
KEY_3="3",
KEY_4="4",
KEY_5="5",
local keyb = hid.connect(1) -- connection is by vport number not device id
function init()
--tab.print(keyb)
-- print(" ")
--print(keyb.port .." " ..hid.devices[keyb.port].name)
print("List:")
tab.print(hid.list)
@okyeron
okyeron / keycodes.lua
Created February 5, 2019 06:43
keyboard codes to alphanumeric strings
-- keyboard map class
local keycodes = {}
keycodes.keys = {
[hid.codes.KEY_1]="1",
[hid.codes.KEY_2]="2",
[hid.codes.KEY_3]="3",
[hid.codes.KEY_4]="4",
[hid.codes.KEY_5]="5",
-- hid-terminal.lua
-- requires keycodes lib
-- enter text to the norns screen - upper and lower case text
local keyb = hid.connect()
local keycodes = require 'keycodes'
local wordarray ={}
@okyeron
okyeron / Engine_Atari2600.sc
Last active February 22, 2019 00:29
CroneEngine Atari2600
// CroneEngine_Atari2600
// Atari2600
// two independent voices, each of which has a 4 bit volume control (16 values),
// 5 bit pitch (32 values), and a 4 bit control register which selects the type of sound
// The standard labels for these registers are AUDV0 and AUDV1 for the volume registers,
// AUDF0 and AUDF1 for the pitch registers, and AUDC0 and AUDC1 for the control registers.
// The 5 bit pitch is very limited and the frequency values are simply divided down from
// 30KHz reference frequency creating higher or lower pitch
// Note that setting the pitch register to a lower value results in a higher pitch.
-- clock test
--
-- ...
-- .
engine.name = 'PolyPerc'
local dividers = { 1, 4, 8 }
local led_states = { false, false, false }
local sc = include("lib/tlps")
sc.file_path = "/home/we/dust/audio/tape/notis."
local lfo = include("lib/hnds")
local muted_L = false
local muted_R = false
rate = 1.0
rec = 1.0