Skip to content

Instantly share code, notes, and snippets.

@evanlh
evanlh / README.md
Last active April 8, 2023 13:44
Masterblaster progress update

For the last couple months I have been learning Common Lisp by prototyping a tracker-influenced MIDI sequencer. It's been a lot of fun! The UI is still much too barebones but the dream (& reason for the lofi look) is to keep prototyping until I have something that would work in a hardware form-factor. Here is a short demo of it hooked up to Waves Audio Electric88.

masterblaster.progress1.mp4

A few ideas I'm playing around with:

  • Looping on different track lengths creates evolving rhythmic textures
  • Euclidean sequencing (track-set-euclidean) is a fun & quick way to generate ideas
  • Side-by-side display of tracks with different ticks-per-bar
  • UI is still keyboard* driven ala Trackers (* & in the future hopefully knob-driven)
@evanlh
evanlh / font.lisp
Last active November 25, 2022 17:17
BDF font parser in CL
(defvar *bit-map* #(#*0000
#*0001
#*0010
#*0011
#*0100
#*0101
#*0110
#*0111
#*1000
#*1001
#!/usr/bin/python
import sys
import os
from Quartz import PDFDocument
from Foundation import NSURL
if __name__ == '__main__':
if len(sys.argv) < 2:
raise TypeError('Must provide path')
@evanlh
evanlh / hash_efficiency.md
Last active March 1, 2021 15:13
"Can you clarify how classes (and really hashes) can more efficiently use keys when the initialization definition is established?"

"Can you clarify how classes (and really hashes) can more efficiently use keys when the initialization definition is established?"

This a great question and a fairly deep topic to be diving into if you're early in your coursework. Which will make it extra fun to try answering! However I would caution that it may not be important to know at this phase, as a fair amount of modern programming consists in trusting that the little black boxes work the way they say they do & moving on to the larger task at hand. Performance and efficiency concerns are precisely where that approach can break down & it's very valuable to be willing to open up every box, so let's attempt it. This whole topic can best be addressed by a course or a good book on data structures & algorithms. Since I've never taken a formal course I'll share the intuitions that have helped me despite that.

Let's start with what makes hashes and classes represented as hashes efficient to begin with and then mov

@evanlh
evanlh / visualizer.md
Created March 6, 2019 22:48
SC Visualizer idea

Phase 1: Visualize the existing Server structure

Phase 2: Manipulate the graph!

@evanlh
evanlh / practiceNumbers.js
Created June 14, 2018 19:07
Practice your vietnamese numbers
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var digitsVietMap = {
0: 'không',
1: 'một',
@evanlh
evanlh / reader2.py
Last active April 10, 2017 03:27
reader2.py
# Importing CSV
import pandas as pd
df = pd.read_csv('QuickSearch.csv', delimiter=',')
print df.head(0)
# What columns are not relevant and removing them
input = raw_input("Which columns would you like to delete(no spaces after comma): ")
input_list = input.split(',')