Skip to content

Instantly share code, notes, and snippets.

// gcc -g -o lv2forge lv2forge.c -Wall
#include <stdio.h>
#include <stdlib.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h>
#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
@x42
x42 / profile.cc
Last active February 21, 2019 04:47
// g++ -o profile profile.cc -Wall
#include <boost/shared_ptr.hpp>
#include <stdio.h>
#include <sys/time.h>
#include <vector>
class Test
{
public:
// gcc -Wall -pthread -o vforktest vforktest.c
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
static void* run (void* arg)
{
for (int i = 0; i < 6; ++i) {
printf ("Test %d\n", i);
local reclen = 5 -- seconds
-- create a list of MIDI tracks to bounce
local mt = {}
for t in Session:get_tracks():iter() do -- for each track
if not t:to_track():to_midi_track():isnil() then -- check if it's a MIDI track
mt[t:name()] = t
end
-- mute *all* tracks (for now)
t:mute_control():set_value(1, PBD.GroupControlDisposition.NoGroup);
// gcc `pkg-config --cflags --libs glib-2.0` -pthread semproc.c -o semproc
/* Example to parallel progress a directed acyclic graph as described in
* Chapter 17.3 of http://www.theses.fr/2017PA080116, page 131-135
* https://gareus.org/misc/thesis-p8/2017-12-Gareus-Lat.pdf
*
* (C) 2017, 2019 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
// g++ `pkg-config --cflags --libs glib-2.0` -pthread semproc++.cc -o semproc
/* Example to parallel progress a directed acyclic graph as described in
* Chapter 17.3 of http://www.theses.fr/2017PA080116, page 131-135
* https://gareus.org/misc/thesis-p8/2017-12-Gareus-Lat.pdf
*
* (C) 2017, 2019 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@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 ()
/*
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.
// 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;
@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