Skip to content

Instantly share code, notes, and snippets.

@signaldust
signaldust / wav.cpp
Created August 24, 2024 16:06
Sort of realistic WAV loader
#include "wav.h"
#undef DEBUG_WAVEFORMAT
#include <cstring> // for memcmp
using namespace dust;
static const char * eNotRIFF = "Unknown file format.";
@signaldust
signaldust / halite.cpp
Created January 15, 2022 17:11
Halite - an analog circuit simulator in ~1k lines of code
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
// set to 1 to make LU factorization show pivots
#define VERBOSE_LU 0
// gMin for diodes etc..
static const double gMin = 1e-12;