Skip to content

Instantly share code, notes, and snippets.

View faroit's full-sized avatar
🚀
Rocket Science

Fabian-Robert Stöter faroit

🚀
Rocket Science
View GitHub Profile
@faroit
faroit / YinFFT_stationary_signal_test.py
Last active August 29, 2015 14:16
Testing YIN in on constant pitch signals
from __future__ import division
import numpy as np
import essentia.standard
import matplotlib.pyplot as plt
def sinewave(f0, nseconds, samplerate=44100):
t = np.arange(1, samplerate * nseconds)
sig = np.zeros_like(t)
return sig + 0.5 * np.sin(2 * np.pi * f0 * t / samplerate)
@faroit
faroit / get_commit_sha.py
Created March 19, 2015 23:13
Get current commit sha
from git import Repo # requires gitpython
repo_dir = os.path.abspath(os.path.dirname(__file__))
commit = Repo(repo_dir).head.commit.hexsha[:8]
# -*- coding: utf-8 -*-
"""
Bandlimited versions of scipy.signal.waveforms.
Intent is mathematical perfection over performance;
these use additive synthesis, so they are slow, but exact.
Less ideal methods using BLIT:
Sawtooth can be made by integrating BLIT minus a DC value to prevent integrator wandering off
Square can be made by integrating bipolar BLIT
# $ brew install https://raw.github.com/gist/1121425/rubberband.rb
require 'formula'
class Rubberband < Formula
homepage ''
url 'http://code.breakfastquay.com/attachments/download/35/rubberband-1.8.1-gpl-executable-osx-universal.tar.bz2'
version '1.8.1'
sha1 'bceba7dba8cdd773a318ca973ed9c5806be03262'
@faroit
faroit / pydsd.py
Last active December 5, 2015 15:20
Example code how to use pyDSD
import pydsd
def my_function(dsd_track):
# do your fancy bss algorithm
# use the tracks mixture audio as numpy array
dsd_track.audio
# get the path for external processing
dsd_track.path
@faroit
faroit / setup_sisec.yaml
Created December 5, 2015 14:56
setup file for DSD100
# Define the Input sources for each track
sources:
vocals: vocals.wav
drums: drums.wav
bass: bass.wav
other: other.wav
# Additionally provide the artistic mix
mix:
mixture.wav

PYTHON

import numpy as np
import timeit

P = np.random.random((20, 15, 100, 30, 2))

A = np.random.random((20, 15, 100, 5))
H = np.random.random((30, 5))
C = np.random.random((2, 5))
USER=your_github_username
# Create a token via commandline
# curl -u "$USER" -d '{"scopes":["repo"],"note":"migrate.sh"}' https://api.github.com/authorizations
TOKEN=yourtoken
REPONAME=${PWD##*/}
# Create repository and return the git url
URL=$( curl -v -XPOST -H "Authorization: token $TOKEN" https://api.github.com/user/repos \
@faroit
faroit / gruln.py
Created July 23, 2016 15:28 — forked from udibr/gruln.py
Keras GRU with Layer Normalization
from keras.layers import GRU, initializations, K
from collections import OrderedDict
class GRULN(GRU):
'''Gated Recurrent Unit with Layer Normalization
Current impelemtation only works with consume_less = 'gpu' which is already
set.
# Arguments
output_dim: dimension of the internal projections and the final output.

Keybase proof

I hereby claim:

  • I am faroit on github.
  • I am faroit (https://keybase.io/faroit) on keybase.
  • I have a public key whose fingerprint is 1A86 8B44 A8FF C682 94D9 F729 DB01 E2B2 0DB1 9CC3

To claim this, I am signing this object: