Added demo plugin beep - trying to use it as a start for dexed-lv2.

pull/1/head
Holger Wirtz 8 years ago
parent a2ae4a70da
commit 28fb4417b0
  1. 1
      .gitignore
  2. 23
      beep/Makefile
  3. 59
      beep/beep.cpp
  4. 35
      beep/beep.peg
  5. 46
      beep/beep.ttl
  6. 46
      beep/lv2pftci-beep.lv2/beep.ttl
  7. 5
      beep/lv2pftci-beep.lv2/manifest.ttl
  8. 5
      beep/manifest.ttl
  9. BIN
      src/.Makefile.swp
  10. 27
      src/.project
  11. 2
      src/Makefile
  12. 2
      src/PluginProcessor.h

1
.gitignore vendored

@ -1,2 +1,3 @@
*.o *.o
*.so *.so
*.gch

@ -0,0 +1,23 @@
BUNDLE = lv2pftci-beep.lv2
INSTALL_DIR = /usr/local/lib/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,59 @@
#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,46 @@
@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#>.
<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 ev:EventPort, lv2:InputPort;
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,46 @@
@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#>.
<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 ev:EventPort, lv2:InputPort;
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>.

Binary file not shown.

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Source</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

@ -17,7 +17,7 @@ all: \
SysexComm.o \ SysexComm.o \
clean: clean:
rm -f *.o *~ *.bak rm -f *.o *~ *.bak *.gch
msfa/%.o: msfa/%.cc msfa/%.o: msfa/%.cc
$(CXX) $(CFLAGS) -Wall -c $< $(CXX) $(CFLAGS) -Wall -c $<

@ -228,7 +228,7 @@ public :
static File dexedCartDir; static File dexedCartDir;
private: private:
//============================================================================== //==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DexedAudioProcessor) DexedAudioProcessor;
}; };

Loading…
Cancel
Save