From af19d28a2ed3ff31926fba4fc4837d3251a9c1f9 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 28 Nov 2016 09:27:47 +0100 Subject: [PATCH] Cleanup directories. Running version of Dexed - now testing must begin. --- bin/dx7sysex2lv2 | 4 +- dexed-test.sh | 12 - lv2-examples/beep.lv2tools/Makefile | 22 - lv2-examples/beep.lv2tools/beep.cpp | 61 - lv2-examples/beep.lv2tools/beep.peg | 35 - lv2-examples/beep.lv2tools/beep.ttl | 49 - .../beep.lv2tools/lv2pftci-beep.lv2/beep.ttl | 49 - .../lv2pftci-beep.lv2/manifest.ttl | 5 - lv2-examples/beep.lv2tools/manifest.ttl | 5 - lv2-examples/beep/Makefile | 22 - lv2-examples/beep/beep.cpp | 91 - lv2-examples/beep/beep.peg | 35 - lv2-examples/beep/beep.ttl | 67 - lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl | 67 - .../beep/lv2pftci-beep.lv2/manifest.ttl | 44 - lv2-examples/beep/manifest.ttl | 44 - lv2-examples/beep2.lv2tools/Makefile | 23 - lv2-examples/beep2.lv2tools/beep.cpp | 95 - lv2-examples/beep2.lv2tools/beep.peg | 39 - lv2-examples/beep2.lv2tools/beep2.ttl | 69 - .../lv2pftci-beep2.lv2/beep2.ttl | 69 - .../lv2pftci-beep2.lv2/manifest.ttl | 5 - lv2-examples/beep2.lv2tools/manifest.ttl | 5 - lv2-examples/beep2/Makefile | 23 - lv2-examples/beep2/beep.cpp | 94 - lv2-examples/beep2/beep.peg | 39 - lv2-examples/beep2/beep2.ttl | 69 - .../beep2/lv2pftci-beep2.lv2/beep2.ttl | 69 - .../beep2/lv2pftci-beep2.lv2/manifest.ttl | 5 - lv2-examples/beep2/manifest.ttl | 5 - lv2-examples/eg-sampler.lv2/README.txt | 13 - lv2-examples/eg-sampler.lv2/atom_sink.h | 40 - lv2-examples/eg-sampler.lv2/click.wav | Bin 644 -> 0 bytes lv2-examples/eg-sampler.lv2/manifest.ttl.in | 19 - lv2-examples/eg-sampler.lv2/sampler.c | 552 ------ lv2-examples/eg-sampler.lv2/sampler.ttl | 70 - lv2-examples/eg-sampler.lv2/sampler_ui.c | 254 --- lv2-examples/eg-sampler.lv2/uris.h | 139 -- lv2-examples/eg-sampler.lv2/waf | 1 - lv2-examples/eg-sampler.lv2/wscript | 83 - lv2/Dexed.ttl | 1536 ----------------- lv2/manifest.ttl | 26 - src/dexed.cpp | 39 +- src/dexed.h | 10 +- 44 files changed, 25 insertions(+), 3978 deletions(-) delete mode 100755 dexed-test.sh delete mode 100644 lv2-examples/beep.lv2tools/Makefile delete mode 100644 lv2-examples/beep.lv2tools/beep.cpp delete mode 100644 lv2-examples/beep.lv2tools/beep.peg delete mode 100644 lv2-examples/beep.lv2tools/beep.ttl delete mode 100644 lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl delete mode 100644 lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl delete mode 100644 lv2-examples/beep.lv2tools/manifest.ttl delete mode 100644 lv2-examples/beep/Makefile delete mode 100644 lv2-examples/beep/beep.cpp delete mode 100644 lv2-examples/beep/beep.peg delete mode 100644 lv2-examples/beep/beep.ttl delete mode 100644 lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl delete mode 100644 lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl delete mode 100644 lv2-examples/beep/manifest.ttl delete mode 100644 lv2-examples/beep2.lv2tools/Makefile delete mode 100644 lv2-examples/beep2.lv2tools/beep.cpp delete mode 100644 lv2-examples/beep2.lv2tools/beep.peg delete mode 100644 lv2-examples/beep2.lv2tools/beep2.ttl delete mode 100644 lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl delete mode 100644 lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl delete mode 100644 lv2-examples/beep2.lv2tools/manifest.ttl delete mode 100644 lv2-examples/beep2/Makefile delete mode 100644 lv2-examples/beep2/beep.cpp delete mode 100644 lv2-examples/beep2/beep.peg delete mode 100644 lv2-examples/beep2/beep2.ttl delete mode 100644 lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl delete mode 100644 lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl delete mode 100644 lv2-examples/beep2/manifest.ttl delete mode 100644 lv2-examples/eg-sampler.lv2/README.txt delete mode 100644 lv2-examples/eg-sampler.lv2/atom_sink.h delete mode 100644 lv2-examples/eg-sampler.lv2/click.wav delete mode 100644 lv2-examples/eg-sampler.lv2/manifest.ttl.in delete mode 100644 lv2-examples/eg-sampler.lv2/sampler.c delete mode 100644 lv2-examples/eg-sampler.lv2/sampler.ttl delete mode 100644 lv2-examples/eg-sampler.lv2/sampler_ui.c delete mode 100644 lv2-examples/eg-sampler.lv2/uris.h delete mode 120000 lv2-examples/eg-sampler.lv2/waf delete mode 100644 lv2-examples/eg-sampler.lv2/wscript delete mode 100644 lv2/Dexed.ttl delete mode 100644 lv2/manifest.ttl diff --git a/bin/dx7sysex2lv2 b/bin/dx7sysex2lv2 index fce87d9..4831d6d 100755 --- a/bin/dx7sysex2lv2 +++ b/bin/dx7sysex2lv2 @@ -113,9 +113,9 @@ sub write_preset_header print $deeaxe_voice " ] , [\n"; print_lv2_port("output","1.0"); print $deeaxe_voice " ] , [\n"; - print_lv2_port("engine","2.0"); + print_lv2_port("engine","2"); print $deeaxe_voice " ] , [\n"; - print_lv2_port("unisono","0.0"); + print_lv2_port("unisono","0"); } sub write_manifest diff --git a/dexed-test.sh b/dexed-test.sh deleted file mode 100755 index e230076..0000000 --- a/dexed-test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -export LV2_PATH="/usr/local/lib/lv2" -jackd --silent -r -d dummy & -mod-host -i < -#include "beep.peg" - - -class BeepVoice : public LV2::Voice { -public: - - BeepVoice(double rate) - : m_key(LV2::INVALID_KEY), m_rate(rate), m_period(10), m_counter(0) { - - } - - void on(unsigned char key, unsigned char velocity) { - m_key = key; - m_period = m_rate * 4.0 / LV2::key2hz(m_key); - } - - void off(unsigned char velocity) { - m_key = LV2::INVALID_KEY; - } - - unsigned char get_key() const { - return m_key; - } - - void render(uint32_t from, uint32_t to) { - if (m_key == LV2::INVALID_KEY) - return; - for (uint32_t i = from; i < to; ++i) { - float s = -0.25 + 0.5 * (m_counter > m_period / 2); - m_counter = (m_counter + 1) % m_period; - p(p_left)[i] += s; - p(p_right)[i] += s; - } - } - -protected: - - unsigned char m_key; - double m_rate; - uint32_t m_period; - uint32_t m_counter; - -}; - - -class Beep : public LV2::Synth { -public: - - Beep(double rate) - : LV2::Synth(p_n_ports, p_midi) { - add_voices(new BeepVoice(rate), new BeepVoice(rate), new BeepVoice(rate)); - add_audio_outputs(p_left, p_right); - } - -}; - - -static int _ = Beep::register_class(p_uri); diff --git a/lv2-examples/beep.lv2tools/beep.peg b/lv2-examples/beep.lv2tools/beep.peg deleted file mode 100644 index daa5805..0000000 --- a/lv2-examples/beep.lv2tools/beep.peg +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef beep_peg -#define beep_peg - - -#ifndef PEG_STRUCT -#define PEG_STRUCT -typedef struct { - float min; - float max; - float default_value; - char toggled; - char integer; - char logarithmic; -} peg_data_t; -#endif - -/* */ - -static const char p_uri[] = "http://ll-plugins.nongnu.org/lv2/lv2pftci/beep"; - -enum p_port_enum { - p_midi, - p_left, - p_right, - p_n_ports -}; - -static const peg_data_t p_ports[] = { - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, -}; - - -#endif /* beep_peg */ diff --git a/lv2-examples/beep.lv2tools/beep.ttl b/lv2-examples/beep.lv2tools/beep.ttl deleted file mode 100644 index 339824d..0000000 --- a/lv2-examples/beep.lv2tools/beep.ttl +++ /dev/null @@ -1,49 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ]. diff --git a/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl b/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl deleted file mode 100644 index 339824d..0000000 --- a/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl +++ /dev/null @@ -1,49 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ]. diff --git a/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl b/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl deleted file mode 100644 index 8511bab..0000000 --- a/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/beep.lv2tools/manifest.ttl b/lv2-examples/beep.lv2tools/manifest.ttl deleted file mode 100644 index 8511bab..0000000 --- a/lv2-examples/beep.lv2tools/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/beep/Makefile b/lv2-examples/beep/Makefile deleted file mode 100644 index cc22f04..0000000 --- a/lv2-examples/beep/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -BUNDLE = lv2pftci-beep.lv2 -INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 - -$(BUNDLE): manifest.ttl beep.ttl beep.so - rm -rf $(BUNDLE) - mkdir $(BUNDLE) - cp $^ $(BUNDLE) - -beep.so: beep.cpp beep.peg - g++ -shared -fPIC -DPIC beep.cpp -I. -I/usr/local/include/lvtk-2 -L/usr/local/lib -llvtk_plugin2 -o beep.so - -beep.peg: beep.ttl - lv2peg beep.ttl beep.peg - -install: $(BUNDLE) - mkdir -p $(INSTALL_DIR) - rm -rf $(INSTALL_DIR)/$(BUNDLE) - cp -R $(BUNDLE) $(INSTALL_DIR) - -clean: - rm -rf $(BUNDLE) beep.so beep.peg - diff --git a/lv2-examples/beep/beep.cpp b/lv2-examples/beep/beep.cpp deleted file mode 100644 index 621d870..0000000 --- a/lv2-examples/beep/beep.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - beep.cpp - LV2 Toolkit API Demonstration Plugin - - Copyright (C) 2004-2010 Lars Luthman - Updated for LVTK by Michael Fisher - - 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 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ -/** @file beep.cpp */ - - -#include -#include "beep.peg" - -class BeepVoice : public lvtk::Voice -{ -public: - - BeepVoice (double rate) - : m_key(lvtk::INVALID_KEY), m_rate(rate), m_period(10), m_counter(0) - { } - - void - on (unsigned char key, unsigned char velocity) - { - m_key = key; - m_period = m_rate * 4.0 / lvtk::key2hz(m_key); - } - - void - off (unsigned char velocity) - { - m_key = lvtk::INVALID_KEY; - } - - unsigned char - get_key() const - { - return m_key; - } - - void - render(uint32_t from, uint32_t to) - { - if (m_key == lvtk::INVALID_KEY) return; - - for (uint32_t i = from; i < to; ++i) - { - float s = -0.25 + 0.5 * (m_counter > m_period / 2); - m_counter = (m_counter + 1) % m_period; - p(p_left)[i] += s; - p(p_right)[i] += s; - } - } - -protected: - - unsigned char m_key; - double m_rate; - uint32_t m_period; - uint32_t m_counter; - -}; - - -class Beep : public lvtk::Synth -{ -public: - - Beep (double rate) : lvtk::Synth (p_n_ports, p_midi) - { - add_voices (new BeepVoice(rate), new BeepVoice(rate), new BeepVoice(rate)); - add_audio_outputs (p_left, p_right); - } -}; - - -static int _ = Beep::register_class(p_uri); diff --git a/lv2-examples/beep/beep.peg b/lv2-examples/beep/beep.peg deleted file mode 100644 index daa5805..0000000 --- a/lv2-examples/beep/beep.peg +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef beep_peg -#define beep_peg - - -#ifndef PEG_STRUCT -#define PEG_STRUCT -typedef struct { - float min; - float max; - float default_value; - char toggled; - char integer; - char logarithmic; -} peg_data_t; -#endif - -/* */ - -static const char p_uri[] = "http://ll-plugins.nongnu.org/lv2/lv2pftci/beep"; - -enum p_port_enum { - p_midi, - p_left, - p_right, - p_n_ports -}; - -static const peg_data_t p_ports[] = { - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, -}; - - -#endif /* beep_peg */ diff --git a/lv2-examples/beep/beep.ttl b/lv2-examples/beep/beep.ttl deleted file mode 100644 index 6030eab..0000000 --- a/lv2-examples/beep/beep.ttl +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2004-2010 Lars Luthman -# Updated for LVTK by Michael Fisher -# -# 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 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -@prefix lv2: . -@prefix atom: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix ui: . -@prefix lvtkp: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin ; - doap:name "Beep" ; - lv2:project lvtkp: ; - doap:license ; - ui:ui ; - ll:pegName "p" ; - - lv2:port [ - a atom:AtomPort , lv2:InputPort ; - lv2:index 0; - lv2:symbol "midi"; - lv2:name "MIDI"; - atom:bufferType atom:Sequence ; - atom:supports ; - - ] , [ - a lv2:AudioPort - , lv2:OutputPort ; - lv2:index 1 ; - lv2:symbol "left" ; - lv2:name "Left" ; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ] , [ - a lv2:AudioPort , - lv2:OutputPort ; - lv2:index 2 ; - lv2:symbol "right" ; - lv2:name "Right" ; - pg:membership [ - pg:group ; - pg:role pg:rightChannel ; - ] ; - ] . \ No newline at end of file diff --git a/lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl b/lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl deleted file mode 100644 index 6030eab..0000000 --- a/lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2004-2010 Lars Luthman -# Updated for LVTK by Michael Fisher -# -# 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 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -@prefix lv2: . -@prefix atom: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix ui: . -@prefix lvtkp: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin ; - doap:name "Beep" ; - lv2:project lvtkp: ; - doap:license ; - ui:ui ; - ll:pegName "p" ; - - lv2:port [ - a atom:AtomPort , lv2:InputPort ; - lv2:index 0; - lv2:symbol "midi"; - lv2:name "MIDI"; - atom:bufferType atom:Sequence ; - atom:supports ; - - ] , [ - a lv2:AudioPort - , lv2:OutputPort ; - lv2:index 1 ; - lv2:symbol "left" ; - lv2:name "Left" ; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ] , [ - a lv2:AudioPort , - lv2:OutputPort ; - lv2:index 2 ; - lv2:symbol "right" ; - lv2:name "Right" ; - pg:membership [ - pg:group ; - pg:role pg:rightChannel ; - ] ; - ] . \ No newline at end of file diff --git a/lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl b/lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl deleted file mode 100644 index 2ad1948..0000000 --- a/lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2013 Michael Fisher -# -# 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 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -@prefix doap: . -@prefix foaf: . -@prefix rdfs: . -@prefix lv2: . -@prefix lvtkp: . -@prefix ui: . - - - - a foaf:Person ; - foaf:name "Michael Fisher" ; - foaf:mbox ; - rdfs:seeAlso . - -lvtkp: - a doap:Project ; - lv2:symbol "lvtk" ; - doap:name "LVTK Examples" ; - doap:shortdesc "Example plugins demonstrating the LVTK api." ; - doap:homepage ; - doap:maintainer ; - doap:developer . - - - a lv2:Plugin ; - lv2:binary ; - rdfs:seeAlso . - diff --git a/lv2-examples/beep/manifest.ttl b/lv2-examples/beep/manifest.ttl deleted file mode 100644 index 2ad1948..0000000 --- a/lv2-examples/beep/manifest.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2013 Michael Fisher -# -# 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 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -@prefix doap: . -@prefix foaf: . -@prefix rdfs: . -@prefix lv2: . -@prefix lvtkp: . -@prefix ui: . - - - - a foaf:Person ; - foaf:name "Michael Fisher" ; - foaf:mbox ; - rdfs:seeAlso . - -lvtkp: - a doap:Project ; - lv2:symbol "lvtk" ; - doap:name "LVTK Examples" ; - doap:shortdesc "Example plugins demonstrating the LVTK api." ; - doap:homepage ; - doap:maintainer ; - doap:developer . - - - a lv2:Plugin ; - lv2:binary ; - rdfs:seeAlso . - diff --git a/lv2-examples/beep2.lv2tools/Makefile b/lv2-examples/beep2.lv2tools/Makefile deleted file mode 100644 index caf8c50..0000000 --- a/lv2-examples/beep2.lv2tools/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -BUNDLE = lv2pftci-beep2.lv2 -INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 - - -$(BUNDLE): manifest.ttl beep2.ttl beep2.so - rm -rf $(BUNDLE) - mkdir $(BUNDLE) - cp $^ $(BUNDLE) - -beep2.so: beep.cpp beep.peg - g++ -shared -fPIC -DPIC beep.cpp `pkg-config --cflags --libs lv2-plugin` -o beep2.so - -beep.peg: beep2.ttl - lv2peg beep2.ttl beep.peg - -install: $(BUNDLE) - mkdir -p $(INSTALL_DIR) - rm -rf $(INSTALL_DIR)/$(BUNDLE) - cp -R $(BUNDLE) $(INSTALL_DIR) - -clean: - rm -rf $(BUNDLE) beep2.so beep.peg - diff --git a/lv2-examples/beep2.lv2tools/beep.cpp b/lv2-examples/beep2.lv2tools/beep.cpp deleted file mode 100644 index e8d08cd..0000000 --- a/lv2-examples/beep2.lv2tools/beep.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth - -#include -#include "beep.peg" -#include - -class BeepVoice : public LV2::Voice { -public: - - BeepVoice(double rate) - : m_key(LV2::INVALID_KEY), m_rate(rate), m_period(10), m_counter(0) { - - } - - void on(unsigned char key, unsigned char velocity) { - m_key = key; - m_period = m_rate * 4.0 / LV2::key2hz(m_key); - m_pos = std::rand() / float(RAND_MAX); - m_envelope = velocity / 128.0; - } - - void off(unsigned char velocity) { - m_key = LV2::INVALID_KEY; - } - - unsigned char get_key() const { - return m_key; - } - - void render(uint32_t from, uint32_t to) { - if (m_key == LV2::INVALID_KEY) - return; - for (uint32_t i = from; i < to; ++i) { - float pwm = *p(p_pwm) + (1 - *p(p_pwm)) * m_envelope; - float s = -0.25 + 0.5 * (m_counter > m_period * (1 + pwm) / 2); - m_counter = (m_counter + 1) % m_period; - p(p_left)[i] += (1 - m_pos) * s; - p(p_right)[i] += m_pos * s; - if (m_envelope > 0) - m_envelope -= 0.5 / m_rate; - } - } - -protected: - - unsigned char m_key; - double m_rate; - uint32_t m_period; - uint32_t m_counter; - float m_pos; - float m_envelope; - -}; - - -class Beep : public LV2::Synth { -public: - - Beep(double rate) - : LV2::Synth(p_n_ports, p_midi), - m_buf_pos(0), m_delay(rate / 3), - m_l_buffer(new float[m_delay]), m_r_buffer(new float[m_delay]) { - add_voices(new BeepVoice(rate), new BeepVoice(rate), new BeepVoice(rate)); - add_audio_outputs(p_left, p_right); - for (unsigned i = 0; i < m_delay; ++i) { - m_l_buffer[i] = 0; - m_r_buffer[i] = 0; - } - } - - void post_process(uint32_t from, uint32_t to) { - for (uint32_t i = from; i < to; ++i) { - float mono = (p(p_left)[i] + p(p_right)[i]) / 2; - p(p_left)[i] += m_l_buffer[m_buf_pos]; - p(p_right)[i] += m_r_buffer[m_buf_pos]; - float tmp = m_l_buffer[m_buf_pos]; - m_l_buffer[m_buf_pos] = 0.6 * (mono + m_r_buffer[m_buf_pos]); - m_r_buffer[m_buf_pos] = 0.6 * tmp; - m_buf_pos = (m_buf_pos + 1) % m_delay; - p(p_left)[i] *= *p(p_gain); - p(p_right)[i] *= *p(p_gain); - } - } - -protected: - - unsigned m_buf_pos; - unsigned m_delay; - float* m_l_buffer; - float* m_r_buffer; - -}; - - -static int _ = Beep::register_class(p_uri); diff --git a/lv2-examples/beep2.lv2tools/beep.peg b/lv2-examples/beep2.lv2tools/beep.peg deleted file mode 100644 index 4f6689f..0000000 --- a/lv2-examples/beep2.lv2tools/beep.peg +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef beep_peg -#define beep_peg - - -#ifndef PEG_STRUCT -#define PEG_STRUCT -typedef struct { - float min; - float max; - float default_value; - char toggled; - char integer; - char logarithmic; -} peg_data_t; -#endif - -/* */ - -static const char p_uri[] = "http://ll-plugins.nongnu.org/lv2/lv2pftci/beep2"; - -enum p_port_enum { - p_midi, - p_left, - p_right, - p_pwm, - p_gain, - p_n_ports -}; - -static const peg_data_t p_ports[] = { - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { 0, 1, 0.5, 0, 0, 0 }, - { 0, 2, 1, 0, 0, 0 }, -}; - - -#endif /* beep_peg */ diff --git a/lv2-examples/beep2.lv2tools/beep2.ttl b/lv2-examples/beep2.lv2tools/beep2.ttl deleted file mode 100644 index c9d3d90..0000000 --- a/lv2-examples/beep2.lv2tools/beep2.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep2"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 3; - lv2:symbol "pwm"; - lv2:name "PWM"; - lv2:minimum 0; - lv2:maximum 1; - lv2:default 0.5; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 4; - lv2:symbol "gain"; - lv2:name "Gain"; - lv2:minimum 0; - lv2:maximum 2; - lv2:default 1; - ]. diff --git a/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl b/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl deleted file mode 100644 index c9d3d90..0000000 --- a/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep2"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 3; - lv2:symbol "pwm"; - lv2:name "PWM"; - lv2:minimum 0; - lv2:maximum 1; - lv2:default 0.5; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 4; - lv2:symbol "gain"; - lv2:name "Gain"; - lv2:minimum 0; - lv2:maximum 2; - lv2:default 1; - ]. diff --git a/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl b/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl deleted file mode 100644 index 1516813..0000000 --- a/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/beep2.lv2tools/manifest.ttl b/lv2-examples/beep2.lv2tools/manifest.ttl deleted file mode 100644 index 1516813..0000000 --- a/lv2-examples/beep2.lv2tools/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/beep2/Makefile b/lv2-examples/beep2/Makefile deleted file mode 100644 index 49351e4..0000000 --- a/lv2-examples/beep2/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -BUNDLE = lv2pftci-beep2.lv2 -INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 - - -$(BUNDLE): manifest.ttl beep2.ttl beep2.so - rm -rf $(BUNDLE) - mkdir $(BUNDLE) - cp $^ $(BUNDLE) - -beep2.so: beep.cpp beep.peg - g++ -shared -fPIC -DPIC beep.cpp -I. -I/usr/local/include/lvtk-2 -L/usr/local/lib -llvtk_plugin2 -o beep2.so - -beep.peg: beep2.ttl - lv2peg beep2.ttl beep.peg - -install: $(BUNDLE) - mkdir -p $(INSTALL_DIR) - rm -rf $(INSTALL_DIR)/$(BUNDLE) - cp -R $(BUNDLE) $(INSTALL_DIR) - -clean: - rm -rf $(BUNDLE) beep2.so beep.peg - diff --git a/lv2-examples/beep2/beep.cpp b/lv2-examples/beep2/beep.cpp deleted file mode 100644 index 3d873b9..0000000 --- a/lv2-examples/beep2/beep.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth - -#include -#include "beep.peg" - -class BeepVoice : public lvtk::Voice { -public: - - BeepVoice(double rate) - : m_key(lvtk::INVALID_KEY), m_rate(rate), m_period(10), m_counter(0) { - - } - - void on(unsigned char key, unsigned char velocity) { - m_key = key; - m_period = m_rate * 4.0 / lvtk::key2hz(m_key); - m_pos = std::rand() / float(RAND_MAX); - m_envelope = velocity / 128.0; - } - - void off(unsigned char velocity) { - m_key = lvtk::INVALID_KEY; - } - - unsigned char get_key() const { - return m_key; - } - - void render(uint32_t from, uint32_t to) { - if (m_key == lvtk::INVALID_KEY) - return; - for (uint32_t i = from; i < to; ++i) { - float pwm = *p(p_pwm) + (1 - *p(p_pwm)) * m_envelope; - float s = -0.25 + 0.5 * (m_counter > m_period * (1 + pwm) / 2); - m_counter = (m_counter + 1) % m_period; - p(p_left)[i] += (1 - m_pos) * s; - p(p_right)[i] += m_pos * s; - if (m_envelope > 0) - m_envelope -= 0.5 / m_rate; - } - } - -protected: - - unsigned char m_key; - double m_rate; - uint32_t m_period; - uint32_t m_counter; - float m_pos; - float m_envelope; - -}; - - -class Beep : public lvtk::Synth { -public: - - Beep(double rate) - : lvtk::Synth(p_n_ports, p_midi), - m_buf_pos(0), m_delay(rate / 3), - m_l_buffer(new float[m_delay]), m_r_buffer(new float[m_delay]) { - add_voices(new BeepVoice(rate), new BeepVoice(rate), new BeepVoice(rate)); - add_audio_outputs(p_left, p_right); - for (unsigned i = 0; i < m_delay; ++i) { - m_l_buffer[i] = 0; - m_r_buffer[i] = 0; - } - } - - void post_process(uint32_t from, uint32_t to) { - for (uint32_t i = from; i < to; ++i) { - float mono = (p(p_left)[i] + p(p_right)[i]) / 2; - p(p_left)[i] += m_l_buffer[m_buf_pos]; - p(p_right)[i] += m_r_buffer[m_buf_pos]; - float tmp = m_l_buffer[m_buf_pos]; - m_l_buffer[m_buf_pos] = 0.6 * (mono + m_r_buffer[m_buf_pos]); - m_r_buffer[m_buf_pos] = 0.6 * tmp; - m_buf_pos = (m_buf_pos + 1) % m_delay; - p(p_left)[i] *= *p(p_gain); - p(p_right)[i] *= *p(p_gain); - } - } - -protected: - - unsigned m_buf_pos; - unsigned m_delay; - float* m_l_buffer; - float* m_r_buffer; - -}; - - -static int _ = Beep::register_class(p_uri); diff --git a/lv2-examples/beep2/beep.peg b/lv2-examples/beep2/beep.peg deleted file mode 100644 index 4f6689f..0000000 --- a/lv2-examples/beep2/beep.peg +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef beep_peg -#define beep_peg - - -#ifndef PEG_STRUCT -#define PEG_STRUCT -typedef struct { - float min; - float max; - float default_value; - char toggled; - char integer; - char logarithmic; -} peg_data_t; -#endif - -/* */ - -static const char p_uri[] = "http://ll-plugins.nongnu.org/lv2/lv2pftci/beep2"; - -enum p_port_enum { - p_midi, - p_left, - p_right, - p_pwm, - p_gain, - p_n_ports -}; - -static const peg_data_t p_ports[] = { - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { -3.40282e+38, 3.40282e+38, -3.40282e+38, 0, 0, 0 }, - { 0, 1, 0.5, 0, 0, 0 }, - { 0, 2, 1, 0, 0, 0 }, -}; - - -#endif /* beep_peg */ diff --git a/lv2-examples/beep2/beep2.ttl b/lv2-examples/beep2/beep2.ttl deleted file mode 100644 index c9d3d90..0000000 --- a/lv2-examples/beep2/beep2.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep2"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 3; - lv2:symbol "pwm"; - lv2:name "PWM"; - lv2:minimum 0; - lv2:maximum 1; - lv2:default 0.5; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 4; - lv2:symbol "gain"; - lv2:name "Gain"; - lv2:minimum 0; - lv2:maximum 2; - lv2:default 1; - ]. diff --git a/lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl b/lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl deleted file mode 100644 index c9d3d90..0000000 --- a/lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . - - a pg:StereoGroup. - - - a lv2:Plugin, lv2:InstrumentPlugin; - lv2:binary ; - doap:name "Beep2"; - doap:license ; - ll:pegName "p"; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0; - ev:supportsEvent ; - lv2:symbol "midi"; - lv2:name "MIDI"; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 1; - lv2:symbol "left"; - lv2:name "Left"; - pg:membership [ - pg:group ; - pg:role pg:leftChannel; - ]; - ], - - [ - a lv2:AudioPort, lv2:OutputPort; - lv2:index 2; - lv2:symbol "right"; - lv2:name "Right"; - pg:membership [ - pg:group ; - pg:role pg:rightChannel; - ]; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 3; - lv2:symbol "pwm"; - lv2:name "PWM"; - lv2:minimum 0; - lv2:maximum 1; - lv2:default 0.5; - ], - - [ - a lv2:ControlPort, lv2:InputPort; - lv2:index 4; - lv2:symbol "gain"; - lv2:name "Gain"; - lv2:minimum 0; - lv2:maximum 2; - lv2:default 1; - ]. diff --git a/lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl b/lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl deleted file mode 100644 index 1516813..0000000 --- a/lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/beep2/manifest.ttl b/lv2-examples/beep2/manifest.ttl deleted file mode 100644 index 1516813..0000000 --- a/lv2-examples/beep2/manifest.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . diff --git a/lv2-examples/eg-sampler.lv2/README.txt b/lv2-examples/eg-sampler.lv2/README.txt deleted file mode 100644 index 4eed9e6..0000000 --- a/lv2-examples/eg-sampler.lv2/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -== Sampler == - -This plugin loads a single sample from a .wav file and plays it back when a MIDI -note on is received. Any sample on the system can be loaded via another event. -A Gtk UI is included which does this, but the host can as well. - -This plugin illustrates: - -- UI <==> Plugin communication via events -- Use of the worker extension for non-realtime tasks (sample loading) -- Use of the log extension to print log messages via the host -- Saving plugin state via the state extension -- Dynamic plugin control via the same properties saved to state diff --git a/lv2-examples/eg-sampler.lv2/atom_sink.h b/lv2-examples/eg-sampler.lv2/atom_sink.h deleted file mode 100644 index ae3df30..0000000 --- a/lv2-examples/eg-sampler.lv2/atom_sink.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** - A forge sink that writes to an atom buffer. - - It is assumed that the handle points to an LV2_Atom large enough to store - the forge output. The forged result is in the body of the buffer atom. -*/ -static LV2_Atom_Forge_Ref -atom_sink(LV2_Atom_Forge_Sink_Handle handle, const void* buf, uint32_t size) -{ - LV2_Atom* atom = (LV2_Atom*)handle; - const uint32_t offset = lv2_atom_total_size(atom); - memcpy((char*)atom + offset, buf, size); - atom->size += size; - return offset; -} - -/** - Dereference counterpart to atom_sink(). -*/ -static LV2_Atom* -atom_sink_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref) -{ - return (LV2_Atom*)((char*)handle + ref); -} diff --git a/lv2-examples/eg-sampler.lv2/click.wav b/lv2-examples/eg-sampler.lv2/click.wav deleted file mode 100644 index 520a18ce6a8b21f398fdd87c75b5e5a758bdfd4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 644 zcmWIYbaSg=Vqge&40BD(Em06)U|?VbLYFlRV9dzC!H|+zk{AJ0(>-POlGU4b9Xx*S z%B}lPU%vbJ^~bNjfB*mg_y6yopFh5QeEah0y<3;h9Y3&Zqa{k1jU0c>Hoinw!t)?_LEiTmG&B4-0 zS6x9yOqh?GgM}Gv1p^Z^8z;Abh=iPyrk<&_vsX}LLS|t_W5>jq^H*%xw(sbvOV{r{ ze*WhDmv2A+K>Pu+QS3^-&T$qoC zla+-L>=8z0Rt|1{VR2bS4P6sUNB4lR`1HK;y7s>5^OvpLvgh#03s>(vc=qc3=dV9O zfd%x+pFcmpfBx|L#iM&SE}l8Mcl-L43uaE}Y^W^AOo$5fcD6Rt(^Qg^5aH+LU}J^` z7BdS67oU)rw1S$pk)^%6UubMfZfR{x@07Vq*KFB!=;XPpw;q5aw$mG}KX5loA)@ . -@prefix rdfs: . -@prefix ui: . - - - a lv2:Plugin ; - lv2:binary ; - rdfs:seeAlso . - - - a ui:GtkUI ; - ui:binary ; - rdfs:seeAlso . diff --git a/lv2-examples/eg-sampler.lv2/sampler.c b/lv2-examples/eg-sampler.lv2/sampler.c deleted file mode 100644 index 36acb2f..0000000 --- a/lv2-examples/eg-sampler.lv2/sampler.c +++ /dev/null @@ -1,552 +0,0 @@ -/* - LV2 Sampler Example Plugin - Copyright 2011-2016 David Robillard - Copyright 2011 Gabriel M. Beddingfield - Copyright 2011 James Morris - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#include -#include -#include -#ifndef __cplusplus -# include -#endif - -#include - -#include "lv2/lv2plug.in/ns/ext/atom/forge.h" -#include "lv2/lv2plug.in/ns/ext/atom/util.h" -#include "lv2/lv2plug.in/ns/ext/log/log.h" -#include "lv2/lv2plug.in/ns/ext/log/logger.h" -#include "lv2/lv2plug.in/ns/ext/midi/midi.h" -#include "lv2/lv2plug.in/ns/ext/patch/patch.h" -#include "lv2/lv2plug.in/ns/ext/state/state.h" -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "lv2/lv2plug.in/ns/ext/worker/worker.h" -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" -#include "lv2/lv2plug.in/ns/lv2core/lv2_util.h" - -#include "uris.h" -#include "atom_sink.h" - -enum { - SAMPLER_CONTROL = 0, - SAMPLER_NOTIFY = 1, - SAMPLER_OUT = 2 -}; - -typedef struct { - SF_INFO info; // Info about sample from sndfile - float* data; // Sample data in float - char* path; // Path of file - uint32_t path_len; // Length of path -} Sample; - -typedef struct { - // Features - LV2_URID_Map* map; - LV2_Worker_Schedule* schedule; - LV2_Log_Logger logger; - - // Forge for creating atoms - LV2_Atom_Forge forge; - - // Ports - const LV2_Atom_Sequence* control_port; - LV2_Atom_Sequence* notify_port; - float* output_port; - - // Forge frame for notify port (for writing worker replies) - LV2_Atom_Forge_Frame notify_frame; - - // URIs - SamplerURIs uris; - - // Playback state - Sample* sample; - uint32_t frame_offset; - float gain; - sf_count_t frame; - bool play; - bool activated; - bool sample_changed; -} Sampler; - -/** - An atom-like message used internally to apply/free samples. - - This is only used internally to communicate with the worker, it is never - sent to the outside world via a port since it is not POD. It is convenient - to use an Atom header so actual atoms can be easily sent through the same - ringbuffer. -*/ -typedef struct { - LV2_Atom atom; - Sample* sample; -} SampleMessage; - -/** - Load a new sample and return it. - - Since this is of course not a real-time safe action, this is called in the - worker thread only. The sample is loaded and returned only, plugin state is - not modified. -*/ -static Sample* -load_sample(LV2_Log_Logger* logger, const char* path) -{ - lv2_log_trace(logger, "Loading %s\n", path); - - const size_t path_len = strlen(path); - Sample* const sample = (Sample*)malloc(sizeof(Sample)); - SF_INFO* const info = &sample->info; - SNDFILE* const sndfile = sf_open(path, SFM_READ, info); - - if (!sndfile || !info->frames || (info->channels != 1)) { - lv2_log_error(logger, "Failed to open sample '%s'\n", path); - free(sample); - return NULL; - } - - // Read data - float* const data = (float*)malloc(sizeof(float) * info->frames); - if (!data) { - lv2_log_error(logger, "Failed to allocate memory for sample\n"); - return NULL; - } - sf_seek(sndfile, 0ul, SEEK_SET); - sf_read_float(sndfile, data, info->frames); - sf_close(sndfile); - - // Fill sample struct and return it - sample->data = data; - sample->path = (char*)malloc(path_len + 1); - sample->path_len = (uint32_t)path_len; - memcpy(sample->path, path, path_len + 1); - - return sample; -} - -static void -free_sample(Sampler* self, Sample* sample) -{ - if (sample) { - lv2_log_trace(&self->logger, "Freeing %s\n", sample->path); - free(sample->path); - free(sample->data); - free(sample); - } -} - -/** - Do work in a non-realtime thread. - - This is called for every piece of work scheduled in the audio thread using - self->schedule->schedule_work(). A reply can be sent back to the audio - thread using the provided respond function. -*/ -static LV2_Worker_Status -work(LV2_Handle instance, - LV2_Worker_Respond_Function respond, - LV2_Worker_Respond_Handle handle, - uint32_t size, - const void* data) -{ - Sampler* self = (Sampler*)instance; - const LV2_Atom* atom = (const LV2_Atom*)data; - if (atom->type == self->uris.eg_freeSample) { - // Free old sample - const SampleMessage* msg = (const SampleMessage*)data; - free_sample(self, msg->sample); - } else if (atom->type == self->forge.Object) { - // Handle set message (load sample). - const LV2_Atom_Object* obj = (const LV2_Atom_Object*)data; - const char* path = read_set_file(&self->uris, obj); - if (!path) { - lv2_log_error(&self->logger, "Malformed set file request\n"); - return LV2_WORKER_ERR_UNKNOWN; - } - - // Load sample. - Sample* sample = load_sample(&self->logger, path); - if (sample) { - // Send new sample to run() to be applied - respond(handle, sizeof(sample), &sample); - } - } - - return LV2_WORKER_SUCCESS; -} - -/** - Handle a response from work() in the audio thread. - - When running normally, this will be called by the host after run(). When - freewheeling, this will be called immediately at the point the work was - scheduled. -*/ -static LV2_Worker_Status -work_response(LV2_Handle instance, - uint32_t size, - const void* data) -{ - Sampler* self = (Sampler*)instance; - Sample* old_sample = self->sample; - Sample* new_sample = *(Sample*const*)data; - - // Install the new sample - self->sample = *(Sample*const*)data; - - // Schedule work to free the old sample - SampleMessage msg = { { sizeof(Sample*), self->uris.eg_freeSample }, - old_sample }; - self->schedule->schedule_work(self->schedule->handle, sizeof(msg), &msg); - - if (strcmp(old_sample->path, new_sample->path)) { - // Send a notification that we're using a new sample - lv2_atom_forge_frame_time(&self->forge, self->frame_offset); - write_set_file(&self->forge, &self->uris, - new_sample->path, - new_sample->path_len); - } - - return LV2_WORKER_SUCCESS; -} - -static void -connect_port(LV2_Handle instance, - uint32_t port, - void* data) -{ - Sampler* self = (Sampler*)instance; - switch (port) { - case SAMPLER_CONTROL: - self->control_port = (const LV2_Atom_Sequence*)data; - break; - case SAMPLER_NOTIFY: - self->notify_port = (LV2_Atom_Sequence*)data; - break; - case SAMPLER_OUT: - self->output_port = (float*)data; - break; - default: - break; - } -} - -static LV2_Handle -instantiate(const LV2_Descriptor* descriptor, - double rate, - const char* path, - const LV2_Feature* const* features) -{ - // Allocate and initialise instance structure. - Sampler* self = (Sampler*)calloc(1, sizeof(Sampler)); - if (!self) { - return NULL; - } - - // Get host features - const char* missing = lv2_features_query( - features, - LV2_LOG__log, &self->logger.log, false, - LV2_URID__map, &self->map, true, - LV2_WORKER__schedule, &self->schedule, true, - NULL); - lv2_log_logger_set_map(&self->logger, self->map); - if (missing) { - lv2_log_error(&self->logger, "Missing feature <%s>\n", missing); - free(self); - return NULL; - } - - // Map URIs and initialise forge - map_sampler_uris(self->map, &self->uris); - lv2_atom_forge_init(&self->forge, self->map); - - return (LV2_Handle)self; -} - -static void -cleanup(LV2_Handle instance) -{ - Sampler* self = (Sampler*)instance; - free_sample(self, self->sample); - free(self); -} - -static void -activate(LV2_Handle instance) -{ - ((Sampler*)instance)->activated = true; -} - -static void -deactivate(LV2_Handle instance) -{ - ((Sampler*)instance)->activated = false; -} - -/** Define a macro for converting a gain in dB to a coefficient. */ -#define DB_CO(g) ((g) > -90.0f ? powf(10.0f, (g) * 0.05f) : 0.0f) - -static void -run(LV2_Handle instance, - uint32_t sample_count) -{ - Sampler* self = (Sampler*)instance; - SamplerURIs* uris = &self->uris; - sf_count_t start_frame = 0; - sf_count_t pos = 0; - float* output = self->output_port; - - // Set up forge to write directly to notify output port. - const uint32_t notify_capacity = self->notify_port->atom.size; - lv2_atom_forge_set_buffer(&self->forge, - (uint8_t*)self->notify_port, - notify_capacity); - - // Start a sequence in the notify output port. - lv2_atom_forge_sequence_head(&self->forge, &self->notify_frame, 0); - - // Send update to UI if sample has changed due to state restore - if (self->sample_changed) { - lv2_atom_forge_frame_time(&self->forge, 0); - write_set_file(&self->forge, &self->uris, - self->sample->path, - self->sample->path_len); - self->sample_changed = false; - } - - // Read incoming events - LV2_ATOM_SEQUENCE_FOREACH(self->control_port, ev) { - self->frame_offset = ev->time.frames; - if (ev->body.type == uris->midi_Event) { - const uint8_t* const msg = (const uint8_t*)(ev + 1); - switch (lv2_midi_message_type(msg)) { - case LV2_MIDI_MSG_NOTE_ON: - start_frame = ev->time.frames; - self->frame = 0; - self->play = true; - break; - default: - break; - } - } else if (lv2_atom_forge_is_object_type(&self->forge, ev->body.type)) { - const LV2_Atom_Object* obj = (const LV2_Atom_Object*)&ev->body; - if (obj->body.otype == uris->patch_Set) { - // Get the property and value of the set message - const LV2_Atom* property = NULL; - const LV2_Atom* value = NULL; - lv2_atom_object_get(obj, - uris->patch_property, &property, - uris->patch_value, &value, - 0); - if (!property) { - lv2_log_error(&self->logger, - "patch:Set message with no property\n"); - continue; - } else if (property->type != uris->atom_URID) { - lv2_log_error(&self->logger, - "patch:Set property is not a URID\n"); - continue; - } - - const uint32_t key = ((const LV2_Atom_URID*)property)->body; - if (key == uris->eg_sample) { - // Sample change, send it to the worker. - lv2_log_trace(&self->logger, "Scheduling sample change\n"); - self->schedule->schedule_work(self->schedule->handle, - lv2_atom_total_size(&ev->body), - &ev->body); - } else if (key == uris->param_gain) { - // Gain change - if (value->type == uris->atom_Float) { - self->gain = DB_CO(((LV2_Atom_Float*)value)->body); - } - } - } else if (obj->body.otype == uris->patch_Get) { - // Received a get message, emit our state (probably to UI) - lv2_atom_forge_frame_time(&self->forge, self->frame_offset); - write_set_file(&self->forge, &self->uris, - self->sample->path, - self->sample->path_len); - } else { - lv2_log_trace(&self->logger, - "Unknown object type %d\n", obj->body.otype); - } - } else { - lv2_log_trace(&self->logger, - "Unknown event type %d\n", ev->body.type); - } - } - - // Render the sample (possibly already in progress) - if (self->play) { - uint32_t f = self->frame; - const uint32_t lf = self->sample->info.frames; - - for (pos = 0; pos < start_frame; ++pos) { - output[pos] = 0; - } - - for (; pos < sample_count && f < lf; ++pos, ++f) { - output[pos] = self->sample->data[f] * self->gain; - } - - self->frame = f; - - if (f == lf) { - self->play = false; - } - } - - // Add zeros to end if sample not long enough (or not playing) - for (; pos < sample_count; ++pos) { - output[pos] = 0.0f; - } -} - -static LV2_State_Status -save(LV2_Handle instance, - LV2_State_Store_Function store, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature* const* features) -{ - Sampler* self = (Sampler*)instance; - if (!self->sample) { - return LV2_STATE_SUCCESS; - } - - LV2_State_Map_Path* map_path = (LV2_State_Map_Path*)lv2_features_data( - features, LV2_STATE__mapPath); - if (!map_path) { - return LV2_STATE_ERR_NO_FEATURE; - } - - // Map absolute sample path to an abstract state path - char* apath = map_path->abstract_path(map_path->handle, self->sample->path); - - // Store eg:sample = abstract path - store(handle, - self->uris.eg_sample, - apath, - strlen(apath) + 1, - self->uris.atom_Path, - LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE); - - free(apath); - return LV2_STATE_SUCCESS; -} - -static LV2_State_Status -restore(LV2_Handle instance, - LV2_State_Retrieve_Function retrieve, - LV2_State_Handle handle, - uint32_t flags, - const LV2_Feature* const* features) -{ - Sampler* self = (Sampler*)instance; - - // Get host features - LV2_Worker_Schedule* schedule = NULL; - LV2_State_Map_Path* paths = NULL; - const char* missing = lv2_features_query( - features, - LV2_STATE__mapPath, &paths, true, - LV2_WORKER__schedule, &schedule, false, - NULL); - if (missing) { - lv2_log_error(&self->logger, "Missing feature <%s>\n", missing); - return LV2_STATE_ERR_NO_FEATURE; - } - - // Get eg:sample from state - size_t size; - uint32_t type; - uint32_t valflags; - const void* value = retrieve(handle, self->uris.eg_sample, - &size, &type, &valflags); - if (!value) { - lv2_log_error(&self->logger, "Missing eg:sample\n"); - return LV2_STATE_ERR_NO_PROPERTY; - } else if (type != self->uris.atom_Path) { - lv2_log_error(&self->logger, "Non-path eg:sample\n"); - return LV2_STATE_ERR_BAD_TYPE; - } - - // Map abstract state path to absolute path - const char* apath = (const char*)value; - char* path = paths->absolute_path(paths->handle, apath); - - // Replace current sample with the new one - if (!self->activated || !schedule) { - // No scheduling available, load sample immediately - lv2_log_trace(&self->logger, "Synchronous restore\n"); - free_sample(self, self->sample); - self->sample = load_sample(&self->logger, path); - self->sample_changed = true; - } else { - // Schedule sample to be loaded by the provided worker - lv2_log_trace(&self->logger, "Scheduling restore\n"); - LV2_Atom_Forge forge; - LV2_Atom* buf = (LV2_Atom*)calloc(1, strlen(path) + 128); - lv2_atom_forge_init(&forge, self->map); - lv2_atom_forge_set_sink(&forge, atom_sink, atom_sink_deref, buf); - write_set_file(&forge, &self->uris, path, strlen(path)); - - const uint32_t msg_size = lv2_atom_pad_size(buf->size); - schedule->schedule_work(self->schedule->handle, msg_size, buf + 1); - free(buf); - } - - return LV2_STATE_SUCCESS; -} - -static const void* -extension_data(const char* uri) -{ - static const LV2_State_Interface state = { save, restore }; - static const LV2_Worker_Interface worker = { work, work_response, NULL }; - if (!strcmp(uri, LV2_STATE__interface)) { - return &state; - } else if (!strcmp(uri, LV2_WORKER__interface)) { - return &worker; - } - return NULL; -} - -static const LV2_Descriptor descriptor = { - EG_SAMPLER_URI, - instantiate, - connect_port, - activate, - run, - deactivate, - cleanup, - extension_data -}; - -LV2_SYMBOL_EXPORT -const LV2_Descriptor* lv2_descriptor(uint32_t index) -{ - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } -} diff --git a/lv2-examples/eg-sampler.lv2/sampler.ttl b/lv2-examples/eg-sampler.lv2/sampler.ttl deleted file mode 100644 index f4a9c43..0000000 --- a/lv2-examples/eg-sampler.lv2/sampler.ttl +++ /dev/null @@ -1,70 +0,0 @@ -@prefix atom: . -@prefix doap: . -@prefix lv2: . -@prefix patch: . -@prefix rdfs: . -@prefix state: . -@prefix ui: . -@prefix urid: . -@prefix work: . -@prefix param: . - - - a lv2:Parameter ; - rdfs:label "sample" ; - rdfs:range atom:Path . - - - a lv2:Plugin ; - doap:name "Example Sampler" ; - doap:license ; - lv2:project ; - lv2:requiredFeature state:loadDefaultState , - urid:map , - work:schedule ; - lv2:optionalFeature lv2:hardRTCapable , - state:threadSafeRestore ; - lv2:extensionData state:interface , - work:interface ; - ui:ui ; - patch:writable , - param:gain ; - lv2:port [ - a lv2:InputPort , - atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports , - patch:Message ; - lv2:designation lv2:control ; - lv2:index 0 ; - lv2:symbol "control" ; - lv2:name "Control" - ] , [ - a lv2:OutputPort , - atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports patch:Message ; - lv2:designation lv2:control ; - lv2:index 1 ; - lv2:symbol "notify" ; - lv2:name "Notify" - ] , [ - a lv2:AudioPort , - lv2:OutputPort ; - lv2:index 2 ; - lv2:symbol "out" ; - lv2:name "Out" - ] ; - state:state [ - - ] . - - - a ui:GtkUI ; - lv2:requiredFeature urid:map ; - lv2:extensionData ui:showInterface ; - ui:portNotification [ - ui:plugin ; - lv2:symbol "notify" ; - ui:notifyType atom:Blank - ] . diff --git a/lv2-examples/eg-sampler.lv2/sampler_ui.c b/lv2-examples/eg-sampler.lv2/sampler_ui.c deleted file mode 100644 index 23204c5..0000000 --- a/lv2-examples/eg-sampler.lv2/sampler_ui.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - LV2 Sampler Example Plugin UI - Copyright 2011-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#include - -#include - -#include "lv2/lv2plug.in/ns/ext/atom/atom.h" -#include "lv2/lv2plug.in/ns/ext/atom/forge.h" -#include "lv2/lv2plug.in/ns/ext/atom/util.h" -#include "lv2/lv2plug.in/ns/ext/log/logger.h" -#include "lv2/lv2plug.in/ns/ext/patch/patch.h" -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "lv2/lv2plug.in/ns/extensions/ui/ui.h" -#include "lv2/lv2plug.in/ns/lv2core/lv2_util.h" - -#include "./uris.h" - -#define SAMPLER_UI_URI "http://lv2plug.in/plugins/eg-sampler#ui" - -typedef struct { - LV2_Atom_Forge forge; - LV2_URID_Map* map; - LV2_Log_Logger logger; - SamplerURIs uris; - - LV2UI_Write_Function write; - LV2UI_Controller controller; - - GtkWidget* box; - GtkWidget* button; - GtkWidget* label; - GtkWidget* window; /* For optional show interface. */ -} SamplerUI; - -static void -on_load_clicked(GtkWidget* widget, - void* handle) -{ - SamplerUI* ui = (SamplerUI*)handle; - - /* Create a dialog to select a sample file. */ - GtkWidget* dialog = gtk_file_chooser_dialog_new( - "Load Sample", - NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - /* Run the dialog, and return if it is cancelled. */ - if (gtk_dialog_run(GTK_DIALOG(dialog)) != GTK_RESPONSE_ACCEPT) { - gtk_widget_destroy(dialog); - return; - } - - /* Get the file path from the dialog. */ - char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - - /* Got what we need, destroy the dialog. */ - gtk_widget_destroy(dialog); - -#define OBJ_BUF_SIZE 1024 - uint8_t obj_buf[OBJ_BUF_SIZE]; - lv2_atom_forge_set_buffer(&ui->forge, obj_buf, OBJ_BUF_SIZE); - - LV2_Atom* msg = (LV2_Atom*)write_set_file(&ui->forge, &ui->uris, - filename, strlen(filename)); - - ui->write(ui->controller, 0, lv2_atom_total_size(msg), - ui->uris.atom_eventTransfer, - msg); - - g_free(filename); -} - -static LV2UI_Handle -instantiate(const LV2UI_Descriptor* descriptor, - const char* plugin_uri, - const char* bundle_path, - LV2UI_Write_Function write_function, - LV2UI_Controller controller, - LV2UI_Widget* widget, - const LV2_Feature* const* features) -{ - SamplerUI* ui = (SamplerUI*)calloc(1, sizeof(SamplerUI)); - if (!ui) { - return NULL; - } - - ui->write = write_function; - ui->controller = controller; - *widget = NULL; - - // Get host features - const char* missing = lv2_features_query( - features, - LV2_LOG__log, &ui->logger.log, false, - LV2_URID__map, &ui->map, true, - NULL); - lv2_log_logger_set_map(&ui->logger, ui->map); - if (missing) { - lv2_log_error(&ui->logger, "Missing feature <%s>\n", missing); - free(ui); - return NULL; - } - - // Map URIs and initialise forge - map_sampler_uris(ui->map, &ui->uris); - lv2_atom_forge_init(&ui->forge, ui->map); - - // Construct Gtk UI - ui->box = gtk_vbox_new(FALSE, 4); - ui->label = gtk_label_new("?"); - ui->button = gtk_button_new_with_label("Load Sample"); - gtk_box_pack_start(GTK_BOX(ui->box), ui->label, TRUE, TRUE, 4); - gtk_box_pack_start(GTK_BOX(ui->box), ui->button, FALSE, FALSE, 4); - g_signal_connect(ui->button, "clicked", - G_CALLBACK(on_load_clicked), - ui); - - // Request state (filename) from plugin - uint8_t get_buf[512]; - lv2_atom_forge_set_buffer(&ui->forge, get_buf, sizeof(get_buf)); - - LV2_Atom_Forge_Frame frame; - LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object( - &ui->forge, &frame, 0, ui->uris.patch_Get); - lv2_atom_forge_pop(&ui->forge, &frame); - - ui->write(ui->controller, 0, lv2_atom_total_size(msg), - ui->uris.atom_eventTransfer, - msg); - - *widget = ui->box; - - return ui; -} - -static void -cleanup(LV2UI_Handle handle) -{ - SamplerUI* ui = (SamplerUI*)handle; - gtk_widget_destroy(ui->button); - free(ui); -} - -static void -port_event(LV2UI_Handle handle, - uint32_t port_index, - uint32_t buffer_size, - uint32_t format, - const void* buffer) -{ - SamplerUI* ui = (SamplerUI*)handle; - if (format == ui->uris.atom_eventTransfer) { - const LV2_Atom* atom = (const LV2_Atom*)buffer; - if (lv2_atom_forge_is_object_type(&ui->forge, atom->type)) { - const LV2_Atom_Object* obj = (const LV2_Atom_Object*)atom; - const char* uri = read_set_file(&ui->uris, obj); - if (uri) { - gtk_label_set_text(GTK_LABEL(ui->label), uri); - } else { - lv2_log_warning(&ui->logger, "Malformed message\n"); - } - } else { - lv2_log_error(&ui->logger, "Unknown message type\n"); - } - } else { - lv2_log_warning(&ui->logger, "Unknown port event format\n"); - } -} - -/* Optional non-embedded UI show interface. */ -static int -ui_show(LV2UI_Handle handle) -{ - SamplerUI* ui = (SamplerUI*)handle; - - int argc = 0; - gtk_init(&argc, NULL); - - ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_container_add(GTK_CONTAINER(ui->window), ui->box); - gtk_widget_show_all(ui->window); - gtk_window_present(GTK_WINDOW(ui->window)); - - return 0; -} - -/* Optional non-embedded UI hide interface. */ -static int -ui_hide(LV2UI_Handle handle) -{ - return 0; -} - -/* Idle interface for optional non-embedded UI. */ -static int -ui_idle(LV2UI_Handle handle) -{ - SamplerUI* ui = (SamplerUI*)handle; - if (ui->window) { - gtk_main_iteration(); - } - return 0; -} - -static const void* -extension_data(const char* uri) -{ - static const LV2UI_Show_Interface show = { ui_show, ui_hide }; - static const LV2UI_Idle_Interface idle = { ui_idle }; - if (!strcmp(uri, LV2_UI__showInterface)) { - return &show; - } else if (!strcmp(uri, LV2_UI__idleInterface)) { - return &idle; - } - return NULL; -} - -static const LV2UI_Descriptor descriptor = { - SAMPLER_UI_URI, - instantiate, - cleanup, - port_event, - extension_data -}; - -LV2_SYMBOL_EXPORT -const LV2UI_Descriptor* -lv2ui_descriptor(uint32_t index) -{ - switch (index) { - case 0: - return &descriptor; - default: - return NULL; - } -} diff --git a/lv2-examples/eg-sampler.lv2/uris.h b/lv2-examples/eg-sampler.lv2/uris.h deleted file mode 100644 index ceeddc0..0000000 --- a/lv2-examples/eg-sampler.lv2/uris.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - LV2 Sampler Example Plugin - Copyright 2011-2016 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef SAMPLER_URIS_H -#define SAMPLER_URIS_H - -#include "lv2/lv2plug.in/ns/ext/log/log.h" -#include "lv2/lv2plug.in/ns/ext/midi/midi.h" -#include "lv2/lv2plug.in/ns/ext/state/state.h" -#include "lv2/lv2plug.in/ns/ext/parameters/parameters.h" - -#define EG_SAMPLER_URI "http://lv2plug.in/plugins/eg-sampler" -#define EG_SAMPLER__sample EG_SAMPLER_URI "#sample" -#define EG_SAMPLER__applySample EG_SAMPLER_URI "#applySample" -#define EG_SAMPLER__freeSample EG_SAMPLER_URI "#freeSample" - -typedef struct { - LV2_URID atom_Float; - LV2_URID atom_Path; - LV2_URID atom_Resource; - LV2_URID atom_Sequence; - LV2_URID atom_URID; - LV2_URID atom_eventTransfer; - LV2_URID eg_applySample; - LV2_URID eg_sample; - LV2_URID eg_freeSample; - LV2_URID midi_Event; - LV2_URID param_gain; - LV2_URID patch_Get; - LV2_URID patch_Set; - LV2_URID patch_property; - LV2_URID patch_value; -} SamplerURIs; - -static inline void -map_sampler_uris(LV2_URID_Map* map, SamplerURIs* uris) -{ - uris->atom_Float = map->map(map->handle, LV2_ATOM__Float); - uris->atom_Path = map->map(map->handle, LV2_ATOM__Path); - uris->atom_Resource = map->map(map->handle, LV2_ATOM__Resource); - uris->atom_Sequence = map->map(map->handle, LV2_ATOM__Sequence); - uris->atom_URID = map->map(map->handle, LV2_ATOM__URID); - uris->atom_eventTransfer = map->map(map->handle, LV2_ATOM__eventTransfer); - uris->eg_applySample = map->map(map->handle, EG_SAMPLER__applySample); - uris->eg_freeSample = map->map(map->handle, EG_SAMPLER__freeSample); - uris->eg_sample = map->map(map->handle, EG_SAMPLER__sample); - uris->midi_Event = map->map(map->handle, LV2_MIDI__MidiEvent); - uris->param_gain = map->map(map->handle, LV2_PARAMETERS__gain); - uris->patch_Get = map->map(map->handle, LV2_PATCH__Get); - uris->patch_Set = map->map(map->handle, LV2_PATCH__Set); - uris->patch_property = map->map(map->handle, LV2_PATCH__property); - uris->patch_value = map->map(map->handle, LV2_PATCH__value); -} - -/** - * Write a message like the following to @p forge: - * [] - * a patch:Set ; - * patch:property eg:sample ; - * patch:value . - */ -static inline LV2_Atom_Forge_Ref -write_set_file(LV2_Atom_Forge* forge, - const SamplerURIs* uris, - const char* filename, - const uint32_t filename_len) -{ - LV2_Atom_Forge_Frame frame; - LV2_Atom_Forge_Ref set = lv2_atom_forge_object( - forge, &frame, 0, uris->patch_Set); - - lv2_atom_forge_key(forge, uris->patch_property); - lv2_atom_forge_urid(forge, uris->eg_sample); - lv2_atom_forge_key(forge, uris->patch_value); - lv2_atom_forge_path(forge, filename, filename_len); - - lv2_atom_forge_pop(forge, &frame); - return set; -} - -/** - * Get the file path from a message like: - * [] - * a patch:Set ; - * patch:property eg:sample ; - * patch:value . - */ -static inline const char* -read_set_file(const SamplerURIs* uris, - const LV2_Atom_Object* obj) -{ - if (obj->body.otype != uris->patch_Set) { - fprintf(stderr, "Ignoring unknown message type %d\n", obj->body.otype); - return NULL; - } - - /* Get property URI. */ - const LV2_Atom* property = NULL; - lv2_atom_object_get(obj, uris->patch_property, &property, 0); - if (!property) { - fprintf(stderr, "Malformed set message has no body.\n"); - return NULL; - } else if (property->type != uris->atom_URID) { - fprintf(stderr, "Malformed set message has non-URID property.\n"); - return NULL; - } else if (((const LV2_Atom_URID*)property)->body != uris->eg_sample) { - fprintf(stderr, "Set message for unknown property.\n"); - return NULL; - } - - /* Get value. */ - const LV2_Atom* value = NULL; - lv2_atom_object_get(obj, uris->patch_value, &value, 0); - if (!value) { - fprintf(stderr, "Malformed set message has no value.\n"); - return NULL; - } else if (value->type != uris->atom_Path) { - fprintf(stderr, "Set message value is not a Path.\n"); - return NULL; - } - - return (const char*)LV2_ATOM_BODY_CONST(value); -} - -#endif /* SAMPLER_URIS_H */ diff --git a/lv2-examples/eg-sampler.lv2/waf b/lv2-examples/eg-sampler.lv2/waf deleted file mode 120000 index 59a1ac9..0000000 --- a/lv2-examples/eg-sampler.lv2/waf +++ /dev/null @@ -1 +0,0 @@ -../../waf \ No newline at end of file diff --git a/lv2-examples/eg-sampler.lv2/wscript b/lv2-examples/eg-sampler.lv2/wscript deleted file mode 100644 index 3032953..0000000 --- a/lv2-examples/eg-sampler.lv2/wscript +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -from waflib.extras import autowaf as autowaf -import re - -# Variables for 'waf dist' -APPNAME = 'eg-sampler.lv2' -VERSION = '1.0.0' - -# Mandatory variables -top = '.' -out = 'build' - -def options(opt): - opt.load('compiler_c') - opt.load('lv2') - autowaf.set_options(opt) - -def configure(conf): - conf.load('compiler_c') - conf.load('lv2') - autowaf.configure(conf) - autowaf.set_c99_mode(conf) - autowaf.display_header('Sampler Configuration') - - if not autowaf.is_child(): - autowaf.check_pkg(conf, 'lv2', atleast_version='1.2.1', uselib_store='LV2') - - autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', - atleast_version='1.0.0', mandatory=True) - autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK2', - atleast_version='2.18.0', mandatory=False) - conf.check(features='c cshlib', lib='m', uselib_store='M', mandatory=False) - - autowaf.display_msg(conf, 'LV2 bundle directory', conf.env.LV2DIR) - print('') - -def build(bld): - bundle = 'eg-sampler.lv2' - - # Make a pattern for shared objects without the 'lib' prefix - module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN) - module_ext = module_pat[module_pat.rfind('.'):] - - # Build manifest.ttl by substitution (for portable lib extension) - bld(features = 'subst', - source = 'manifest.ttl.in', - target = '%s/%s' % (bundle, 'manifest.ttl'), - install_path = '${LV2DIR}/%s' % bundle, - LIB_EXT = module_ext) - - # Copy other data files to build bundle (build/eg-sampler.lv2) - for i in ['sampler.ttl', 'click.wav']: - bld(features = 'subst', - is_copy = True, - source = i, - target = '%s/%s' % (bundle, i), - install_path = '${LV2DIR}/%s' % bundle) - - # Use LV2 headers from parent directory if building as a sub-project - includes = ['.'] - if autowaf.is_child: - includes += ['../..'] - - # Build plugin library - obj = bld(features = 'c cshlib', - source = 'sampler.c', - name = 'sampler', - target = '%s/sampler' % bundle, - install_path = '${LV2DIR}/%s' % bundle, - use = ['M', 'SNDFILE', 'LV2'], - includes = includes) - obj.env.cshlib_PATTERN = module_pat - - # Build UI library - if bld.env.HAVE_GTK2: - obj = bld(features = 'c cshlib', - source = 'sampler_ui.c', - name = 'sampler_ui', - target = '%s/sampler_ui' % bundle, - install_path = '${LV2DIR}/%s' % bundle, - use = ['GTK2', 'LV2'], - includes = includes) - obj.env.cshlib_PATTERN = module_pat diff --git a/lv2/Dexed.ttl b/lv2/Dexed.ttl deleted file mode 100644 index f175fa3..0000000 --- a/lv2/Dexed.ttl +++ /dev/null @@ -1,1536 +0,0 @@ -@prefix atom: . -@prefix doap: . -@prefix foaf: . -@prefix lv2: . -@prefix rdfs: . -@prefix ui: . - - - a lv2:InstrumentPlugin, lv2:Plugin ; - lv2:requiredFeature , - ; - lv2:extensionData , - , - ; - - ui:ui , - ; - - lv2:port [ - a lv2:InputPort, atom:AtomPort ; - atom:bufferType atom:Sequence ; - atom:supports ; - lv2:index 0 ; - lv2:symbol "lv2_events_in" ; - lv2:name "Events Input" ; - lv2:designation lv2:control ; - ] ; - - lv2:port [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 1 ; - lv2:symbol "lv2_freewheel" ; - lv2:name "Freewheel" ; - lv2:default 0.0 ; - lv2:minimum 0.0 ; - lv2:maximum 1.0 ; - lv2:designation ; - lv2:portProperty lv2:toggled, ; - ] , - [ - a lv2:OutputPort, lv2:ControlPort ; - lv2:index 2 ; - lv2:symbol "lv2_latency" ; - lv2:name "Latency" ; - lv2:designation ; - lv2:portProperty lv2:reportsLatency, lv2:integer ; - ] ; - - lv2:port [ - a lv2:OutputPort, lv2:AudioPort ; - lv2:index 3 ; - lv2:symbol "lv2_audio_out_1" ; - lv2:name "Audio Output 1" ; - ] ; - - lv2:port [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 4 ; - lv2:symbol "cutoff" ; - lv2:name "Cutoff" ; - lv2:default 1.000000 ; - lv2:minimum 0.0 ; - lv2:maximum 1.0 ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 5 ; - lv2:symbol "resonance" ; - lv2:name "Resonance" ; - lv2:default 0.000000 ; - lv2:minimum 0.0 ; - lv2:maximum 1.0 ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 6 ; - lv2:symbol "output" ; - lv2:name "Output" ; - lv2:default 1.000000 ; - lv2:minimum 0.0 ; - lv2:maximum 1.0 ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 7 ; - lv2:symbol "algorithm" ; - lv2:name "ALGORITHM" ; - lv2:default 1 ; - lv2:minimum 1 ; - lv2:maximum 32 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 8 ; - lv2:symbol "feedback" ; - lv2:name "FEEDBACK" ; - lv2:default 1 ; - lv2:minimum 1 ; - lv2:maximum 8 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 9 ; - lv2:symbol "osc_key_sync" ; - lv2:name "OSC KEY SYNC" ; - lv2:default 0 ; - lv2:minimum 1 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 10 ; - lv2:symbol "lfo_speed" ; - lv2:name "LFO SPEED" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 11 ; - lv2:symbol "lfo_delay" ; - lv2:name "LFO DELAY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 12 ; - lv2:symbol "lfo_pm_depth" ; - lv2:name "LFO PM DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 13 ; - lv2:symbol "lfo_am_depth" ; - lv2:name "LFO AM DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 14 ; - lv2:symbol "lfo_key_sync" ; - lv2:name "LFO KEY SYNC" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 15 ; - lv2:symbol "lfo_wave" ; - lv2:name "LFO WAVE" ; - lv2:default 1 ; - lv2:minimum 1 ; - lv2:maximum 6 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 16 ; - lv2:symbol "middle_c" ; - lv2:name "MIDDLE C" ; - lv2:default 24 ; - lv2:minimum 0 ; - lv2:maximum 48 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 17 ; - lv2:symbol "p_mode_sens_" ; - lv2:name "P MODE SENS." ; - lv2:default 1 ; - lv2:minimum 1 ; - lv2:maximum 8 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 18 ; - lv2:symbol "pitch_eg_rate_1" ; - lv2:name "PITCH EG RATE 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 19 ; - lv2:symbol "pitch_eg_rate_2" ; - lv2:name "PITCH EG RATE 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 20 ; - lv2:symbol "pitch_eg_rate_3" ; - lv2:name "PITCH EG RATE 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 21 ; - lv2:symbol "pitch_eg_rate_4" ; - lv2:name "PITCH EG RATE 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 22 ; - lv2:symbol "pitch_eg_level_1" ; - lv2:name "PITCH EG LEVEL 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 23 ; - lv2:symbol "pitch_eg_level_2" ; - lv2:name "PITCH EG LEVEL 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 24 ; - lv2:symbol "pitch_eg_level_3" ; - lv2:name "PITCH EG LEVEL 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 25 ; - lv2:symbol "pitch_eg_level_4" ; - lv2:name "PITCH EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 26 ; - lv2:symbol "op1_eg_rate_1" ; - lv2:name "OP1 EG RATE 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 27 ; - lv2:symbol "op1_eg_rate_2" ; - lv2:name "OP1 EG RATE 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 28 ; - lv2:symbol "op1_eg_rate_3" ; - lv2:name "OP1 EG RATE 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 29 ; - lv2:symbol "op1_eg_rate_4" ; - lv2:name "OP1 EG RATE 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 30 ; - lv2:symbol "op1_eg_level_1" ; - lv2:name "OP1 EG LEVEL 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 31 ; - lv2:symbol "op1_eg_level_2" ; - lv2:name "OP1 EG LEVEL 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 32 ; - lv2:symbol "op1_eg_level_3" ; - lv2:name "OP1 EG LEVEL 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 33 ; - lv2:symbol "op1_eg_level_4" ; - lv2:name "OP1 EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 34 ; - lv2:symbol "op1_output_level" ; - lv2:name "OP1 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 35 ; - lv2:symbol "op1_mode" ; - lv2:name "OP1 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 36 ; - lv2:symbol "op1_f_coarse" ; - lv2:name "OP1 F COARSE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 37 ; - lv2:symbol "op1_f_fine" ; - lv2:name "OP1 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 38 ; - lv2:symbol "op1_osc_detune" ; - lv2:name "OP1 OSC DETUNE" ; - lv2:default 0 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 39 ; - lv2:symbol "op1_break_point" ; - lv2:name "OP1 BREAK POINT" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 40 ; - lv2:symbol "op1_l_scale_depth" ; - lv2:name "OP1 L SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 41 ; - lv2:symbol "op1_r_scale_depth" ; - lv2:name "OP1 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 42 ; - lv2:symbol "op1_l_key_scale" ; - lv2:name "OP1 L KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 43 ; - lv2:symbol "op1_r_key_scale" ; - lv2:name "OP1 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 44 ; - lv2:symbol "op1_rate_scaling" ; - lv2:name "OP1 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 45 ; - lv2:symbol "op1_a_mod_sens_" ; - lv2:name "OP1 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 46 ; - lv2:symbol "op1_key_velocity" ; - lv2:name "OP1 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 47 ; - lv2:symbol "op2_eg_rate_1" ; - lv2:name "OP2 EG RATE 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 48 ; - lv2:symbol "op2_eg_rate_2" ; - lv2:name "OP2 EG RATE 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 49 ; - lv2:symbol "op2_eg_rate_3" ; - lv2:name "OP2 EG RATE 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 50 ; - lv2:symbol "op2_eg_rate_4" ; - lv2:name "OP2 EG RATE 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 51 ; - lv2:symbol "op2_eg_level_1" ; - lv2:name "OP2 EG LEVEL 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 52 ; - lv2:symbol "op2_eg_level_2" ; - lv2:name "OP2 EG LEVEL 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 53 ; - lv2:symbol "op2_eg_level_3" ; - lv2:name "OP2 EG LEVEL 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 54 ; - lv2:symbol "op2_eg_level_4" ; - lv2:name "OP2 EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 55 ; - lv2:symbol "op2_output_level" ; - lv2:name "OP2 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 56 ; - lv2:symbol "op2_mode" ; - lv2:name "OP2 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 57 ; - lv2:symbol "op2_f_coarse" ; - lv2:name "OP2 F COARSE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 58 ; - lv2:symbol "op2_f_fine" ; - lv2:name "OP2 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 100 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 59 ; - lv2:symbol "op2_osc_detune" ; - lv2:name "OP2 OSC DETUNE" ; - lv2:default 0 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 60 ; - lv2:symbol "op2_break_point" ; - lv2:name "OP2 BREAK POINT" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 100 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 61 ; - lv2:symbol "op2_l_scale_depth" ; - lv2:name "OP2 L SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 100 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 62 ; - lv2:symbol "op2_r_scale_depth" ; - lv2:name "OP2 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 100 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 63 ; - lv2:symbol "op2_l_key_scale" ; - lv2:name "OP2 L KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 64 ; - lv2:symbol "op2_r_key_scale" ; - lv2:name "OP2 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 65 ; - lv2:symbol "op2_rate_scaling" ; - lv2:name "OP2 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 66 ; - lv2:symbol "op2_a_mod_sens_" ; - lv2:name "OP2 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 67 ; - lv2:symbol "op2_key_velocity" ; - lv2:name "OP2 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 68 ; - lv2:symbol "op3_eg_rate_1" ; - lv2:name "OP3 EG RATE 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 69 ; - lv2:symbol "op3_eg_rate_2" ; - lv2:name "OP3 EG RATE 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 70 ; - lv2:symbol "op3_eg_rate_3" ; - lv2:name "OP3 EG RATE 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 71 ; - lv2:symbol "op3_eg_rate_4" ; - lv2:name "OP3 EG RATE 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 72 ; - lv2:symbol "op3_eg_level_1" ; - lv2:name "OP3 EG LEVEL 1" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 73 ; - lv2:symbol "op3_eg_level_2" ; - lv2:name "OP3 EG LEVEL 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 74 ; - lv2:symbol "op3_eg_level_3" ; - lv2:name "OP3 EG LEVEL 3" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 75 ; - lv2:symbol "op3_eg_level_4" ; - lv2:name "OP3 EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 76 ; - lv2:symbol "op3_output_level" ; - lv2:name "OP3 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 77 ; - lv2:symbol "op3_mode" ; - lv2:name "OP3 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 78 ; - lv2:symbol "op3_f_coarse" ; - lv2:name "OP3 F COARSE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 79 ; - lv2:symbol "op3_f_fine" ; - lv2:name "OP3 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 80 ; - lv2:symbol "op3_osc_detune" ; - lv2:name "OP3 OSC DETUNE" ; - lv2:default 0 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 81 ; - lv2:symbol "op3_break_point" ; - lv2:name "OP3 BREAK POINT" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 82 ; - lv2:symbol "op3_l_scale_depth" ; - lv2:name "OP3 L SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 83 ; - lv2:symbol "op3_r_scale_depth" ; - lv2:name "OP3 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 84 ; - lv2:symbol "op3_l_key_scale" ; - lv2:name "OP3 L KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 85 ; - lv2:symbol "op3_r_key_scale" ; - lv2:name "OP3 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 86 ; - lv2:symbol "op3_rate_scaling" ; - lv2:name "OP3 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 87 ; - lv2:symbol "op3_a_mod_sens_" ; - lv2:name "OP3 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 88 ; - lv2:symbol "op3_key_velocity" ; - lv2:name "OP3 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 89 ; - lv2:symbol "op4_eg_rate_1" ; - lv2:name "OP4 EG RATE 1" ; - lv2:default 1 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 90 ; - lv2:symbol "op4_eg_rate_2" ; - lv2:name "OP4 EG RATE 2" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 91 ; - lv2:symbol "op4_eg_rate_3" ; - lv2:name "OP4 EG RATE 3" ; - lv2:default 7 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 92 ; - lv2:symbol "op4_eg_rate_4" ; - lv2:name "OP4 EG RATE 4" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 93 ; - lv2:symbol "op4_eg_level_1" ; - lv2:name "OP4 EG LEVEL 1" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 94 ; - lv2:symbol "op4_eg_level_2" ; - lv2:name "OP4 EG LEVEL 2" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 95 ; - lv2:symbol "op4_eg_level_3" ; - lv2:name "OP4 EG LEVEL 3" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 96 ; - lv2:symbol "op4_eg_level_4" ; - lv2:name "OP4 EG LEVEL 4" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 97 ; - lv2:symbol "op4_output_level" ; - lv2:name "OP4 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 98 ; - lv2:symbol "op4_mode" ; - lv2:name "OP4 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 99 ; - lv2:symbol "op4_f_coarse" ; - lv2:name "OP4 F COARSE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 100 ; - lv2:symbol "op4_f_fine" ; - lv2:name "OP4 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 101 ; - lv2:symbol "op4_osc_detune" ; - lv2:name "OP4 OSC DETUNE" ; - lv2:default 0 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 102 ; - lv2:symbol "op4_break_point" ; - lv2:name "OP4 BREAK POINT" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 103 ; - lv2:symbol "op4_l_scale_depth" ; - lv2:name "OP4 L SCALE DEPTH" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 104 ; - lv2:symbol "op4_r_scale_depth" ; - lv2:name "OP4 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 105 ; - lv2:symbol "op4_l_key_scale" ; - lv2:name "OP4 L KEY SCALE" ; - lv2:default 39 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 106 ; - lv2:symbol "op4_r_key_scale" ; - lv2:name "OP4 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 107 ; - lv2:symbol "op4_rate_scaling" ; - lv2:name "OP4 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 108 ; - lv2:symbol "op4_a_mod_sens_" ; - lv2:name "OP4 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 109 ; - lv2:symbol "op4_key_velocity" ; - lv2:name "OP4 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 110 ; - lv2:symbol "op5_eg_rate_1" ; - lv2:name "OP5 EG RATE 1" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 111 ; - lv2:symbol "op5_eg_rate_2" ; - lv2:name "OP5 EG RATE 2" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 112 ; - lv2:symbol "op5_eg_rate_3" ; - lv2:name "OP5 EG RATE 3" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 113 ; - lv2:symbol "op5_eg_rate_4" ; - lv2:name "OP5 EG RATE 4" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 114 ; - lv2:symbol "op5_eg_level_1" ; - lv2:name "OP5 EG LEVEL 1" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 115 ; - lv2:symbol "op5_eg_level_2" ; - lv2:name "OP5 EG LEVEL 2" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 116 ; - lv2:symbol "op5_eg_level_3" ; - lv2:name "OP5 EG LEVEL 3" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 117 ; - lv2:symbol "op5_eg_level_4" ; - lv2:name "OP5 EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 118 ; - lv2:symbol "op5_output_level" ; - lv2:name "OP5 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 119 ; - lv2:symbol "op5_mode" ; - lv2:name "OP5 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 120 ; - lv2:symbol "op5_f_coarse" ; - lv2:name "OP5 F COARSE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 121 ; - lv2:symbol "op5_f_fine" ; - lv2:name "OP5 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 122 ; - lv2:symbol "op5_osc_detune" ; - lv2:name "OP5 OSC DETUNE" ; - lv2:default 0 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 123 ; - lv2:symbol "op5_break_point" ; - lv2:name "OP5 BREAK POINT" ; - lv2:default 39 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 124 ; - lv2:symbol "op5_l_scale_depth" ; - lv2:name "OP5 L SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 125 ; - lv2:symbol "op5_r_scale_depth" ; - lv2:name "OP5 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 126 ; - lv2:symbol "op5_l_key_scale" ; - lv2:name "OP5 L KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 127 ; - lv2:symbol "op5_r_key_scale" ; - lv2:name "OP5 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 128 ; - lv2:symbol "op5_rate_scaling" ; - lv2:name "OP5 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 129 ; - lv2:symbol "op5_a_mod_sens_" ; - lv2:name "OP5 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 130 ; - lv2:symbol "op5_key_velocity" ; - lv2:name "OP5 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 131 ; - lv2:symbol "op6_eg_rate_1" ; - lv2:name "OP6 EG RATE 1" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 132 ; - lv2:symbol "op6_eg_rate_2" ; - lv2:name "OP6 EG RATE 2" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 133 ; - lv2:symbol "op6_eg_rate_3" ; - lv2:name "OP6 EG RATE 3" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 134 ; - lv2:symbol "op6_eg_rate_4" ; - lv2:name "OP6 EG RATE 4" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 135 ; - lv2:symbol "op6_eg_level_1" ; - lv2:name "OP6 EG LEVEL 1" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 136 ; - lv2:symbol "op6_eg_level_2" ; - lv2:name "OP6 EG LEVEL 2" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 137 ; - lv2:symbol "op6_eg_level_3" ; - lv2:name "OP6 EG LEVEL 3" ; - lv2:default 99 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 138 ; - lv2:symbol "op6_eg_level_4" ; - lv2:name "OP6 EG LEVEL 4" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 139 ; - lv2:symbol "op6_output_level" ; - lv2:name "OP6 OUTPUT LEVEL" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 140 ; - lv2:symbol "op6_mode" ; - lv2:name "OP6 MODE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 1 ; - lv2:portProperty lv2:toggled, lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 141 ; - lv2:symbol "op6_f_coarse" ; - lv2:name "OP6 F COARSE" ; - lv2:default 1 ; - lv2:minimum 0 ; - lv2:maximum 31 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 142 ; - lv2:symbol "op6_f_fine" ; - lv2:name "OP6 F FINE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 143 ; - lv2:symbol "op6_osc_detune" ; - lv2:name "OP6 OSC DETUNE" ; - lv2:default 7 ; - lv2:minimum -7 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 144 ; - lv2:symbol "op6_break_point" ; - lv2:name "OP6 BREAK POINT" ; - lv2:default 39 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 145 ; - lv2:symbol "op6_l_scale_depth" ; - lv2:name "OP6 L SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 146 ; - lv2:symbol "op6_r_scale_depth" ; - lv2:name "OP6 R SCALE DEPTH" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 99 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 147 ; - lv2:symbol "op6_l_key_scale" ; - lv2:name "OP6 L KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 148 ; - lv2:symbol "op6_r_key_scale" ; - lv2:name "OP6 R KEY SCALE" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 149 ; - lv2:symbol "op6_rate_scaling" ; - lv2:name "OP6 RATE SCALING" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 150 ; - lv2:symbol "op6_a_mod_sens_" ; - lv2:name "OP6 A MOD SENS." ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 3 ; - lv2:portProperty lv2:integer ; - ] , - [ - a lv2:InputPort, lv2:ControlPort ; - lv2:index 151 ; - lv2:symbol "op6_key_velocity" ; - lv2:name "OP6 KEY VELOCITY" ; - lv2:default 0 ; - lv2:minimum 0 ; - lv2:maximum 7 ; - lv2:portProperty lv2:integer ; - ] ; - - doap:name "Dexed" ; - doap:maintainer [ foaf:name "Digital Suburban" ] . - diff --git a/lv2/manifest.ttl b/lv2/manifest.ttl deleted file mode 100644 index 79c69e7..0000000 --- a/lv2/manifest.ttl +++ /dev/null @@ -1,26 +0,0 @@ -@prefix lv2: . -@prefix pset: . -@prefix rdfs: . -@prefix ui: . -@prefix mdap: . -@prefix pset: . - - - a lv2:Plugin ; - lv2:binary ; - rdfs:seeAlso . - - - a ; - ui:binary ; - lv2:requiredFeature ; - lv2:extensionData . - - - a ui:X11UI ; - ui:binary ; - lv2:requiredFeature ; - lv2:optionalFeature ui:noUserResize ; - lv2:extensionData . - - diff --git a/src/dexed.cpp b/src/dexed.cpp index 649549e..9e49e3f 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -10,8 +10,6 @@ #include "msfa/freqlut.h" #include "msfa/controllers.h" #include "PluginFx.h" -#include -#include Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) { @@ -24,13 +22,9 @@ Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) Tanh::init(); Sin::init(); - currentNote = -1; - engineType = -1; - monoMode = 0; normalizeDxVelocity = false; memset(&voiceStatus, 0, sizeof(VoiceStatus)); - setEngineType(DEXED_ENGINE_MARKI); Freqlut::init(rate); Lfo::init(rate); @@ -52,6 +46,9 @@ Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) controllers.breath_cc = 0; controllers.aftertouch_cc = 0; + setEngineType(DEXED_ENGINE_MARKI); + setMonoMode(false); + sustain = false; lfo.reset(data + 137); @@ -90,17 +87,11 @@ void Dexed::set_params(void) { // Dexed-Unisono if(isMonoMode()!=int(*p(p_unisono))) - { - panic(); setMonoMode(int(*p(p_unisono))); - } // Dexed-Engine - if(getEngineType()!=int(*p(p_engine))) - { - panic(); - setEngineType(int(*p(p_engine))); - } + if(getEngineType()!=int(*p(p_engine))-1) + setEngineType(int(*p(p_engine))-1); // Dexed-Filter if(fx.uiCutoff!=*p(p_cutoff)) @@ -335,20 +326,19 @@ void Dexed::run (uint32_t sample_count) void Dexed::GetSamples(int n_samples, float *buffer) { int i; - VoiceStatus vs; for(i=0;i < MAX_ACTIVE_NOTES;i++) { if(voices[i].live==true &&voices[i].keydown==false) { uint8_t op_amp=0; - voices[i].dx7_note->peekVoiceStatus(vs); + voices[i].dx7_note->peekVoiceStatus(voiceStatus); for(int op=0;op<6;op++) { - TRACE("Voice[%2d] OP [%d] amp=%ld,amp_step=%d,pitch_step=%d",i,op,vs.amp[op],vs.ampStep[op],vs.pitchStep); + TRACE("Voice[%2d] OP [%d] amp=%ld,amp_step=%d,pitch_step=%d",i,op,voiceStatus.amp[op],voiceStatus.ampStep[op],voiceStatus.pitchStep); - if(vs.amp[op]<=1069) + if(voiceStatus.amp[op]<=1069) op_amp++; } @@ -467,8 +457,8 @@ bool Dexed::ProcessMidiMessage(const uint8_t *buf, int buf_size) { } break; } + return(true); } - return(true); case 0xc0 : //setCurrentProgram(buf[1]); @@ -607,9 +597,13 @@ int Dexed::getEngineType() { return engineType; } -void Dexed::setEngineType(int tp) { +void Dexed::setEngineType(uint8_t tp) { TRACE("settings engine %d", tp); - + + if(engineType==tp) + return; + + panic(); switch (tp) { case DEXED_ENGINE_MARKI: controllers.core = &engineMkI; @@ -632,6 +626,9 @@ bool Dexed::isMonoMode(void) { } void Dexed::setMonoMode(bool mode) { + if(monoMode==mode) + return; + monoMode = mode; } diff --git a/src/dexed.h b/src/dexed.h index 4b1e4a9..d8baee2 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -43,9 +43,9 @@ struct ProcessorVoice { }; enum DexedEngineResolution { - DEXED_ENGINE_MODERN, - DEXED_ENGINE_MARKI, - DEXED_ENGINE_OPL + DEXED_ENGINE_MODERN, // 0 + DEXED_ENGINE_MARKI, // 1 + DEXED_ENGINE_OPL // 2 }; // GLOBALS @@ -77,7 +77,7 @@ class Dexed : public lvtk::Synth ~Dexed(); void run(uint32_t sample_count); int getEngineType(); - void setEngineType(int rs); + void setEngineType(uint8_t tp); bool isMonoMode(void); void setMonoMode(bool mode); void set_params(void); @@ -101,7 +101,7 @@ class Dexed : public lvtk::Synth bool monoMode; bool refreshVoice; bool normalizeDxVelocity; - uint32_t engineType; + uint8_t engineType; int feedback_bitdepth; long lastStateSave; PluginFx fx;