Quantcast

Need help writing an LMMS OSC plugin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help writing an LMMS OSC plugin

Johannes Lorenz-2
Hi,



I'd like to write a generic-purpose (but mainly for ZynAddSubFX) OSC plugin*
for LMMS and could need some help. It should communicate only via two
functions:

        virtual void runSynth(float* outl, float* outr, unsigned long
sample_count) = 0;
        virtual void sendOsc(const char* port, const char* args, ...) = 0;

runSynth() does the calculation for sample_count audio samples. Playing notes,
changing knob values etc. all goes via OSC messages using sendOsc().

Now, I wondered which of the following functions of "class Instrument" I
should implement in my Instrument subclass:

        virtual void play( sampleFrame * _working_buffer );
        virtual void playNote( NotePlayHandle * /* _note_to_play */,
                                        sampleFrame * /* _working_buf */ );
        virtual bool handleMidiEvent( const MidiEvent&, const MidiTime&, f_cnt_t
offset = 0 );

I think handling it like the current ZynAddSubFX plugin, which receives MIDI
events to handle noteOn and noteOff, is the easiest way since the plugin
doesn't need to keep track of which notes are currently played and which
aren't. However, a plugin using playNote() instead of handleMidiEvent() might
support more features (e.g. per-note-pitch-envelopes)...

What are the advantages/disadvantages of the two approaches? Which should I
choose?



Many thanks on advance,
Johannes



* Just if you wonder why I don't wait for LV2: I really need the plugin now,
and I can not wait for a few months. It's currently the only solution for me.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
LMMS-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/lmms-devel
Loading...