Skip to content

Instantly share code, notes, and snippets.

// 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
// 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
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 -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);
@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 -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>
#!/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
ardour {
["type"] = "EditorHook",
name = "OSC Marker Msg",
author = "Ardour Lua Task Force",
description = "Send a OSC message when playing through a marker",
}
function action_params ()
return
{
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#/bin/sh
set -e
for d in ~/.u-he/*/dialog.[36][24]; do
if test -f $d.real; then continue; fi
mv "$d" "$d.real"
cat > $d << EOF
#!/bin/sh
unset LD_LIBRARY_PATH
exec \$(readlink -f \$0).real "\$@"
EOF