Skip to content

Instantly share code, notes, and snippets.

View kode54's full-sized avatar

Christopher Snowhill kode54

View GitHub Profile
@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
{
@kode54
kode54 / PKGBUILD
Created June 20, 2014 01:04
Arch Linux PKGBUILD for multivnc-git
# Contributor: Max Devaine <maxdevaine@gmail.com>
# Contributor: Christopher Snowhill <chris@kode54.net>
pkgname=multivnc-git
pkgver=1.6.4.r3.g8a1bdfe
pkgrel=1
pkgname='multivnc'
pkgdesc='MultiVNC is a cross-platform Multicast-enabled VNC viewer using wxWidgets and libvncclient'
arch=(i686 x86_64)
url='http://github.com/bk138/multivnc'
@kode54
kode54 / stderr.txt
Created June 20, 2014 01:06
Crash log from multivnc on Arch Linux
05:56:37 PM: Debug:
05:56:37 PM: Debug: wxServDisc 0x195e980: about to query '_rfb._tcp.local.'
/usr/include/wx-3.0/wx/strvararg.h(451): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type [in thread 7fc3811bc700]
Call stack:
[00] wxOnAssert(char const*, int, char const*, char const*, char const*)
[01] wxAnyButton::~wxAnyButton()
[02] wxThreadHelperThread::Entry()
[03] wxThread::CallEntry()
@kode54
kode54 / XGtoGS.txt
Created June 21, 2014 08:07
Partial map of XG instruments to their corresponding GS/TG300B presets
XG MSB/LSB/P: GS MSB/P
0/1/0: 8/0
64/0/0: 1/120
0/1/1: 8/1
64/0/1: 3/120
0/1/2: 8/2
0/40/2: 1/2
0/41/2: 2/2
64/0/2: 4/120
@kode54
kode54 / MAKEPKG
Created July 8, 2014 23:41
Updated Arch Linux PKGBUILD for multivnc-git
# Contributor: Max Devaine <maxdevaine@gmail.com>
# Contributor: Christopher Snowhill <chris@kode54.net>
pkgbase=multivnc-git
pkgname=$pkgbase
pkgver=1.6.4.r4.g18c96f6
pkgrel=1
pkgname='multivnc'
pkgdesc='MultiVNC is a cross-platform Multicast-enabled VNC viewer using wxWidgets and libvncclient'
arch=(i686 x86_64)
@kode54
kode54 / gen_adldata.cc
Last active August 29, 2015 14:05
Excerpt from Adlmidi for extracting instruments from ESS FM driver. Not a pretty sight, and they don't really work anyway.
// LoadESFM("drivers/es1969.sys", 35904, 64, "esfm");
static void LoadESFM(const char* fn, size_t file_offset, unsigned bank, const char* prefix)
{
FILE* fp = std::fopen(fn, "rb");
std::fseek(fp, file_offset, SEEK_SET);
std::vector<unsigned char> data(28 * 256);
std::fread(&data[0], 1, data.size(), fp);
std::fclose(fp);
@kode54
kode54 / iir_filter.c
Created October 4, 2014 04:34
IIR resonant low pass filter
#include <stdlib.h>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif