mirror of https://github.com/dcoredump/dexed.git
parent
caccab0570
commit
655870dad8
@ -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
|
||||
|
@ -0,0 +1,61 @@ |
||||
// from: http://ll-plugins.nongnu.org/lv2pftci/#A_synth
|
||||
|
||||
#include <lv2synth.hpp> |
||||
#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<BeepVoice, Beep> { |
||||
public: |
||||
|
||||
Beep(double rate) |
||||
: LV2::Synth<BeepVoice, Beep>(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); |
@ -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 |
||||
|
||||
/* <http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> */ |
||||
|
||||
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 */ |
@ -0,0 +1,49 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
@prefix doap: <http://usefulinc.com/ns/doap#>. |
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. |
||||
@prefix ll: <http://ll-plugins.nongnu.org/lv2/namespace#>. |
||||
@prefix pg: <http://ll-plugins.nongnu.org/lv2/ext/portgroups#>. |
||||
@prefix ev: <http://lv2plug.in/ns/ext/event#>. |
||||
@prefix atom: <http://lv2plug.in/ns/ext/atom#> . |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out> a pg:StereoGroup. |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin, lv2:InstrumentPlugin; |
||||
lv2:binary <beep.so>; |
||||
doap:name "Beep"; |
||||
doap:license <http://usefulinc.com/doap/licenses/gpl>; |
||||
ll:pegName "p"; |
||||
|
||||
lv2:port [ |
||||
a lv2:InputPort, atom:AtomPort ; |
||||
atom:bufferType atom:Sequence ; |
||||
atom:supports <http://lv2plug.in/ns/ext/midi#MidiEvent> ; |
||||
lv2:index 0; |
||||
ev:supportsEvent <http://lv2plug.in/ns/ext/midi#MidiEvent>; |
||||
lv2:symbol "midi"; |
||||
lv2:name "MIDI"; |
||||
], |
||||
|
||||
[ |
||||
a lv2:AudioPort, lv2:OutputPort; |
||||
lv2:index 1; |
||||
lv2:symbol "left"; |
||||
lv2:name "Left"; |
||||
pg:membership [ |
||||
pg:group <http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out>; |
||||
pg:role pg:leftChannel; |
||||
]; |
||||
], |
||||
|
||||
[ |
||||
a lv2:AudioPort, lv2:OutputPort; |
||||
lv2:index 2; |
||||
lv2:symbol "right"; |
||||
lv2:name "Right"; |
||||
pg:membership [ |
||||
pg:group <http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out>; |
||||
pg:role pg:rightChannel; |
||||
]; |
||||
]. |
@ -0,0 +1,49 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
@prefix doap: <http://usefulinc.com/ns/doap#>. |
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. |
||||
@prefix ll: <http://ll-plugins.nongnu.org/lv2/namespace#>. |
||||
@prefix pg: <http://ll-plugins.nongnu.org/lv2/ext/portgroups#>. |
||||
@prefix ev: <http://lv2plug.in/ns/ext/event#>. |
||||
@prefix atom: <http://lv2plug.in/ns/ext/atom#> . |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out> a pg:StereoGroup. |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin, lv2:InstrumentPlugin; |
||||
lv2:binary <beep.so>; |
||||
doap:name "Beep"; |
||||
doap:license <http://usefulinc.com/doap/licenses/gpl>; |
||||
ll:pegName "p"; |
||||
|
||||
lv2:port [ |
||||
a lv2:InputPort, atom:AtomPort ; |
||||
atom:bufferType atom:Sequence ; |
||||
atom:supports <http://lv2plug.in/ns/ext/midi#MidiEvent> ; |
||||
lv2:index 0; |
||||
ev:supportsEvent <http://lv2plug.in/ns/ext/midi#MidiEvent>; |
||||
lv2:symbol "midi"; |
||||
lv2:name "MIDI"; |
||||
], |
||||
|
||||
[ |
||||
a lv2:AudioPort, lv2:OutputPort; |
||||
lv2:index 1; |
||||
lv2:symbol "left"; |
||||
lv2:name "Left"; |
||||
pg:membership [ |
||||
pg:group <http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out>; |
||||
pg:role pg:leftChannel; |
||||
]; |
||||
], |
||||
|
||||
[ |
||||
a lv2:AudioPort, lv2:OutputPort; |
||||
lv2:index 2; |
||||
lv2:symbol "right"; |
||||
lv2:name "Right"; |
||||
pg:membership [ |
||||
pg:group <http://ll-plugins.nongnu.org/lv2/lv2pftci/beep/out>; |
||||
pg:role pg:rightChannel; |
||||
]; |
||||
]. |
@ -0,0 +1,5 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. |
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin; |
||||
rdfs:seeAlso <beep.ttl>. |
@ -0,0 +1,5 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. |
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin; |
||||
rdfs:seeAlso <beep.ttl>. |
@ -1,5 +1,44 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
# Copyright (C) 2013 Michael Fisher <mfisher31@gmail.com> |
||||
# |
||||
# 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: <http://usefulinc.com/ns/doap#> . |
||||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#> . |
||||
@prefix lvtkp: <http://lvtoolkit.org/plugins/> . |
||||
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . |
||||
|
||||
|
||||
<http://lvtoolkit.org/people/mfisher> |
||||
a foaf:Person ; |
||||
foaf:name "Michael Fisher" ; |
||||
foaf:mbox <mailto:mfisher31@gmail.com> ; |
||||
rdfs:seeAlso <http://lvtoolkit.org> . |
||||
|
||||
lvtkp: |
||||
a doap:Project ; |
||||
lv2:symbol "lvtk" ; |
||||
doap:name "LVTK Examples" ; |
||||
doap:shortdesc "Example plugins demonstrating the LVTK api." ; |
||||
doap:homepage <http://lvtoolkit.org> ; |
||||
doap:maintainer <http://lvtoolkit.org/people/mfisher> ; |
||||
doap:developer <http://lvtoolkit.org/people/mfisher> . |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin ; |
||||
lv2:binary <beep.so> ; |
||||
rdfs:seeAlso <beep.ttl> . |
||||
|
||||
|
@ -1,5 +1,44 @@ |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#>. |
||||
# Copyright (C) 2013 Michael Fisher <mfisher31@gmail.com> |
||||
# |
||||
# 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: <http://usefulinc.com/ns/doap#> . |
||||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . |
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
||||
@prefix lv2: <http://lv2plug.in/ns/lv2core#> . |
||||
@prefix lvtkp: <http://lvtoolkit.org/plugins/> . |
||||
@prefix ui: <http://lv2plug.in/ns/extensions/ui#> . |
||||
|
||||
|
||||
<http://lvtoolkit.org/people/mfisher> |
||||
a foaf:Person ; |
||||
foaf:name "Michael Fisher" ; |
||||
foaf:mbox <mailto:mfisher31@gmail.com> ; |
||||
rdfs:seeAlso <http://lvtoolkit.org> . |
||||
|
||||
lvtkp: |
||||
a doap:Project ; |
||||
lv2:symbol "lvtk" ; |
||||
doap:name "LVTK Examples" ; |
||||
doap:shortdesc "Example plugins demonstrating the LVTK api." ; |
||||
doap:homepage <http://lvtoolkit.org> ; |
||||
doap:maintainer <http://lvtoolkit.org/people/mfisher> ; |
||||
doap:developer <http://lvtoolkit.org/people/mfisher> . |
||||
|
||||
<http://ll-plugins.nongnu.org/lv2/lv2pftci/beep> |
||||
a lv2:Plugin ; |
||||
lv2:binary <beep.so> ; |
||||
rdfs:seeAlso <beep.ttl> . |
||||
|
||||
|
@ -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 |
Loading…
Reference in new issue