Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include
and lib
directories of your portaudio install:
[build_ext]
Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include
and lib
directories of your portaudio install:
[build_ext]
--[[ | |
Feature Ideas | |
- different cycle lengths per instrument | |
- Setting: "Crank to play", "very slow", "slow", "medium", "fast" | |
- Setting: set key, scale | |
- Key: C, C#, etc | |
- Scale: Major, Minor, Dorian | |
- change instrument for each track | |
- 3 drum samples, plus pentatonic scale | |
- randomize notes |
from pydub import AudioSegment | |
from pydub.utils import db_to_float | |
# note: see usage example at the bottom of the gist :) | |
class Mixer(object): | |
def __init__(self): | |
self.parts = [] | |
def overlay(self, sound, position=0): |
So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?
But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?
Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.
-- converts CSS-style hex colors to love2d 0 - 1 scaled colors | |
-- e.g., hexcolor("ccff99") == {0.8, 1.0, 0.6} | |
-- supports alpha, e.g., hexcolor("ccff9966") == {0.8, 1.0, 0.6, 0.4} | |
-- supports shorthand, e.g., hexcolor("cf96") == hexcolor("ccff9966") | |
-- automatically strips common prefixes, e.g., hexcolor("#cf9"), hexcolor("0xcf9") | |
local function hexcolor(c) | |
-- strip leading "#" or "0x" if necessary | |
if c:sub(1, 1) == "#" then | |
c = c:sub(2) | |
elseif c:sub(1,2) == "0x" then |
version: '2.2' | |
services: | |
es01: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.1 | |
container_name: es01 | |
environment: | |
- node.name=es01 | |
- cluster.name=es-docker-cluster | |
- discovery.type=single-node | |
- bootstrap.memory_lock=true |
#!/usr/bin/env python | |
""" | |
I really *REALLY* wanted to see Radiohead at Roseland ballroom, but so | |
did everybody else and the tickets sold out in about 10 minutes. I didn't | |
get one :( | |
They haven't played in NYC in 3 years! | |
Here is a script that checks when tickets become available for an event. | |
NEVER AGAIN! |
Basically, this takes a MIDI input file (I just googled and grabbed one of Maroon 5's "Animal" – I know, I know) and generates a WAV file.
NOTE: This is the slowest midi rendering program I have ever seen!
Dependencies:
-- Setup | |
drop table bloattable; | |
create table bloattable ( | |
a int primary key, | |
b int not null, | |
x uuid not null, | |
y uuid not null | |
); |
// How to use: | |
// 1. Open "Script Editor" (requires OS X 10.10 Yosemite) | |
// 2. Change the language from "AppleScript" to "JavaScript" | |
// 3. Paste the code below and replace the safari example. | |
// | |
// More info: | |
// https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html | |
var sys_events = Application("System Events"); |