Skip to content

Instantly share code, notes, and snippets.

Avatar

Visa-Valtteri Pimiä visy

View GitHub Profile
View minicubetest.s
include "64cube.inc"
ENUM $0
frame rBYTE 1
pnt rWORD 1
yc rBYTE 1
lines rBYTE 1
line_pad rBYTE 1
line_end rBYTE 1
@visy
visy / worstcodec.pde
Created May 9, 2021
16x16 macroblock video codec (aka. worst codec of all time) for 256x256 images
View worstcodec.pde
PGraphics source;
PGraphics sparse;
PGraphics filled;
PImage test;
color[] colortab = new color[256*16];
int[] sparsepixels = new int[256*16];
void sampleSparse() {
@visy
visy / rosette.asm
Created Jul 2, 2017
"Rosette" - a 16k C64 intro source code
View rosette.asm
// Uses Kick Assembler
//
// Switch bank in VIC-II
//
// Args:
// bank: bank number to switch to. Valid values: 0-3.
//
.macro SwitchVICBank(bank) {
View karplus2
var freq1 = Slot(1.0);
var ad1 = AdjustableDelay(110.1, freq1);
var lp1 = LowPass();
function dsp(t) {
var tau = Math.PI*2 - t*0.1;
var ts = t % (0.1);
var ts2 = t % 0.15;
freq1(1/(400 + Math.floor(cos(t*tau)*50) + Math.cos(ts2*(100.0-Math.abs((t*1.0))))*100+200*cos(110*t*tau)));
View karplus
var freq1 = Slot(1.0);
var ad1 = AdjustableDelay(110.1, freq1);
var lp1 = LowPass();
function dsp(t) {
var ts = t % (0.1);
var ts2 = t % 0.15;
freq1(1/(400 + Math.floor(cos(t*tau)*50) + Math.cos(ts2*(100.0-Math.abs((t*2.4))))*100+200*cos(110*t*tau)));
var stroke = arp(ts, 1*noise(), 1, 100) + ad1();
ad1(lp1(stroke, 320000+Math.cos(ts*4.0)*10) * 0.99);