Skip to content

Instantly share code, notes, and snippets.

@Eiyeron
Eiyeron / LLT.bytebeat
Last active December 24, 2015 23:39
Long Line Theory, made readable for humans. Original : http://www.pouet.net/topic.php?which=8357&page=13 Render (original, but the result is the same) : http://bit.ly/ny4Ds3
intro= ((sb=t>0xffff)&0),
background=
(((y=Math.pow(2,[15,15,23,8][t>>14&3]/12))&0)
+(
((y*t*0.241)&127-64)
+((y*t*0.25)&127-64)
)*1.2),
drum=
(
@Eiyeron
Eiyeron / LLT.c
Last active March 6, 2024 19:55
Long Line Theory, finally in C. Enjoy one the best bytebeat directly from your terminal without Javascript!
#include <stdio.h>
#include <math.h>
#define min(a, b) (a) < (b) ? (a) : (b)
#define max(a, b) (a) > (b) ? (a) : (b)
int main(int t, char** argc) {
double sb, y, h, a, d, g;
@Eiyeron
Eiyeron / M7.c
Last active September 17, 2018 12:43
Mode 7
/*****************************************************************/
/* */
/* CASIO fx-9860G SDK Library */
/* */
/* File name : [ProjectName].c */
/* */
/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */
/* */
/*****************************************************************/
#include "fxlib.h"
@Eiyeron
Eiyeron / Rotscale.lua
Created April 22, 2015 20:12
Rotoscale
-- rotoscale!
-- by eiyeron
-- 07/04/2015
-- a good old demo effect! :3
-- retroactive.me/retro-actif
-- thanks zep for everything!:)
-- for pico-8, the code and
-- voxatron!
-- iirc local vars are faster
local t, angle, scale = 0, 0, 1
@Eiyeron
Eiyeron / PaletteCreator.hx
Created October 12, 2016 17:56
Palette class creation utility macro
package colors;
import haxe.macro.Context;
import haxe.macro.Expr;
using haxe.macro.ExprTools;
/**
* Macro building a palette class from a given string list and a prefix.
* Creates static fields in the class named like "prefix_XXX" where XXX is the index
* of the color with leading zeros. Also creates an array containing every color.
@Eiyeron
Eiyeron / Class.hx
Last active December 7, 2016 11:23
class LanguageSelectionState extends FlxFSMState<BattleEngine> {
var localeButtons:Array<FlxButton>;
var localeFlags:Array<FlxSprite>;
var locales:Array<String>;
var background:FlxSprite;
var okButton:FlxButton;
public function new()
{
super();
@Eiyeron
Eiyeron / reflect.glsl
Created October 1, 2017 14:20
Love2D shader for realtime palette swap + EB-like sine-based distorsions
#define PALETTE_SIZE 4
uniform float time = 0;
// Good old wave effect
uniform vec2 amplitude = vec2(0 / 128., 8/128.);
uniform vec2 speed = vec2(1., 2.);
uniform vec2 frequency = vec2(1, 3);
uniform float sampling_factor = 0.5;
uniform vec3 palette[PALETTE_SIZE+1];
uniform bool inverse = false;
@Eiyeron
Eiyeron / gist:aefcf491a2549ad309cffbd9543805f9
Created October 17, 2017 21:05
2017/10/17 - Module Playlist
https://modarchive.org/module.php?117240 - Nice ambiance
https://modarchive.org/module.php?1433 - TAAAAKE OOOOON MEEEEEE
https://modarchive.org/module.php?158865
https://modarchive.org/module.php?72054 - I like how it sounds
https://modarchive.org/module.php?34032 - Suggested by DJ PIE, I REGRET NOTHING
https://modarchive.org/module.php?85382
https://modarchive.org/module.php?158294
https://modarchive.org/module.php?55638
https://modarchive.org/module.php?72635 - I think I enjoy all those drum loop samples.
https://modarchive.org/module.php?93118
@Eiyeron
Eiyeron / CustomSound.hx
Last active February 10, 2019 17:03
Haxe/Heaps custom Sound/Data class pair to generate sound on the fly. Beware, it's experimental and prone to crash if you tweak the wrong knobs.
import hxd.snd.Data;
import hxd.res.Sound;
// This class should work like a Sound. Jsut create one and call play and a lo-fi generated tune should ring.
// You can check out a bit more about bytebeat there : http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
class CustomSound extends Sound {
public function new() {
super(null);
data = new SoundDataGenerator();
}
@Eiyeron
Eiyeron / eb_shader.glsl
Last active November 10, 2021 13:25
Earthbound-ish background shader
/*
Copyright © 2019, Florian Dormont
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the