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 / 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 / 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 / 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 / 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();
}
-- accumulative random
-- allows for progressively
-- variating value instead
-- of pure random
function vrnd()
local start = 50
return function()
start = start + rnd(1)* (flr(rnd(2)) == 1 and 1 or -1)
start = mid(40,start,100)
return start
#version 150
// Using Kodelife for the realtime preview/test environment but it should work fine on any shader that
// - offers the output's resolution
// - a time clock in seconds
// - an UV mapped on screenspace from [0,0] to [1,1]
uniform float time;
uniform vec2 resolution;
@Eiyeron
Eiyeron / ffmpeg_rencode_gpu.bat
Created May 6, 2020 07:47
Batch file to reencode video files in an hopefully Twitter-compatible way
@echo off
set /p quality="Quality: "
ffmpeg -hwaccel nvdec -c:v h264_cuvid -i %1 -c:v h264_nvenc -rc:v vbr_hq -cq:v %quality% -b:v 2500k -maxrate:v 5000k -profile:v high -pix_fmt yuv420p out.mp4
REM Here's the version without GPU-accelerated encoding
REM ffmpeg -i %1 -crf %quality% -b:v 2500k -maxrate:v 5000k -pix_fmt yuv420p out.mp4