From f9200559114d9f2fa61f738b5322b0a5467538b6 Mon Sep 17 00:00:00 2001 From: Elis Eriksson Date: Wed, 27 May 2026 19:57:56 +0200 Subject: new update or smth idk --- content/blog/cbin.md | 14 +++++++++ content/blog/pipedals.md | 59 +++++++++++++++++++++++++++++++++++++ content/error.njk | 76 ------------------------------------------------ content/extras.md | 9 ++++++ content/index.md | 16 ++++++++-- 5 files changed, 95 insertions(+), 79 deletions(-) create mode 100644 content/blog/cbin.md create mode 100644 content/blog/pipedals.md delete mode 100644 content/error.njk create mode 100644 content/extras.md (limited to 'content') diff --git a/content/blog/cbin.md b/content/blog/cbin.md new file mode 100644 index 0000000..3dbd1a3 --- /dev/null +++ b/content/blog/cbin.md @@ -0,0 +1,14 @@ +--- +title: Made a Pastebin site :P +keywords: pastebin bin paste cbin +--- + +These past few days I've spent my time working on a project called CBin, along with my friend Jan Palma (who made the frontend). It is a pastebin server written in C (if you couldn't tell) + +It takes text, stores it in memory, and hands it back when asked. No accounts, no fluff, no "yeah stick this OAuth up your ass or fuck off". + +It runs entirely in-memory with FIFO eviction (sadly kind of slow, but fast enough to where it's unnoticable), meaning old pastes get yeeted off the face of the earth when things get full. + +The frontend lives in a separate universe (HTML/Typescript/CSS), maintained by Jan Palma, because I have no will to make a frontend myself (shit would look straight out of 1998) + +Overall, CBin is fast (fast enough), small, and mildly feral. It does one job, doesn't apologize for anything, and will absolutely forget your data if you blink wrong, or I get a power outage for more than a day. Not exactly the most memory safe but whatever. It's good enough to where if you aren't actively trying, you won't even notice. diff --git a/content/blog/pipedals.md b/content/blog/pipedals.md new file mode 100644 index 0000000..3136e3d --- /dev/null +++ b/content/blog/pipedals.md @@ -0,0 +1,59 @@ +--- +title: Dead simple digital guitar pedals in C +keywords: guitar pedal c simple +--- + +There's something I hate about the entire "professional digital audio workstation ecosystem", it's the complexity. + +Now I get why its so complex, it's for user simplicity. But I'm a programmer, I love tinkering, and I especially like simplicity in developing. + +Simplicity kind of fights the whole idea of VST plugins (or similar things). They have big SDKs that require you to conform to it's philosophies and all that bullshit. + +So I just replaced the entire workflow with this: + +`arecord | weird little C pedal programs | aplay` + +And somehow it just works. It just builds on Unix philosophies of making simple and transparent software, as well as using pipes and simple Linux tools (`aplay`, `arecord`) + +Each little pedal works something like this: (C pseudocode) + +```c +int main(int argc, char *argv[]) { + init_arg(argc,argv); // Sets CLI arguments for a pedal once. + while (1) { + size_t n = fread(in_i16, sizeof(int16_t), BLOCK_SIZE, stdin); // read raw data from arecord or previous pedal + if (n == 0) break; // abort if no data received + /* Convert i16 to float */ + effect(in_f, out_f, n); // run the effect for the current block of data + /* Make sure output isn't too loud and convert back to i16 */ + fwrite(out_i16, sizeof(int16_t), n, stdout); // write raw data to next pedal or aplay + } +} +``` + +And a pedal looks something like this: + +```c +static float gain; + +void init_arg(int argc, char **argv) { + if (argc != 1) // Validate argument count + error("Invalid arguments", "Usage: boost "); + gain = atof(argv[0]); // Store argument once (arguments starts at 0, check the source code i dare you) +} + +// Very simple gain pedal +void effect(const float *in, float *out, int n) { + for (int i = 0; i < n; i++) { + out[i] = in[i] * gain; // this is where math is done, most pedals should be a little more complex than this. + } +} +``` + +That's it. Just a small set of small programs to be chained together to produce cool guitar effects. + +There's also a little helper CLI which keeps you from entering the wrong parameters into arecord and aplay. + +Anyways that's basically it for this post. E-mail me patches [Guide](https://git.spelis.li/#patches) for new cool pedals or bugfixes. + +Some of the code is admittedly a little cursed, but honestly if the signal goes in and comes back out sounding cooler, I consider that a success. diff --git a/content/error.njk b/content/error.njk deleted file mode 100644 index 61c45d5..0000000 --- a/content/error.njk +++ /dev/null @@ -1,76 +0,0 @@ -

Error

- - - diff --git a/content/extras.md b/content/extras.md new file mode 100644 index 0000000..2043a71 --- /dev/null +++ b/content/extras.md @@ -0,0 +1,9 @@ +--- +title: Extras +layout: page +nav: 19 +--- + +[CBin](https://paste.spelis.li/) +[CGit](https://git.spelis.li/) +[File Share](https://share.spelis.li/) diff --git a/content/index.md b/content/index.md index 3e41358..b8f6b69 100644 --- a/content/index.md +++ b/content/index.md @@ -1,10 +1,20 @@ --- -title: "Home" +title: "Hey, I'm Spelis!" --- -Hey, I'm Spelis! + + + -I write software mainly in **C**, **Python** and **Java**. Currently learning **Zig**. +I'm a student from Sweden with a passion for writing simple code and playing bass guitar. Right now I mostly practice playing my favorite songs and writing the code that i like writing. + +### Knowledge + +* C + * Raylib +* Java + * FabricMC mods + * PaperMC plugins --- -- cgit v1.3-7-ge9ab