69 lines
2.2 KiB
C++
69 lines
2.2 KiB
C++
/*
|
|
Peacock-8 VA polysynth
|
|
|
|
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>
|
|
|
|
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.
|
|
|
|
THE 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 _PEACOCK_HPP
|
|
#define _PEACOCK_HPP
|
|
|
|
#include "DistrhoPlugin.hpp"
|
|
#include "assigner.hpp"
|
|
#include "module.hpp"
|
|
START_NAMESPACE_DISTRHO
|
|
|
|
class Peacock : public Plugin {
|
|
public:
|
|
Peacock();
|
|
~Peacock();
|
|
|
|
|
|
protected:
|
|
const char* getLabel() const override { return "peacock-8"; }
|
|
const char* getDescription() const override {
|
|
return "simple 8-voice polysynth";
|
|
}
|
|
const char* getMaker() const override { return "Gordonjcp"; }
|
|
const char* getLicense() const override { return "ISC"; }
|
|
uint32_t getVersion() const override { return d_version(1, 0, 0); }
|
|
int64_t getUniqueId() const override { return d_cconst('P', 'f', 'a', 'u'); }
|
|
|
|
// Initialisation
|
|
void initAudioPort(bool input, uint32_t index, AudioPort& port) override;
|
|
|
|
void run(const float**, float** outputs, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount) override;
|
|
void runMidi(const MidiEvent* ev, uint32_t ev_count, uint32_t timeLimit);
|
|
|
|
Voice voice[NUM_VOICES];
|
|
|
|
private:
|
|
Assigner* ic1;
|
|
Module* m;
|
|
|
|
|
|
uint32_t sampleRate;
|
|
|
|
// variables for breaking up the 4.3 millisecond module board ticks
|
|
uint32_t lastEvent = 0; // event number of last MIDI event processed in a chunk
|
|
uint32_t framesLeft = 0, blockLeft = 0;
|
|
|
|
|
|
|
|
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Peacock);
|
|
};
|
|
|
|
END_NAMESPACE_DISTRHO
|
|
|
|
#endif |