Skip to content

Instantly share code, notes, and snippets.

View jpcima's full-sized avatar

JP Cimalando jpcima

View GitHub Profile
@jpcima
jpcima / comb2.dsp
Created February 8, 2020 12:14
sfz comb filter (not really, bad controls)
import("stdfaust.lib");
sfzComb = comb : *(outputGain) with {
comb = fi.ff_comb(int(0.5+delayMax*ma.SR), delay*ma.SR, 1.0, resonance);
outputGain = ba.db2linear(-3.0)/sqrt(0.5*(1.0+resonance*resonance));
lfoFreq = 1.0;
lfoSemi = os.lf_triangle(lfoFreq) : *(lfoKeyRange);
lfoRatio = lfoSemi : ba.semi2ratio;
/*
clang++ -O2 -g -Isrc/external -Iexternal/abseil-cpp -Isrc/sfizz -o FixPathCase \
FixPathCase.cpp \
external/abseil-cpp/absl/strings/ascii.cc \
external/abseil-cpp/absl/strings/match.cc \
external/abseil-cpp/absl/strings/internal/memutil.cc \
external/abseil-cpp/absl/base/internal/throw_delegate.cc
*/
#include <iostream>
@jpcima
jpcima / hidpi-notes-for-plugins.md
Created January 10, 2020 07:49
How to get portable window scale factor (Retina)
@jpcima
jpcima / lilv-scalepoints-i18n.diff
Created January 9, 2020 06:57
Fix Lilv i18n for Sfizz
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index 52e0870..eee03f0 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -266,6 +266,9 @@ void lilv_plugin_free(LilvPlugin* plugin);
LilvNode* lilv_plugin_get_unique(const LilvPlugin* plugin,
const SordNode* subject,
const SordNode* predicate);
+LilvNode* lilv_plugin_get_unique_i18n(const LilvPlugin* plugin,
+ const SordNode* subject,
@jpcima
jpcima / softclip2.gp
Created January 4, 2020 15:51
Asymmetric soft clipper with level parameter
# CC0-1.0 or MIT
# asymmetric soft clipping waveshaper
# k: the curve control parameter (0 excl. to 1)
cubic(x)=(x*x*x/3)
lm(k)=-sqrt(k*k*k)/(k*k*k) # the local minimum
kubic(k,x)=x-cubic(k*x)
max(a,b)=(a>b)?a:b
@jpcima
jpcima / softclip1.gp
Last active January 4, 2020 15:23
Asymmetric soft clipper with parameter
# license CC0-1.0 or MIT
cubic(x)=(x*x*x/3)
lm(k)=-sqrt(k*k*k)/(k*k*k) # the local minimum
kubic(k,x)=x-cubic(k*x)
max(a,b)=(a>b)?a:b
nl(k,x)=(x>0)?x:kubic(k,max(x,lm(k)))
set xrange [-1:+1]
import yaml
s = set()
def process_opc(obj):
s.add(obj['name'])
for a in obj.get('alias', []):
process_opc(a)
for m in obj.get('modulation', {}).get('midi_cc', []):
process_opc(m)
;;; sfz.mode --- Major mode for SFZ files
;; Copyright (C) 2019 Jean Pierre Cimalando
;; Version: 0.1
;; Keywords: languages
;;; Commentary:
;; This is a basic mode for edition of SFZ instruments.
;;; License:
install -d tmp
faust -i modules/screamer.dsp -a jack-gtk.cpp -o tmp/screamer_jack.cpp
$(CXX) $(CXXFLAGS) -fPIC -o screamer_jack tmp/screamer_jack.cpp `pkg-config jack gtk+-2.0 --cflags --libs` $(LDFLAGS)
faust -i modules/screamer.dsp -a ladspa.cpp -o tmp/screamer_ladspa.cpp
$(CXX) $(CXXFLAGS) -fPIC -shared -Dmydsp=screamer -o screamer.so tmp/screamer_ladspa.cpp $(LDFLAGS)
@jpcima
jpcima / Faust 2.14.4.txt
Created November 30, 2019 06:15
Faust 2.14.4
bin
bin/encoderunitypackage
bin/faust
bin/faust2alqt
bin/faust2alsa
bin/faust2alsaconsole
bin/faust2android
bin/faust2androidunity
bin/faust2api
bin/faust2asmjs