Skip to content

Instantly share code, notes, and snippets.

@bwhitman
bwhitman / portaudio_mac_nonpow2.diff
Created February 28, 2015 20:38
Fix for non-power-of-2 output channels on mac
Index: src/hostapi/coreaudio/pa_mac_core_blocking.c
===================================================================
--- src/hostapi/coreaudio/pa_mac_core_blocking.c (revision 1948)
+++ src/hostapi/coreaudio/pa_mac_core_blocking.c (working copy)
@@ -186,7 +186,7 @@
err = PaUtil_InitializeRingBuffer(
&blio->outputRingBuffer,
- 1, ringBufferSize*blio->outputSampleSizePow2*outChan,
+ outChan*blio->outputSampleSizePow2, ringBufferSize,
@bwhitman
bwhitman / write_sine.c
Created February 28, 2015 17:05
test multi channel in portaudio OS X
/** @file paex_write_sine.c
@ingroup examples_src
@brief Play a sine wave for several seconds using the blocking API (Pa_WriteStream())
@author Ross Bencina <rossb@audiomulch.com>
@author Phil Burk <philburk@softsynth.com>
*/
/*
* $Id: paex_write_sine.c 1865 2012-09-01 21:16:25Z philburk $
*
* This program uses the PortAudio Portable Audio Library.
@bwhitman
bwhitman / msd.txt
Created January 2, 2015 01:33
Attachment instructions for the MSD
The toughest part was getting access to an EC2 instance. I followed
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html#access-ec2
To set up the aws command line interface, I followed
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
-> http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html
-> http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os
(for my MacBook)
-> http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
I don't recall how I set up the public/private key pair, but it wasn't
@bwhitman
bwhitman / gist:0edba48fdf6839c43aa3
Created May 10, 2014 13:23
From "Jaws" by Donald Barthelme

"Go home," I say. "Praise the lamb."

"How do I know it won't be the spinal cord next?"

"Hard to get to. Probably couldn't even dent it."

"I feel like I'm married to some kind of animal."

"Our animal nature is part of us and we are part of it."

@bwhitman
bwhitman / chord.py
Created May 1, 2014 14:56
Chord class for synthesizing
#!/usr/bin/env python
# encoding: utf-8
"""
chord.py
Brian Whitman
brian@echonest.com
"""
@bwhitman
bwhitman / salami.py
Created May 1, 2014 14:56
SALAMI chord parser
#!/usr/bin/env python
# encoding: utf-8
"""
salami.py
Brian Whitman
brian@echonest.com
"""
@bwhitman
bwhitman / gist:8676124
Created January 28, 2014 20:50
salami file
# title: Love Comes Quickly
# artist: Pet Shop Boys
# metre: 4/4
# tonic: B
0.0 silence
0.743038548 A, intro, | B:5 | B:5 | B:5(b7) | B:5 |, (synthesizer
11.193129251 B, instrumental, | G:maj/3 | G:maj/3 | F#:min/b3 | B:min |
20.140702947 | G:maj/3 | G:maj/3 | F#:min/b3 | B:min |
29.032562358 | G:maj/3 | G:maj/3 | F#:min/b3 | B:min |
@bwhitman
bwhitman / gist:8300812
Created January 7, 2014 15:17
@kurtjx leaves me a present
# hahaha good luck reading this you fucker.
for catype, catfunc, class_labels in (('f', lambda x:_f_demos(x["f"]) , [x for x in features.F_RANGES]), ('sub', lambda x:1 if x['class']=='sub_a' else 0, ('sub_a', 'sub_b'))):
#!/usr/bin/env python
# encoding: utf-8
"""
salami.py
"""
import sys
import re
import os
@bwhitman
bwhitman / words.txt
Created October 16, 2013 20:13
Words of Advice for Young People by William Burroughs
People often ask me if I have any words of advice for young people.
Well here are a few simple admonitions for young and old.
Never intefere in a boy-and-girl fight.
Beware of whores who say they don't want money.
The hell they don't.
What they mean is they want more money. Much more.
If you're doing business with a religious son-of-a-bitch,
Get it in writing.
His word isn't worth shit.
Not with the good lord telling him how to fuck you on the deal.