Skip to content

Instantly share code, notes, and snippets.

ardour {
["type"] = "dsp",
name = "Lua IR Capture and Convolver",
license = "MIT",
author = "Ardour Team",
description = [[Another DSP example]]
}
function dsp_ioconfig () return
{
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#define LV2_TinyUI_URI "http://example.org/lv2/tinyUI"
#define LV2_TinyUI_PREFIX LV2_INLINEDISPLAY_URI "#"
#define LV2_TinyUI__interface LV2_INLINEDISPLAY_PREFIX "Interface"
#define LV2_TinyUI__feature LV2_INLINEDISPLAY_PREFIX "Feature"
/** a LV2 Feature provided by the Host to the plugin */
typedef struct {
/** Opaque host data */
LV2UI_Controller controller;
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix pset: <http://lv2plug.in/ns/ext/presets#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix state: <http://lv2plug.in/ns/ext/state#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix zcpset: <http://gareus.org/oss/lv2/zeroconvolv/pset#> .
@x42
x42 / tanh.cc
Created January 12, 2021 21:25
#include <cmath>
#include <lv2.h>
static inline float db_to_gain( float x)
{
return powf (10.f, 0.05 * x);
}
struct clipping_tanh {
float *ports[6];
@x42
x42 / hw2.bip
Created November 27, 2020 20:50
#!/tmp/bipscript/build/bipscript
synth <- Lv2.Plugin("http://gareus.org/oss/lv2/b_synth")
eq <- Lv2.Plugin("http://gareus.org/oss/lv2/fil4#stereo")
input <- Midi.Input("my_input")
output <- Audio.StereoOutput("out", true)
input => synth => eq => output
@x42
x42 / hw.bip
Created November 27, 2020 20:28
#!/tmp/bipscript/build/bipscript
synth <- Lv2.Plugin("http://gareus.org/oss/lv2/b_synth")
#eq <- Lv2.Plugin("http://gareus.org/oss/lv2/fil4#stereo")
input <- Midi.Input("my_input")
output <- Audio.StereoOutput("out", true)
input => synth => output
#input => synth => eq => output
// gcc -o bpms bpms.c -Wall && ./bpms
#include<stdio.h>
int main (int argc, char** argv)
{
// 176400: 2 2 2 2 3 3 5 5 7 7 == 2^4 * 3^2 * 5^2 * 7^2
// 384000: 2 2 2 2 2 2 2 2 2 2 3 5 5 5 == 2^10 * 3^1 * 5^3
int sr = 56448000; // 2^10 * 3^2 * 5^3 * 7^2
int i = 0;
/*
this file is a part of ladosc, which in turn is a part of the noisesmith
package: <http://code.google.com/p/noisesmith-linux-audio/>
Copyright (C) 2008 Justin Smith
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@x42
x42 / a-Distort.lua
Created November 20, 2019 17:27
A distortion plugin for Ardour written in Lua. Copy this file to `$HOME/.config/ardour5/scripts/`. If the `scripts` dir does not exist, create it.
ardour {
["type"] = "dsp",
name = "a-Distort",
category = "Distort",
license = "GPLv2",
author = "Robert Scott",
description = [[A distortion plugin with a number of algorithms to choose from.]]
}
function dsp_ioconfig ()