Skip to content

Instantly share code, notes, and snippets.

@cshaa
cshaa / LambertW.bas
Created April 25, 2019 20:05
Lambert W function, or the product logarithm, for LibreOffice and OpenOffice. Original version for Excel from here: http://www.vbforums.com/showthread.php?683003-Lambert-W-function-for-Excel-work-on-real-and-complex-number
Attribute VB_Name = "Module1"
Function Complex(a As Double, b As Double) As Any
Dim svc As Object
svc = createUnoService("com.sun.star.sheet.FunctionAccess")
Complex = svc.callFunction("COMPLEX",Array(a,b))
End Function
Function ImProduct(a As Any, b As Any) As Any
Dim svc As Object
@serdmanczyk
serdmanczyk / Keyboard.py
Created May 21, 2015 05:18
Keyboard w/ PyAudio and TKinter
#!/usr/bin/python
# coding=utf-8
import numpy
import random
import math
import copy
import pyaudio
from Tkinter import *
@lfnoise
lfnoise / viable-heptatonic-scales
Created August 12, 2014 14:39
viable heptatonic scales
This is a chart of all 7 note pitch sets which have at least one mode which is a viable heptatonic scale.
A viable heptatonic scale is one where:
there are 7 distinct pitches.
the first degree is 0 semitones.
the second degree is 1, 2 or 3 semitones.
the third degree is 3 or 4 semitones.
the fourth degree is 5 or 6 semitones.
@esamattis
esamattis / unblockdns.md
Last active May 5, 2022 17:45
Transparent Netflix only region unblock with Asuswrt Merlin

Transparent Netflix only region unblock with Asuswrt Merlin

Ad-free time!, UnoTelly etc. services provide a nice way to unblock regions for Netflix and others using their custom DNS servers.

But I don't want to direct all my DNS traffic to them and I'm too lazy to manually configure all my devices (phones, tablets, media center boxes etc.). So here's how to transparently unblock Netflix for all your devices using the [Asuswrt Merlin][merlin] firmware. It's a custom router firmware which can be used on the Asus RT-N66U router for example.

Prerequisites

Enable JFFS partition and SSH login from http://<ROUTER-IP>/Advanced_System_Content.asp

@tyspa1
tyspa1 / stt
Created February 22, 2014 21:00
Use Google Speech API with Python using Pyaudio and flac for Windows
import pyaudio
import wave
import audioop
from collections import deque
import os
import urllib2
import urllib
import time
import math
@jacobstern
jacobstern / gen_pcs_script.py
Created February 12, 2013 02:20
Utility to name Forte's pitch class sets. Generate a portable script from a TSV file of PCS data using Python's metaprogramming capabilities. Sample output of gen_pcs_script.py included. Sample usage: python gen_pcs_script.py pitch_classes.tsv; python pitch_class_set.py A C# B
#! /usr/bin/python
import csv
import inspect
__pcs_export = set()
def pcs_function(f):
__pcs_export.add(f)
@endolith
endolith / readme.md
Last active August 13, 2024 11:27
Sethares dissmeasure function in Python

Adaptation of Sethares' dissonance measurement function to Python

Example is meant to match the curve in Figure 3:

Figure 3

Original model used products of the two amplitudes a1⋅a2, but this was changed to minimum of the two amplitudes min(a1, a2), as explained in G: Analysis of the Time Domain Model appendix of Tuning, Timbre, Spectrum, Scale.

This weighting is incorporated into the dissonance model (E.2) by assuming that the roughness is proportional to the loudness of the beating. ... Thus, the amplitude of the beating is given by the minimum of the two amplitudes.