Skip to content

Instantly share code, notes, and snippets.

View nikreiman's full-sized avatar

Nik Reiman nikreiman

  • Stockholm, Sweden
View GitHub Profile
@nikreiman
nikreiman / sse-bufconvert.c
Created December 12, 2013 09:17
Converting 16-bit shorts to floating point samples with SSE
#include <stdlib.h>
#include <malloc.h>
#include <xmmintrin.h>
#if 1
#define ITERATIONS 1
#define BUFSIZE 32
#else
#define ITERATIONS 1000000
#define BUFSIZE 512
@nikreiman
nikreiman / gist:5721141
Created June 6, 2013 12:28
List of functions which *cannot* be MIDI mapped in Ableton Live
Track delay
I/O routing
Show/hide any panel
Show/hide I/O, sends, returns, etc.
Time signature
EQ-8 mode, channel config
Navigation in the browser
Computer MIDI keyboard
Cue/solo (the button above the Cue volume)
Enable/disable clips
@nikreiman
nikreiman / sp
Last active October 26, 2015 23:44 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@nikreiman
nikreiman / gist:4216723
Created December 5, 2012 15:46
Music Hack Day Stockholm 2013 Idea

My idea for MHD is twofold; first, I would like to take MrsWatson (https://github.com/teragonaudio/MrsWatson), a command-line VST host, and create a dynamic library version from it. Architecturally, I have already been working towards this goal and don't anticipate this part to be terribly difficult. However, I would like to clean up the calling API a bit to make it a bit easier to use.

Then, the big kicker: write a wrappers for MrsWatson so that the dynamic library version could be easily called from other languages. Initially, I feel that Java, Python, and Ruby would be good candidate languages for this. Ruby and Python especially lack good VST support, and this project would be a big step in allowing people to write sequencers or audio services in these languages.

The motivation for this project is to allow other applications to easily process audio (either realtime or offline) with VST plugins. This would also make writing automated audio servers or sequencers significantly easier.

I have limited exper

@nikreiman
nikreiman / gist:2634396
Created May 8, 2012 11:38
Remove finder's dock icon
-- Remove Finder's Icon in the Mac OSX Dock
-- This is useful if you want to keep Finder running alongside Path Finder,
-- but don't want to see it's icon in the Dock or in the list of running
-- applications.
--
-- Taken from Jampe's post on the Cocoatech forums:
-- http://forum.cocoatech.com/archive/index.php/t-1803.html
-- If the dock is hidden, sometimes this doesn't really work
-- So show the dock before removing, and autohide it again afterwards
@nikreiman
nikreiman / gist:1663685
Created January 23, 2012 15:20
Memes galore
#!/bin/bash
memes=( ohyeah.jpg orly.jpg seal.jpg snoopdog.gif testing.jpg haters.gif doh.jpg stop.jpg youcandoit.jpg woohoo.jpg boom.gif tumbleweeds.gif kangaroo.gif jumpcat.gif )
function copyMeme() {
inMeme="$1"
for meme in "${memes[@]}" ; do
printf -v memeName "%s" "$(printf "%s" "$meme" | cut -d '.' -f 1)"
if [ "$memeName" = "$inMeme" ] ; then
printf "http://static.nikreiman.com/meme_${meme}" | pbcopy
@nikreiman
nikreiman / incoming.sh
Created January 20, 2012 10:00
My git merging flow: fetch, incoming, review, merge
# Show incoming commits on the current branch that have yet to be merged.
# This function should be run directly after fetching.
function incoming() {
local branch=$1
if [ -z "$branch" ] ; then
branch=$(git-branch-current)
fi
git --no-pager log origin/$branch ^$branch
}
@nikreiman
nikreiman / gist:1485468
Created December 16, 2011 10:13
Hairy-ish code for getting unique ID from Android device
public String getUniqueId(final Context context) {
String uniqueId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
// Ugh, Motorola's Droid 2.2 devices return this ID, which they copied directly from the Android emulator. If
// we see that device ID, we should instead use the telephony manager's ID instead.
if(uniqueId == null || uniqueId.equals("9774d56d682e549c")) {
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
uniqueId = telephonyManager.getDeviceId();
}
if(uniqueId == null) {
ErrorController.logErrorRemotely("No unique ID found for device!", null);
@nikreiman
nikreiman / gist:1408400
Created November 30, 2011 08:07
Yahoo weather codes
0 tornado
1 tropical storm
2 hurricane
3 severe thunderstorms
4 thunderstorms
5 mixed rain and snow
6 mixed rain and sleet
7 mixed snow and sleet
8 freezing drizzle
9 drizzle
@nikreiman
nikreiman / cowfort.glet
Created November 30, 2011 08:06
GeekTool cowsay fortune geeklet
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Command</key>
<string>$HOME/Dropbox/Nik/Scripts/cowfort</string>
<key>DropShadow</key>
<true/>
<key>FailureImage</key>
<data>