Skip to content

Instantly share code, notes, and snippets.

View msvc_sorted_set_test-2.cc
// g++ -o msvc_sorted_set_test-2 msvc_sorted_set_test-2.cc
#include <iostream>
#include <set>
#include <string>
#include <boost/shared_ptr.hpp>
struct CustomCompare /* final */
{
bool operator() (boost::shared_ptr<std::string> const& a, boost::shared_ptr<std::string> const& b) const
View msvc_sorted_set_test.cc
// g++ -o msvc_sorted_set_test msvc_sorted_set_test.cc
#include <iostream>
#include <set>
#include <string>
struct CustomCompare /* final */
{
bool operator() (std::string const& a, std::string const& b) const
{
View lv2_tinyUI.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;
View presets.ttl
@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#> .
View tanh.cc
#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];
View ash.ttl
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix unit: <http://lv2plug.in/ns/extensions/units#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<https://shafq.at/pages/about.html#about>
a foaf:Person;
View hw2.bip
#!/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
View hw.bip
#!/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
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.