Skip to content

Instantly share code, notes, and snippets.

View bpms.c
// 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;
View lad-osc.c
/*
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 Nov 20, 2019
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.
View a-Distort.lua
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 ()
View semproc++.cc
// 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
View semproc.c
// 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
View overnight.lua
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);
View vforktest.c
// 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);
View profile.cc
// g++ -o profile profile.cc -Wall
#include <boost/shared_ptr.hpp>
#include <stdio.h>
#include <sys/time.h>
#include <vector>
class Test
{
public:
View lv2forge.c
// 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>
View buildstack.sh
#!/bin/bash
## the general idea is to run this script in a pbuilder/cowbuilder
## environment (system-wide libs matching the target CPU arch)
## keep a copy of the sources here:
: ${SRCDIR=/var/tmp/src_cache}
## builder location
: ${ROOTDIR=$HOME/builder/}
## target architecture
You can’t perform that action at this time.