From 655870dad89082ad5f17384784e8b807d539e96e Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 26 Sep 2016 16:57:39 +0000 Subject: [PATCH] Changed lv2-c++-tools againts lvtk, becuase of needed atom support. --- 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 | 5 +- lv2-examples/beep/beep.cpp | 112 +++++++++++------- lv2-examples/beep/beep.ttl | 102 +++++++++------- lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl | 102 +++++++++------- .../beep/lv2pftci-beep.lv2/manifest.ttl | 49 +++++++- lv2-examples/beep/manifest.ttl | 49 +++++++- .../{beep2 => beep2.lv2tools}/Makefile | 2 +- .../{beep2 => beep2.lv2tools}/beep.cpp | 0 .../{beep2 => beep2.lv2tools}/beep.peg | 0 .../{beep2 => beep2.lv2tools}/beep2.ttl | 0 .../lv2pftci-beep2.lv2/beep2.ttl | 0 .../lv2pftci-beep2.lv2/manifest.ttl | 0 .../{beep2 => beep2.lv2tools}/manifest.ttl | 0 src/Makefile | 6 +- src/dexed.cpp | 10 +- src/dexed.h | 4 +- 23 files changed, 518 insertions(+), 149 deletions(-) create mode 100644 lv2-examples/beep.lv2tools/Makefile create mode 100644 lv2-examples/beep.lv2tools/beep.cpp create mode 100644 lv2-examples/beep.lv2tools/beep.peg create mode 100644 lv2-examples/beep.lv2tools/beep.ttl create mode 100644 lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl create mode 100644 lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl create mode 100644 lv2-examples/beep.lv2tools/manifest.ttl rename lv2-examples/{beep2 => beep2.lv2tools}/Makefile (88%) rename lv2-examples/{beep2 => beep2.lv2tools}/beep.cpp (100%) rename lv2-examples/{beep2 => beep2.lv2tools}/beep.peg (100%) rename lv2-examples/{beep2 => beep2.lv2tools}/beep2.ttl (100%) rename lv2-examples/{beep2 => beep2.lv2tools}/lv2pftci-beep2.lv2/beep2.ttl (100%) rename lv2-examples/{beep2 => beep2.lv2tools}/lv2pftci-beep2.lv2/manifest.ttl (100%) rename lv2-examples/{beep2 => beep2.lv2tools}/manifest.ttl (100%) diff --git a/lv2-examples/beep.lv2tools/Makefile b/lv2-examples/beep.lv2tools/Makefile new file mode 100644 index 0000000..181fea0 --- /dev/null +++ b/lv2-examples/beep.lv2tools/Makefile @@ -0,0 +1,22 @@ +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 `pkg-config --cflags --libs lv2-plugin` -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.lv2tools/beep.cpp b/lv2-examples/beep.lv2tools/beep.cpp new file mode 100644 index 0000000..8837bab --- /dev/null +++ b/lv2-examples/beep.lv2tools/beep.cpp @@ -0,0 +1,61 @@ +// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth + +#include +#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 new file mode 100644 index 0000000..daa5805 --- /dev/null +++ b/lv2-examples/beep.lv2tools/beep.peg @@ -0,0 +1,35 @@ +#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 new file mode 100644 index 0000000..339824d --- /dev/null +++ b/lv2-examples/beep.lv2tools/beep.ttl @@ -0,0 +1,49 @@ +@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 new file mode 100644 index 0000000..339824d --- /dev/null +++ b/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/beep.ttl @@ -0,0 +1,49 @@ +@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 new file mode 100644 index 0000000..8511bab --- /dev/null +++ b/lv2-examples/beep.lv2tools/lv2pftci-beep.lv2/manifest.ttl @@ -0,0 +1,5 @@ +@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 new file mode 100644 index 0000000..8511bab --- /dev/null +++ b/lv2-examples/beep.lv2tools/manifest.ttl @@ -0,0 +1,5 @@ +@prefix lv2: . +@prefix rdfs: . + + a lv2:Plugin; + rdfs:seeAlso . diff --git a/lv2-examples/beep/Makefile b/lv2-examples/beep/Makefile index 022905f..cc22f04 100644 --- a/lv2-examples/beep/Makefile +++ b/lv2-examples/beep/Makefile @@ -1,6 +1,5 @@ BUNDLE = lv2pftci-beep.lv2 -INSTALL_DIR = /usr/local/lib/lv2 - +INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 $(BUNDLE): manifest.ttl beep.ttl beep.so rm -rf $(BUNDLE) @@ -8,7 +7,7 @@ $(BUNDLE): manifest.ttl beep.ttl beep.so cp $^ $(BUNDLE) beep.so: beep.cpp beep.peg - g++ -shared -fPIC -DPIC beep.cpp `pkg-config --cflags --libs lv2-plugin` -o beep.so + 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 diff --git a/lv2-examples/beep/beep.cpp b/lv2-examples/beep/beep.cpp index 8837bab..621d870 100644 --- a/lv2-examples/beep/beep.cpp +++ b/lv2-examples/beep/beep.cpp @@ -1,60 +1,90 @@ -// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth +/* + beep.cpp - LV2 Toolkit API Demonstration Plugin -#include -#include "beep.peg" + 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 */ -class BeepVoice : public LV2::Voice { + +#include +#include "beep.peg" + +class BeepVoice : public lvtk::Voice +{ public: - BeepVoice(double rate) - : m_key(LV2::INVALID_KEY), m_rate(rate), m_period(10), m_counter(0) { - - } + 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 / 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; + 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; + unsigned char m_key; + double m_rate; + uint32_t m_period; + uint32_t m_counter; }; -class Beep : public LV2::Synth { +class Beep : public lvtk::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); - } - + 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); + } }; diff --git a/lv2-examples/beep/beep.ttl b/lv2-examples/beep/beep.ttl index 339824d..6030eab 100644 --- a/lv2-examples/beep/beep.ttl +++ b/lv2-examples/beep/beep.ttl @@ -1,49 +1,67 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . +# 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; - lv2:binary ; - doap:name "Beep"; - doap:license ; - ll:pegName "p"; + a lv2:Plugin, lv2:InstrumentPlugin ; + doap:name "Beep" ; + lv2:project lvtkp: ; + doap:license ; + ui:ui ; + 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 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; - ]; - ]. + ] , [ + 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 index 339824d..6030eab 100644 --- a/lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl +++ b/lv2-examples/beep/lv2pftci-beep.lv2/beep.ttl @@ -1,49 +1,67 @@ -@prefix lv2: . -@prefix doap: . -@prefix rdf: . -@prefix rdfs: . -@prefix ll: . -@prefix pg: . -@prefix ev: . -@prefix atom: . +# 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; - lv2:binary ; - doap:name "Beep"; - doap:license ; - ll:pegName "p"; + a lv2:Plugin, lv2:InstrumentPlugin ; + doap:name "Beep" ; + lv2:project lvtkp: ; + doap:license ; + ui:ui ; + 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 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; - ]; - ]. + ] , [ + 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 index 8511bab..2ad1948 100644 --- a/lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl +++ b/lv2-examples/beep/lv2pftci-beep.lv2/manifest.ttl @@ -1,5 +1,44 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . +# 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 index 8511bab..2ad1948 100644 --- a/lv2-examples/beep/manifest.ttl +++ b/lv2-examples/beep/manifest.ttl @@ -1,5 +1,44 @@ -@prefix lv2: . -@prefix rdfs: . - - a lv2:Plugin; - rdfs:seeAlso . +# 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/Makefile b/lv2-examples/beep2.lv2tools/Makefile similarity index 88% rename from lv2-examples/beep2/Makefile rename to lv2-examples/beep2.lv2tools/Makefile index 1ec36d5..caf8c50 100644 --- a/lv2-examples/beep2/Makefile +++ b/lv2-examples/beep2.lv2tools/Makefile @@ -1,5 +1,5 @@ BUNDLE = lv2pftci-beep2.lv2 -INSTALL_DIR = /usr/local/lib/lv2 +INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 $(BUNDLE): manifest.ttl beep2.ttl beep2.so diff --git a/lv2-examples/beep2/beep.cpp b/lv2-examples/beep2.lv2tools/beep.cpp similarity index 100% rename from lv2-examples/beep2/beep.cpp rename to lv2-examples/beep2.lv2tools/beep.cpp diff --git a/lv2-examples/beep2/beep.peg b/lv2-examples/beep2.lv2tools/beep.peg similarity index 100% rename from lv2-examples/beep2/beep.peg rename to lv2-examples/beep2.lv2tools/beep.peg diff --git a/lv2-examples/beep2/beep2.ttl b/lv2-examples/beep2.lv2tools/beep2.ttl similarity index 100% rename from lv2-examples/beep2/beep2.ttl rename to lv2-examples/beep2.lv2tools/beep2.ttl diff --git a/lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl b/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl similarity index 100% rename from lv2-examples/beep2/lv2pftci-beep2.lv2/beep2.ttl rename to lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/beep2.ttl diff --git a/lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl b/lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl similarity index 100% rename from lv2-examples/beep2/lv2pftci-beep2.lv2/manifest.ttl rename to lv2-examples/beep2.lv2tools/lv2pftci-beep2.lv2/manifest.ttl diff --git a/lv2-examples/beep2/manifest.ttl b/lv2-examples/beep2.lv2tools/manifest.ttl similarity index 100% rename from lv2-examples/beep2/manifest.ttl rename to lv2-examples/beep2.lv2tools/manifest.ttl diff --git a/src/Makefile b/src/Makefile index e32b60f..c33faa3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ BUNDLE = dexed.lv2 -INSTALL_DIR = /usr/local/lib/lv2 -CFLAGS := -fPIC -DPIC -DDEBUG=0 -std=c++11 -I/usr/include/lv2-c++-tools +INSTALL_DIR = /home/pi/zynthian/zynthian-plugins/mod-lv2 +CFLAGS := -fPIC -DPIC -DDEBUG=0 -std=c++11 -I. -I/usr/local/include/lvtk-2 -L/usr/local/lib -llvtk_plugin2 OBJ = dexed.o fm_core.o env.o lfo.o dx7note.o sin.o pitchenv.o fm_op_kernel.o freqlut.o exp2.o EngineMkI.o EngineOpl.o # SysexComm.o PluginFx.o @@ -18,7 +18,7 @@ install: $(BUNDLE) cp -R $(BUNDLE) $(INSTALL_DIR) dexed.so: $(OBJ) - g++ -shared -fPIC -DPIC $(OBJ) `pkg-config --cflags --libs lv2-plugin` -o dexed.so + g++ -shared -fPIC -DPIC $(OBJ) $(CFLAGS) -o dexed.so dexed.o: dexed.cpp dexed.peg $(CXX) $(CFLAGS) -Wall -c dexed.cpp diff --git a/src/dexed.cpp b/src/dexed.cpp index 0bd6f72..7da0754 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -1,6 +1,6 @@ // from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth -#include +#include #include "dexed.peg" #include "dexed.h" #include "EngineMkI.h" @@ -10,7 +10,7 @@ #include "msfa/freqlut.h" #include "msfa/controllers.h" -DexedVoice::DexedVoice(double rate, uint8_t fb) : m_key(LV2::INVALID_KEY), m_rate(rate) +DexedVoice::DexedVoice(double rate, uint8_t fb) : m_key(lvtk::INVALID_KEY), m_rate(rate) { voice.dx7_note=new Dx7Note; feedback_bitdepth=fb; @@ -24,6 +24,7 @@ void DexedVoice::on(unsigned char key, unsigned char velocity) void DexedVoice::off(unsigned char velocity) { voice.dx7_note->keyup(); + m_key = lvtk::INVALID_KEY; } unsigned char DexedVoice::get_key(void) const @@ -33,7 +34,7 @@ unsigned char DexedVoice::get_key(void) const void DexedVoice::render(uint32_t from, uint32_t to) { - if (m_key == LV2::INVALID_KEY) + if (m_key == lvtk::INVALID_KEY) return; for (uint32_t i = from; i < to; ++i) @@ -50,7 +51,7 @@ void DexedVoice::render(uint32_t from, uint32_t to) //============================================================================== -Dexed::Dexed(double rate) : LV2::Synth(p_n_ports, p_lv2_events_in) +Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_lv2_events_in) { Exp2::init(); Tanh::init(); @@ -86,5 +87,4 @@ uint32_t Dexed::get_engineType(void) return(engineType); } - static int _ = Dexed::register_class(p_uri); diff --git a/src/dexed.h b/src/dexed.h index f0c8091..c3355a1 100644 --- a/src/dexed.h +++ b/src/dexed.h @@ -46,7 +46,7 @@ enum DexedEngineResolution { //============================================================================== -class DexedVoice : public LV2::Voice +class DexedVoice : public lvtk::Voice { public: DexedVoice(double rate, uint8_t fb); @@ -64,7 +64,7 @@ class DexedVoice : public LV2::Voice //============================================================================== -class Dexed : public LV2::Synth +class Dexed : public lvtk::Synth { public: Dexed(double rate);