diff options
| author | Elis Eriksson <spelis.tech@gmail.com> | 2026-05-27 19:57:56 +0200 |
|---|---|---|
| committer | Elis Eriksson <spelis.tech@gmail.com> | 2026-05-27 19:57:56 +0200 |
| commit | f9200559114d9f2fa61f738b5322b0a5467538b6 (patch) | |
| tree | 3c6a6bd37250a560c67f598c2425a2031b9b307a /content | |
| parent | ae399cf38d26715c4a09b029b849abace3c3f309 (diff) | |
| download | spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar.gz spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar.bz2 spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar.lz spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar.xz spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.tar.zst spelis-web-f9200559114d9f2fa61f738b5322b0a5467538b6.zip | |
new update or smth idk
Diffstat (limited to 'content')
| -rw-r--r-- | content/blog/cbin.md | 14 | ||||
| -rw-r--r-- | content/blog/pipedals.md | 59 | ||||
| -rw-r--r-- | content/error.njk | 76 | ||||
| -rw-r--r-- | content/extras.md | 9 | ||||
| -rw-r--r-- | content/index.md | 16 |
5 files changed, 95 insertions, 79 deletions
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>"); + 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 @@ -<h1 id="error-code">Error</h1> -<img src="" id="error-image" style="width: 100%;"> - -<script> - const params = new URLSearchParams(window.location.search) - const code = params.get("code") || "404" - - // yes, i typed these out manually. - const messages = { - 400: "Bad request", - 401: "Unauthorized", - 402: "Payment required", - 403: "Forbidden", - 404: "Not found", - 405: "Method not allowed", - 406: "Not acceptable", - 407: "Proxy authentication required", - 408: "Request timeout", - 409: "Conflict", - 410: "Gone", - 411: "Length required", - 412: "Precondition failed", - 413: "Payload too large", - 414: "Request-URI too long", - 415: "Unsupported media type", - 416: "Request range not satisfiable", - 417: "Expectation failed", - 418: "I'm a teapot", - 419: "Page expired", - 420: "Enhance your calm", - 421: "Misdirected request", - 422: "Unprocessable entity", - 423: "Locked", - 424: "Failed dependency", - 425: "Too early", - 426: "Upgrade required", - 428: "Precondition Required", - 429: "Too many requests", - 431: "Request header fields too large", - 444: "No response", - 450: "Blocked by windows parental controls", - 451: "Unavailable for legal reasons", - 495: "SSL certificate error", - 496: "SSL certificate required", - 497: "HTTP request sent to HTTPS port", - 498: "Token expired/invalid", - 499: "Client closed request", - - - 500: "Internal server error", - 501: "Not implemented", - 502: "Bad gateway", - 503: "Service unavailable", - 504: "Gateway timeout", - 506: "Variant also negotiates", - 507: "Insufficient storage", - 508: "Loop detected", - 509: "Bandwidth limit exceeded", - 510: "Not extended", - 511: "Network authentication required", - 521: "Web server is down", - 522: "Connection timed out", - 523: "Origin is unreachable", - 525: "SSL handshake failed", - 530: "Site frozen", - 599: "Network connect timeout error" - } - - document.getElementById("error-code").textContent = "Error " + code + " - " + (messages[code] || "Unexpected error") - const host = Math.random() < 0.5 ? "cat" : "dog"; - const url = host === "dog" - ? `https://http.dog/${code}.jpg` - : `https://http.cat/${code}`; - - document.getElementById("error-image").src = url; -</script> 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 and games mainly in **C**, **Python**, and **Java**. Most of what I build lands somewhere between backend systems, low-level programming, and game development. --> +<!----> +<!-- I care a lot about performance, simplicity, and understanding how things work under the hood. A lot of what I do is learning by building, breaking, and refining things as I go; usually with a few questionable decisions along the way. --> -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 --- |
