Skip to content

Instantly share code, notes, and snippets.

# create a NAND lookup table
#!/usr/bin/python3
import sys
for i in xrange(256):
if i % 16 == 0:
sys.stdout.write(" .db ")
# PB1 input
// set these fuse bits to 0:
// CKDIV8, SUT0, CKSEL3, CKSEL2, and CKSEL0
// the CPU clock is 31250 Hz
#define F_CPU 31250
#include <avr/io.h>
#include <avr/power.h>
#include <util/delay.h>
@FrankBuss
FrankBuss / blink.cpp
Created October 3, 2018 14:25
general class to simplify the syntax to write to a pin
@FrankBuss
FrankBuss / slowdown.lua
Created June 10, 2019 07:06
testing a slowdown Lua script for VCV Rack
-- max buffer length in seconds
length = 10
addLabel(50, 125, "Input", 20)
addLabel(50, 165, "Trigger", 20)
addLabel(50, 205, "Delay", 20)
addLabel(190, 125, "Output", 20)
input = addInput(20, 120)
trigger = addInput(20, 160)
delay = addInput(20, 200)
#!/usr/bin/python3
import pyaudio
import numpy as np
import sys
import time
import math
p = pyaudio.PyAudio()
@FrankBuss
FrankBuss / smiley.bas
Created September 7, 2019 02:59
show a smiley sprite with Commander X16
10 REM ADDRESS 12:5
20 VPOKE 4, $800, 0
30 REM ADDRESS 16:13 (STARTING AT $10000) AND 8 BPP MODE
40 VPOKE 4, $801, $88
50 REM X COORDINATE 7:0
60 VPOKE 4, $802, 220
70 REM X COORDINATE 9:8
80 VPOKE 4, $803, 0
90 REM Y COORDINATE 7:0
100 VPOKE 4, $804, 55
@FrankBuss
FrankBuss / test.txt
Created September 8, 2019 03:41
Commander X16 speed test
VPOKE4,0,33
MON
A0400 SEI
LDA #$04
STA $9F20
LDA #$02
STA $9F21
LDA #$00
STA $9F22
STA $9F23
@FrankBuss
FrankBuss / test.asm
Created September 8, 2019 04:05
ACME test for Command X16
; comppile with ACME (https://sourceforge.net/projects/acme-crossass/ )
; acme -f cbm -o test.prg test.asm
;
; then start in the emulator:
; x16emu -run test.prg
*=$0801
!byte $0b,$08,$01,$00,$9e,$32,$30,$36,$31,$00,$00,$00
@FrankBuss
FrankBuss / rackconvert.py
Created July 21, 2018 09:50
converts all text elements to paths in a SVG file, and extracts coordinates for circles
#!/usr/bin/python3
# In your SVG file you can add circles as placeholders for knobs and ports
# for each circle, add a property description text like this:
#
# name KNOB1
# ofs -4.75 -100.6
#
# This will create a header file entry like this:
#
@FrankBuss
FrankBuss / beeps.py
Created June 14, 2019 05:23
create a sequence of beeps with configurable pauses
#/usr/bin/python3
# play a sequence of beeps
# based on https://stackoverflow.com/a/27978895/3210924
import pyaudio
import numpy as np
from numpy import zeros
import sys
import time