Skip to content

Instantly share code, notes, and snippets.

View alexglow's full-sized avatar

Alex Glow alexglow

View GitHub Profile
@alexglow
alexglow / 1-basic-arp-test
Last active January 30, 2023 05:54
sonic-pi-arpeggidata
# arpeggiate a given chord, over a given octave range
# easily change the root note & scale while it's running
# based on robin.newman, https://in-thread.sonic-pi.net/t/force-random-notes-into-a-scale-after-transposing/4493/2
notes = scale(:c3,:major,num_octaves: 3) # list of 22 notes
arp = [0,2,4,7,9,11,14,16,18,21] # note values for arpeggiation, 0-indexed
live_loop :test do
n=rand_i(10) # number of notes in "arp" list; pick one
puts n
@alexglow
alexglow / thr33p10-nfc-alert-WORKS.js
Last active October 11, 2019 22:27
how kill everloop when kill tag ???
const matrix = require("@matrix-io/matrix-lite");
const shell = require('shelljs')
const nfc = require("@matrix-io/matrix-lite-nfc");
var mode = 0;
everLoop();
nfc.read.start({rate:100, info:true}, (code, tag)=>{
if (code === 256){
console.log("Tag Was Scanned");
# Sonic Pi tutorial: https://sonic-pi.net/tutorial
# Gymnopédie No. 1 by Erik Satie – sheet music: https://musopen.org/music/8010-3-gymnopedies/
# Coded by Alex Glow
in_thread(name: :bass) do
bass_iter = 0
with_fx :reverb, room: 1 do
2.times do
8.times do
#with_fx :echo, mix: 0.4, phase: 0.4 do
@alexglow
alexglow / downloaded assistant demo
Last active October 6, 2018 01:51
snips ai output
AlexBox:~ alex$ sam install assistant -i proj_59lE2amy64B5
Downloading assistant
NLU training done
ASR training done
✔ Deploying assistant to raspberrypi.local...
Checking for skills
Cloning skill Snips.TimesTables_EN from url: https://github.com/snipsco/snips-skill-times-tables-quiz
Cloning into 'snips-skill-times-tables-quiz'...
@alexglow
alexglow / control.js
Created December 7, 2016 03:56
File for BLE Bot 9000
/*
Martin Kronberg
October 2016
npm install johnny-five
npm install ble-serial
npm install keypress
*/
var five = require("johnny-five"),
@alexglow
alexglow / radar
Created June 25, 2014 06:51
Pinoccio: Radar
LEAD SCOUT
function startup { run radar, 1000 }
function radar { led.green(500); message.group(7) }
FIELD SCOUTs
function on.message.group { if (arg(1) == 7) { t = 0; led.green(500); } }
function counter { if (t == 2) { led.orange }; if (t == 4) { led.red }; t = t+1; }
function startup { run counter, 1000 }
• Turn on Lead Scout & leave it plugged in
@alexglow
alexglow / scoutscript
Last active August 29, 2015 14:02
Pinoccio random-color sync demo
LEAD SCOUT:
function startup { run rotate,1000; };
function rotate { r = random(255); g = random(255); b = random(255); color; };
function color { led.setrgb(r,g,b); message.group(1,led.gethex()); };
FIELD SCOUT(S):
function on.message.group { key.print(arg(3)); led.sethex(arg(3)); };
// Turn the Lead Scout off, then on again - and make sure the Field Scout is also on. Each will flash its torch color when booting. After a brief pause, the Lead Scout will start turning the torch LED random colors once per second, and broadcast them to the Field Scout, which will mirror them.
@alexglow
alexglow / holycrap.txt
Created May 14, 2014 04:50
first Pinoccio + MindFlex brainwave session
// The first block of values are with the headset NOT ON MY HEAD -- just to test the data stream.
// The second block is with it on my head (there was no extra output in between). Holy crap holy crap holy crap.
// It's just: follow the hardware-hack tutorial I'll link elsewhere, upload Eric's sketch with a couple little tweaks, turn on headset!
// HEADSET NOT ON HEAD
UHello from Pinoccio!
(Shell based on Bitlash v2.0 (c) 2014 Bill Roy)
@alexglow
alexglow / room-lights
Created May 7, 2014 08:26
IRLib exploration with pinoccio
Playing around with my 5050 LED strips (non-individually-addressable 12V light strips). These come with several remotes; my room lights use the smallest one, which looks like this: http://ecx.images-amazon.com/images/I/517%2BZyjWbkL._SY300_.jpg
u% ÕN"–∏“¥…Hello from Pinoccio!
(Shell based on Bitlash v2.0 (c) 2014 Bill Roy)
17488 bytes free
Build 2014040301
Field Scout ready
@alexglow
alexglow / servo-specific-notes
Last active August 29, 2015 14:00
Sally and I are building a little weather display for Pinoccio Tryday! Here are my notes along the way.
To find the limits on a new servo ("testing testing"):
function tt { timer3.pwm(3, arg(1)); };
tt(whatever)
Black micro-servo: 40 / 120
Blue micro-servo: 30 / 115 (it seems to turn backwards from the black one?)
Black HS-311: 30 / 125