Skip to content

Instantly share code, notes, and snippets.

View curioustorvald's full-sized avatar

CuriousTorvald curioustorvald

View GitHub Profile

Funk Repeat and Invert Loop — EF $x in ProTracker 1.x

Formal specification, derived by transcription from the ProTracker 1.0C and 1.1B playroutine sources. Nothing here is derived from other articles or inferred from a third-party player; every claim is traceable to a line of 68000 assembly cited inline. Where the sources are silent or damaged, this document says so explicitly.

Audience: someone implementing EF $x — either half of it — in a software mixer.

0. Provenance

File What it is

Funk Repeat, Demystified

Or: how one effect letter held two completely different ideas, and why the one everybody remembers is the boring one

The effect nobody uses

Every MOD effect list has the same shape at the bottom. EC cuts the note, ED delays it, EE delays the pattern, and then there is EF $x, sitting at the end of the table like the last kid picked for football, labelled Invert Loop, and hardly anyone has ever written a tune with it on purpose.

Open a modern tracker and EF $x does this: it walks through your loop one byte at a time and flips each byte upside down. Leave it running and your nice sampled bass turns into a buzzsaw. Leave it running longer and — this is the bit people miss — it comes back, because flipping a byte twice gives you the byte back. It is a slow, destructive, unmusical waveform-mangler, and its own author could not be bothered to pretend otherwise.

daemon:
modules:
- Xim
- Wayland
- Indicator
indicator:
icon_color: White
log:
global_level: DEBUG
engine:
@curioustorvald
curioustorvald / crt_shader_with_composite_sim.frag
Last active November 25, 2025 15:41
Flat screen CRT shader with composite signal simulation for authenticity
#version 330 core
/*
Copyright 2025 CuriousTorvald
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// ============================================================================
// CRT + NTSC Composite/S-Video Signal Simulation Shader (Enhanced Version)
// ============================================================================
@curioustorvald
curioustorvald / srgb_to_xyb.c
Last active August 26, 2025 11:51
sRGB to XYB conversion
// XYB Color Space Conversion Functions
// Based on JPEG XL XYB specification with proper sRGB linearization
// test with:
//// gcc -DXYB_TEST_MAIN -o test_xyb xyb_conversion.c -lm && ./test_xyb
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
@curioustorvald
curioustorvald / tsvm_crt_shader.frag
Last active August 14, 2024 16:28
CRT Shader for TSVM emulator
/*
Copyright 2024 CuriousTorvald
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef GL_ES
precision mediump float;
#!/usr/bin/env python3
# This code is based on tutorial by slicktechies modified as needed to use oauth token from Twitch.
# You can read more details at: https://www.junian.net/2017/01/how-to-record-twitch-streams.html
# original code is from https://slicktechies.com/how-to-watchrecord-twitch-streams-using-livestreamer/
# 24/7/365 NAS adaptation by CuriousTorvald (https://gist.github.com/curioustorvald/f7d1eefe1310efb8d41bee2f48a8e681)
# Twitch Helix API integration by Krepe.Z (https://gist.github.com/krepe90/22a0a6159b024ccf8f67ee034f94c1cc)
# Chzzk adaptation by CuriousTorvald (https://gist.github.com/curioustorvald/240e67a53f8131d7166ad5269044c719)
# Copyright (c) 2017, 2019, 2020, 2022, 2024 Junian, CuriousTorvald and Krepe.Z
@curioustorvald
curioustorvald / korean_ime_for_opensuse.md
Last active November 9, 2022 09:28
openSUSE Tumbleweed/Leap을 위한 두벌식 및 세벌식 한글 입력 설정

openSUSE Tumbleweed/Leap을 위한 두벌식 및 세벌식 한글 입력 설정

  1. openSUSE를 영어로 설치, 레이아웃은 일단은 무조건 Qwerty
  2. 빌드에 필요한 패키지들을 설치
    sudo zypper in cmake gtk2-devel gtk3-devel gtk4-devel fcitx fcitx-devel libqt5-qtbase-devel pkg-config libtool intltool
    
  3. 코드를 가져오기. (새로 설치한 시스템에는 git이 없기 때문에 sudo zypper in git git-lfs를 먼저 실행해주자)

git clone https://gitlab.com/3beol/libhangul.git

# usage: python3 cull.py HUE
# where HUE is a number
#
# Get datasets faster using multiple threads, like:
# seq 360 | xargs --max-procs=8 -n 1 python cull.py
# Copyright © 2022 CuriousTorvald
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
python 녹화스크립트.py -u 스트리머_아이디
rem 녹화스크립트.py에는 녹화스크립트 파일의 완전한 경로(C:\Users로 시작하는 거)를 입력해주세요
rem 스트리머_아이디에는 녹화하고자 하는 스트리머의 트위치 아이디를 입력해주세요
rem 밑에 있는 줄은 오류가 생겼을 때 창이 꺼지지 않게 하기 위한 것으로 지우지 말아주세요!
pause >nul