Skip to content

Instantly share code, notes, and snippets.

import sys
from collections import defaultdict
import lilv
# FIXME: not sure if this is correct...
using_old_lilv = "lilv_nodes_begin" in dir(lilv)
show_details = '-d' in sys.argv or '--details' in sys.argv
from collections import defaultdict
import lilv
if __name__ == '__main__':
w = lilv.World()
w.load_all()
lv2_AudioPort = w.new_uri(lilv.LILV_URI_AUDIO_PORT)
lv2_InputPort = w.new_uri(lilv.LILV_URI_INPUT_PORT)
<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project version="1.0" creator="LMMS" creatorversion="1.0.0" type="song">
<head timesig_numerator="4" mastervol="100" timesig_denominator="4" bpm="140" masterpitch="0"/>
<song>
<trackcontainer width="600" x="5" y="5" maximized="0" height="300" visible="1" type="song" minimized="0">
<track muted="0" type="0" name="TripleOscillator" solo="0">
<instrumenttrack pan="0" fxch="0" usemasterpitch="1" pitchrange="1" pitch="0" basenote="57" vol="100">
<instrument name="tripleoscillator">
<tripleoscillator phoffset2="0" userwavefile0="" finer0="0" userwavefile1="" finer1="0" userwavefile2="" finer2="0" coarse0="0" coarse1="-12" coarse2="-24" finel0="0" finel1="0" modalgo1="2" modalgo2="2" finel2="0" pan0="0" modalgo3="2" pan1="0" stphdetun0="0" pan2="0" stphdetun1="0" wavetype0="0" stphdetun2="0" wavetype1="0" wavetype2="0" vol0="33" vol1="33" phoffset0="0" phoffset1="0" vol2="33"/>
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import generator
>>> g = generator.Generator('adjectives', 'nouns_filtered')
>>> next(g)
'haisevampi ruusupuu'
>>> next(g)
'lihava spriidari'
>>> next(g)
http://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html#t=0&e=0&s=8000&bb=5d000001002fe200000000000000360f4763116b8f5e714c506b30e6c202ecf7d7bb081758b9ac42ec927f9da9233fb5d8118eafa0294aaa2d058564ad3186ef618f0ad175c6c759af487df10c666224d8fa4895ef4a9f627c1793db3898afbf4d4246b3096fe1d616dc33c315fb39fdecbd5723dc0de7573834b66585e011a8b3f6518e47c422976ae7a0747ac6823967da37021557ca7b301c818a4dd54309feb0e338119eb136df3ef8f50e4e625f0b7897eb62eecafe94c516f33aa3100dde891465a4feab9af3486d7889655c71f068bcdffdcfa321d8455108f8bf5f8a61f55494432f1a6135163fdeb3a4761265308b289ba5080af2d3b10ccd435b2d5e1207a0daff5edc3857b3bf7680091c673fc187fc0e51ab006d3c7db1dd84facc9f3e675e49f5c09d0984846d0653c4df44581bb807e71864087e23a6a608099f1285f9ebd0dc9f281c22104822c08314895a820d8e73c600f501153d4b894e4e2200acf231cbf57e0e2715ab02bf791d00b172a3d4248568188475217b7f6a5a090c390b3d76f8828d1cc3300843e2edb5462eca7d3e899a68fe48248d444af38faaedd03d21bc30eaf4d0ba5cc9626062b798234354f458aedbc4f3b0bcf8c5b7f2dbcd962a9c69d56dd0dea3b1c4978167
def match(command):
return ('pulseaudio' in command.stderr
and 'jackd' in command.script)
def get_new_command(command):
return 'pasuspender -- {}'.format(command.script)
enabled_by_default = True
requires_output = True
require_confirmation = False
@grejppi
grejppi / bw.py
Created January 9, 2016 05:18
launching bitwig studio when using wayland
#!/usr/bin/env python3.5
import os
import subprocess
import sys
import time
DISPLAY = ':3'
xephyr = subprocess.Popen(['Xephyr', DISPLAY, '-fullscreen'])
using WAV
name = ARGS[1]
outname = ARGS[2]
input, rate = wavread(name)
input = sum(input, 2)
spectrum = fft(input)
rmax = maximum(abs(real(spectrum)))
@grejppi
grejppi / invertspectrum.jl
Created August 28, 2015 14:51
swap high frequencies with lows and vice versa
using WAV
name = ARGS[1]
y, rate = wavread(name)
spectrum = fft(y)
quarter = int(length(spectrum) / 4)
<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project version="1.0" creator="LMMS" creatorversion="1.1.3" type="instrumenttracksettings">
<head/>
<instrumenttracksettings muted="0" type="0" name="TripleOscillator" solo="0">
<instrumenttrack pan="0" fxch="0" usemasterpitch="1" pitchrange="1" pitch="0" basenote="57" vol="30.4">
<instrument name="tripleoscillator">
<tripleoscillator phoffset2="0" userwavefile0="" finer0="0" userwavefile1="" finer1="0" userwavefile2="" finer2="0" coarse0="0" coarse1="-12" coarse2="-24" finel0="0" finel1="0" modalgo1="2" modalgo2="2" finel2="0" pan0="0" modalgo3="2" pan1="0" stphdetun0="0" pan2="0" stphdetun1="0" wavetype0="2" stphdetun2="0" wavetype1="0" wavetype2="0" vol0="33" vol1="0" phoffset0="0" phoffset1="0" vol2="0"/>
</instrument>
<eldata fres="0.5" ftype="1" fcut="406" fwet="1">