Skip to content

Instantly share code, notes, and snippets.

View andr-ew's full-sized avatar
💭
;

& andr-ew

💭
;
View GitHub Profile
@andr-ew
andr-ew / norns-sync.sh
Created January 7, 2023 05:31
norns filesync script (maiden-remote-repl + rsync)
#!/bin/bash
sshpass -p "sleep" rsync -azP ~/dust/code/ --delete --exclude .git we@norns.local:/home/we/dust/code/
if [ -z "$1" ]
then
maiden-remote-repl send 'norns.script.load(norns.state.script)'
else
maiden-remote-repl send --host $1 'norns.script.load(norns.state.script)'
fi
@andr-ew
andr-ew / benchmark.lua
Created January 16, 2022 18:35
softcut interpolation branch benchmarking
-- interpolation branch benchmarking
interp = false
rate = 8
function init()
boundaries={
{1,1,80},
{1,82,161},
{1,163,243},
@andr-ew
andr-ew / pretty.lua
Last active October 6, 2021 00:35
lua pretty print
pretty = function(input)
local function serialize(o, f, skip, dof, types, itab)
itab = itab or ""
local ntab = itab .. " "
if types == nil then types = true end
if type(o) == "number" then
f(o)
elseif type(o) == "boolean" then
f(o and "true" or "false")
@andr-ew
andr-ew / fingers.lua
Created September 21, 2021 19:24
nest_ fingers demo
include 'nest_/lib/nest/core'
include 'nest_/lib/nest/norns'
include 'nest_/lib/nest/grid'
n = nest_ {
range = _grid.range {
x = { 1, 16 },
z = -1, --range shows up below tog
lvl = 4
},
@andr-ew
andr-ew / wrap.lua
Last active September 21, 2021 19:37
nest_ wrap example
include 'nest_/lib/nest/core'
include 'nest_/lib/nest/norns'
include 'nest_/lib/nest/grid'
n = nest_ {
num = _grid.number {
x = { 2, 14 }, y = 2,
wrap = 5, --wrap to the next line after 5 keys
level = { 4, 15 },
action = function(s, v) print(v) end --v is still range 1 - 13
@andr-ew
andr-ew / z.lua
Last active September 21, 2021 19:40
nest_ z-index example
include 'nest_/lib/nest/core'
include 'nest_/lib/nest/norns'
include 'nest_/lib/nest/grid'
-- when a nest draws affordances, it sorts them by increasing z values and draws them in that order
n = nest_ {
higher = _grid.number {
x = { 1, 16 },
y = 1,
lvl = 15,
@andr-ew
andr-ew / gendy-video.scd
Created May 27, 2021 15:19
gendy.kr() video
(
ServerOptions.devices;
s.options.device = "UMC404HD 192k";
s.boot;
)
(
~cc = Bus.control(s, 7);
MIDIIn.connectAll;
#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"
@andr-ew
andr-ew / syncolor.vim
Last active March 11, 2021 02:48
fix for changing a few syntax colors, replace /usr/share/vim/vim80/syntax/syncolor.vim
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Sep 12
" This file sets up the default methods for highlighting.
" It is loaded from "synload.vim" and from Vim for ":syntax reset".
" Also used from init_highlight().
if !exists("syntax_cmd") || syntax_cmd == "on"
" ":syntax on" works like in Vim 5.7: set colors but keep links
@andr-ew
andr-ew / scales.lua
Created March 8, 2021 18:04
norns scale data
local root, et = 440, 12
local tonics = {
['D#'] = -6,
['C#'] = -8,
['A'] = 0,
['A#'] = 1,
['G'] = -2,
['B'] = 2,
['G#'] = -1,