Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
@kode54
kode54 / usf_coverage.txt
Created February 18, 2014 05:34
PGO coverage of foo_input_usf
Microsoft (R) Profile Guided Optimization Manager 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
PGD File: foo_input_usf.pgd 02/16/2014 17:50:10
Module Count: 1 Function Count: 3021 Arc Count: 3280 Value Count: 191
Static instructions: 39839 Basic blocks: 9220 Average BB size: 4.3
Dynamic instructions: 1295151200270
entry static dynamic % run
int GetFrequenceValue(int input)
{
if ( !input ) return 0;
if ( LinearFrqTab != 1 )
{
return input / FrequenceDivFactor;
}
else
{
@kode54
kode54 / play.c
Created February 28, 2014 02:21
Attempt to feed Pcsx Reloaded save states into Highly Experimental, for probing purposes.
#include <stdint.h>
#define EMU_COMPILE
#define EMU_LITTLE_ENDIAN
#include "PsxCore/Core/psx.h"
#include "PsxCore/Core/bios.h"
#include "PsxCore/Core/iop.h"
#include "PsxCore/Core/r3000.h"
#define _USE_MATH_DEFINES
#include "iirfilters.h"
#include <math.h>
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
IIRFilter::IIRFilter()
#!/bin/sh
FUCKING_THING_TO_SIGN=$1
FUCKING_SIGNED=0
while [ $FUCKING_SIGNED -eq 0 ]; do
codesign -s 'Developer ID Application' --deep --force "$FUCKING_THING_TO_SIGN"
spctl -a "$FUCKING_THING_TO_SIGN" && FUCKING_SIGNED=1
done
@kode54
kode54 / git_filter_dir.bat
Created April 5, 2014 03:59
These scripts can be used to prune a Git repository down to just the contents of the specified subdirectory, and prunes the change history to only the files contained within.
@echo off
setlocal enableextensions enabledelayedexpansion
set dir=%1
set dir=!dir:\=/!
git remote rm origin
git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter "%dir%" HEAD
git reset --hard
@kode54
kode54 / resampler_insert.c
Created April 17, 2014 06:02
Add-on for my resampler.c, which adds a sinc coefficient set generator, producing the minimum number of phases against the pre-generated sinc table, for either upsampling or downsampling.
short * resampler_generate_phase_set(double ratio, int * count)
{
int phase_inc;
int j;
int phase;
short * phases, * phase_ptr;
int step, window_step;
// determine number of sub-phases that yield lowest error
const int max_res = RESAMPLER_RESOLUTION;
@kode54
kode54 / smooth_app.au3
Created May 28, 2014 03:58
Simple script to force Logitech's now unsupported Flow Scroll background app to always enable unsmoothed 4x scroll wheel precision on mice such as the G9x.
#include <WinAPI.au3>
#include <SendMessage.au3>
While 1
Sleep( 50 );
Local $hWnd
$hWnd = _WinAPI_FindWindow( "LogiSmoothScrlBckGrndWnd", "LogiSmoothScrlBckGrndWnd" )
If $hWnd Then
_SendMessage( $hWnd, 0x757, 1, 1 );
EndIf
../AnotherXG 2.1.sf2pack
../SGM-V2.01.sf2pack
000 Classical Piano.sf2pack
001 Bright Piano.sf2pack
002 Electric Grand.sf2pack
003 Honky-Tonk.sf2pack
004 Electric Piano 1.sf2pack
005 Electric Piano 2.sf2pack
006 Harpsichord.sf2pack
007 Clavinet.sf2pack
@kode54
kode54 / gist:ded4e0f4629d68f62cc9
Created June 19, 2014 02:27
MIDI System Exclusive message interpreter from TMIDI - Tom's MIDI Player
// Interprets a sysex string
char *interpret_sysex(unsigned char *s, int len)
{
static char buf[256], timbreName[16];
int i, j;
buf[0] = '\0';
switch (s[0]) // Manufacturer ID
{