Skip to content

Instantly share code, notes, and snippets.

@ohac
ohac / nanopad2.py
Last active September 2, 2017 13:51
mididings patch for KORG nanoPAD2
#!/usr/bin/mididings -f
from mididings import *
config(
out_ports = ['GM1', 'GM2'],
)
def kf(sd, drumkit):
s, d = sd
d2 = drumkit[d]
UA-25EX
JACK
Buffer Size: 512
Periods/Buffer: 2
Input Latency: 0 frames
Output Latency: 0 frames
2396.074 frames 54.333 ms total roundtrip latency
extra loopback latency: 860 frames
@ohac
ohac / nanopad2.py
Created August 21, 2017 13:57
mididings file for KORG nanoPAD2
from mididings import *
config(
out_ports = ['sampler'],
)
drums = Velocity(curve=-2.5) >> [
KeyFilter(notes=[36]) >> Key(36), KeyFilter(notes=[37]) >> Key(37),
KeyFilter(notes=[38]) >> Key(38), KeyFilter(notes=[39]) >> Key(39),
KeyFilter(notes=[40]) >> Key(40), KeyFilter(notes=[41]) >> Key(41),
@ohac
ohac / diff1.diff
Last active July 11, 2017 15:34
Electrum-Mona for Windows build memo (Dockerfile is here: https://twitter.com/cryptcoinjunkey/status/884251303811047425 )
diff --git a/electrum b/electrum
index b9ab196..2661de0 100755
--- a/electrum
+++ b/electrum
@@ -83,7 +83,7 @@ def check_imports():
except Exception:
sys.exit("cannot import ecdsa.curve_secp256k1. You probably need to u
# make sure that certificates are here
- assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
+ #assert os.path.exists(requests.utils.DEFAULT_CA_BUNDLE_PATH)
onlynet=tor
proxy=127.0.0.1:9050
externalip=ojszvqyjucfuyj7p.onion
listen=1
#addnode=mainnet.z.cash
addnode=fhsxfrwpyrtoxeal.onion
addnode=w3dxku36wbp3lowx.onion
addnode=zcash2iihed2wdux.onion
addnode=zcash5adwfpxfuvf.onion
addnode=zcasha3cmfrpy7b7.onion
@ohac
ohac / monacoin.txt
Created March 30, 2017 13:47
[ANN][MONA] Monacoin LAUNCHING 2014/01/01 0:00 GMT
[center][img]http://monacoin.org/img/monacoin.png[/img]
[size=15pt]http://monacoin.org/en/[/size]
[b][color=blue][size=15pt]Specifications[/size][/color][/b]
Algorithm: Scrypt
Premine: none
Block reward: 50 MONA
Block time: 1.5 minutes
Retarget: 1 block (DigiShield difficulty algorithm. Hard Fork at block 140000)
@ohac
ohac / mksfz.go
Last active September 2, 2017 16:03
Creat a SFZ drums patch
package main
import (
"fmt"
"os"
"path"
"strings"
)
type Layer struct {
diff --git a/drmr.c b/drmr.c
index 5b8cf81..7ec9644 100644
--- a/drmr.c
+++ b/drmr.c
@@ -260,6 +260,7 @@ if (ch < 0 || channel == ch) {
nn = data[1];
nn-=baseNote;
if (kit != NULL) nn = mod_nn(nn, kit->samples);
+if (!drmr->samples[nn].active || drmr->samples[nn].offset > 10) {
trigger_sample(drmr,nn,data);
@ohac
ohac / Dockerfile
Last active October 8, 2016 05:29
BitTorrent tracker container
FROM debian:jessie
RUN apt-get update && \
apt-get install -y bittorrent && \
apt-get clean
CMD bttrack --dfile dfile --port 6969
# docker build -t bttrack .
# docker run -d -p 6969:6969 bttrack
@ohac
ohac / Dockerfile
Created October 7, 2016 14:49
WebTorrent Hybrid Container example
FROM node
RUN apt-get update && \
apt-get install -y xvfb libgtk2.0-0 libxtst-dev libxss-dev libgconf2-dev \
libnss3 libasound2-dev && \
apt-get clean
RUN npm install webtorrent-hybrid -g
RUN mkdir work
WORKDIR work
CMD webtorrent-hybrid download \
e14cef00945a8d99dc74d65cf52dcb892cf48ed1 \