Skip to content

Instantly share code, notes, and snippets.

View AlexApps99's full-sized avatar

AlexApps99

  • NZ
  • 11:35 (UTC +12:00)
View GitHub Profile
@AlexApps99
AlexApps99 / fft-midi.py
Created April 7, 2023 09:59
Convert a .WAV music file into MIDI using a bunch of numbers and stuff
'''
Converts a .WAV music file into MIDI using a bunch of numbers and stuff
The gist of the program is:
- Load a mono WAV file
- Move a rolling window along the audio
- Multiply that window by a "hanning taper window" (this step is optional, it’s basically multiplying it by a bell-curve-like shape so the middle of the window has the most influence)
- Run an FFT on that window
- Set the velocity of each piano note to the average magnitude of its closest frequencies
@AlexApps99
AlexApps99 / crc64.rs
Created August 27, 2021 05:06
A simple const CRC64 hashing implementation in Rust
use std::hash::{Hash, Hasher};
const CRC64_ECMA182_POLY: u64 = 0x42F0E1EBA9EA3693;
const CRC64_TABLE: [u64; 256] = {
let mut crc64table = [0u64; 256];
let mut i = 0u64;
while i < 256 {
let mut crc = 0u64;
@AlexApps99
AlexApps99 / create_rtk_deck.py
Created December 14, 2020 05:04
Generate an Anki deck from a PDF file of Remembering the Kanji 1, 6th edition
#!/usr/bin/env python3
# By AlexApps99
# This Python script will generate an Anki deck from a PDF file of Remembering the Kanji 1, 6th edition.
# To use it, just use the command "python3 create_rtk_deck.py RTK.pdf RTK.apkg"
# Feel free to customize/modify it however you want, public domain code.
# There is unused functionality for getting stories/text too.
# If you have any questions on how to use this feel free to contact me.
# Dependencies:
# - genanki
# - beautifulsoup4
@AlexApps99
AlexApps99 / GBA link cable fun.md
Last active January 5, 2025 11:02
GBA link cable fun