This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Tanh() saturator with ADAA (1st-order) | |
| // (c) 2026 Signalsmith Audio | |
| // 0BSD Licence, or you can re-distribution with any license you like, just replace this line | |
| #pragma once | |
| #include <cmath> | |
| template<typename Sample> | |
| class TanhSaturator { | |
| // Accuracy limit to avoid divide-by-(almost)-zero |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // PCG-32 implementation: https://pcg-random.org/ | |
| // (c) 2026 Signalsmith Audio | |
| // 0BSD Licence, or you can re-distribution with any license you like, just replace this line | |
| #include <random> | |
| struct Pcg32 { | |
| uint64_t state; | |
| static constexpr uint64_t multiply = 6364136223846793005ULL; | |
| uint64_t add; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "elliptic-blep.h" | |
| #include "plot.h" | |
| #include "simple-fft.h" | |
| #include <vector> | |
| void generateWaveform(float freq, float shape, std::vector<float> &result, bool sawtooth) { | |
| float phase = 0; | |
| float gradUp = freq*2/shape; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if defined(__FAST_MATH__) && (__apple_build_version__ >= 16000000) && (__apple_build_version__ <= 16000099) | |
| # error Apple Clang 16.0.0 is broken, and generates completely incorrect code for some SIMD operations. -ffast-math makes it worse, so if you HAVE to use this version of Clang, you can't enable -ffast-math. | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <complex> | |
| #include <vector> | |
| #include <cmath> | |
| #include "./linear.h" | |
| #ifndef M_PI | |
| #define M_PI 3.14159265358979323846 | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JSON.simplified = v => { | |
| return JSON.stringify(v, null, '\t') | |
| .replace(/(\n\t*)"([a-z][a-z0-9_]*)"/ig, '$1$2') | |
| .replace(/(\n[\sa-z0-9_:]+)\{\n\t*(.*)\n\t+\}/ig, '$1{$2}') | |
| .replace(/(\n[\sa-z0-9_:]+)\[\n\t*(.*)\n\t+\]/ig, '$1[$2]'); | |
| }; | |
| JSON.parseSimplified = t => { | |
| return JSON.parse(t | |
| .replace(/(\n[\sa-z0-9_:]+)([\[\{])([^\n])/ig, '$1$2\n$3') | |
| .replace(/(\n\t*)([a-z][a-z0-9_]*):/ig, '$1"$2":') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef UTIL_CSV_WRITER | |
| #define UTIL_CSV_WRITER | |
| /* Optional helper class for outputting CSV data. Use like: | |
| CsvWriter csv("out"); // no .csv suffix | |
| // write individual values | |
| csv.write("foo", "bar"); | |
| csv.line(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UnitRangeMapReciprocal { | |
| double vMin, vTopFactor, vBottomFactor; | |
| public: | |
| UnitRangeMapReciprocal() : UnitRangeMapReciprocal(0, 0.5, 1) {} | |
| UnitRangeMapReciprocal(double min, double mid, double max) { | |
| vMin = min; | |
| double k = (mid - min)/(max - mid); | |
| vTopFactor = max*k - min; | |
| vBottomFactor = k - 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "https://twitter.com/every_peano/status/590740112625008641": { | |
| "exact": 0 | |
| }, | |
| "https://twitter.com/every_peano/status/1058469466714132480": { | |
| "relative": "https://twitter.com/every_peano/status/592203098388566016", | |
| "N": 30900 | |
| }, | |
| "https://twitter.com/every_peano/status/1057001290117595139": { | |
| "relative": "https://twitter.com/every_peano/status/1058469466714132480", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Installation | |
| brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
| # Easy Peasy | |
| ffmpeg -i video.mp4 video.webm |
NewerOlder