Skip to content

Instantly share code, notes, and snippets.

View jpcima's full-sized avatar

JP Cimalando jpcima

View GitHub Profile
@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 / hidpi-notes-for-plugins.md
Created January 10, 2020 07:49
How to get portable window scale factor (Retina)
/*
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 / 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;
@jpcima
jpcima / pitchbender.cc
Created February 8, 2020 22:40
pitch bend lfo with jack
#include <jack/jack.h>
#include <jack/midiport.h>
#include <unistd.h>
#include <stdexcept>
#include <cstdint>
static double samplerate = 0;
static jack_port_t *midiport = nullptr;
@jpcima
jpcima / generate.cpp
Last active February 9, 2020 22:10
Wavetable generator
#include "kiss_fftr.h"
#include <memory>
#include <complex>
static std::complex<kiss_fft_scalar> make_bin(double amplitude, double phase = 0.0)
{
return std::polar<kiss_fft_scalar>(0.5 * amplitude, phase + M_PI / 2);
}
static void make_sine(kiss_fft_scalar *wave, int size, double amplitude)
/* pluck.c - elementary waveguide simulation of plucked strings - JOS 6/6/92 */
/* Note: The word "inline" below can be deleted if your compiler
does not support it. It is a nice GNU feature not in the ANSII C spec. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
diff --git a/cmake/LV2Config.cmake b/cmake/LV2Config.cmake
index ad6d351..e866205 100644
--- a/cmake/LV2Config.cmake
+++ b/cmake/LV2Config.cmake
@@ -7,7 +7,7 @@ set (LV2PLUGIN_COMMENT "SFZ sampler")
set (LV2PLUGIN_URI "http://sfztools.github.io/sfizz")
set (LV2PLUGIN_REPOSITORY "https://github.com/sfztools/sfizz")
set (LV2PLUGIN_AUTHOR "Paul Ferrand")
-set (LV2PLUGIN_EMAIL "paul at ferrand dot cc")
+set (LV2PLUGIN_EMAIL "paul@ferrand.cc")
diff --git a/include/CNativeFileSystem.h b/include/CNativeFileSystem.h
index 338afd7..75f09f2 100644
--- a/include/CNativeFileSystem.h
+++ b/include/CNativeFileSystem.h
@@ -11,8 +11,6 @@
#include "IFileSystem.h"
-struct SDir;
-
// Experiments with auto-detune
declare author "JPC";
declare licence "CC-0";
import("stdfaust.lib");
frequency = hslider("[1] Oscillator frequency [unit:Hz] [scale:log]", 440.0, 50.0, 1000.0, 1.0);
//------------------------------------------------------------------------------
detuneAmount = hslider("[2] Detune amount [unit:%]", 50.0, 0.0, 100.0, 1.0) : *(0.01);