Skip to content

Instantly share code, notes, and snippets.

View PQCraft's full-sized avatar
🐧
I use Arch BTW

PQCraft PQCraft

🐧
I use Arch BTW
View GitHub Profile
@PQCraft
PQCraft / fakerand.h
Last active September 13, 2026 18:00
Transform an index into a random-looking ID and back
#ifndef FAKERAND_H
#define FAKERAND_H
#include <stdint.h>
typedef struct {
uint64_t add;
uint64_t mul;
uint64_t invMul;
} FakeRand;
@PQCraft
PQCraft / tape effect.md
Last active October 28, 2026 19:27
Audacity tape effect

audacity tape effect:

  1. download randompitch.ny and put it in ~/.local/share/audacity/Plug-Ins/ or %AppData%\audacity\Plug-Ins\
  2. open audacity and ensure 'Random Pitch Modulation' is enabled using 'Tools' -> 'Plugin Manager' with 'Category' set to 'All'. if necessary, search for 'rand'
  3. import your audio into audacity, optionally add some silence padding (make sure to merge the clips), and select the track
  4. apply 'Effect' -> 'Volume and Compression' -> 'Amplify' and use the default value (optionally adjust it a bit)
  5. create some distortion with 'Effect' -> 'Volume and Compression' -> 'Limiter'. equal 'Threshold' and 'Make-up target' values are recommended. good params are:
    • 'Threshold' and 'Make-up target': -3 to -9 (lower numbers for 'Threshold' result in more distortion, i recommend -5 for most things)
    • Defaults for other params ('Knee width': 0, 'Lookahead': 1.0, 'Release': 20.0)
  6. click on 'Effect' -> 'EQ
@PQCraft
PQCraft / CommandLineToArgvA.c
Last active July 23, 2022 04:35
CommandLineToArgvA implementation ported from WINE CommandLineToArgvW in a reduced and easier to read format
LPSTR* WINAPI CommandLineToArgvA(LPSTR lpCmdline, int* numargs) {
DWORD argc;
LPSTR* argv;
LPSTR s;
LPSTR d;
LPSTR cmdline;
int qcount, bcount;
if (!numargs || !*lpCmdline) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;