14 #include "JuceHeader.h"
40 #define MessageChannelToStatus(message, channel) ((unsigned) message << 4) + channel)
95 virtual void open(
int devID) = 0;
100 virtual void clear();
136 virtual void open(
int deviceID);
140 virtual void start();
163 virtual void open(
int deviceID );
165 void writeNoteOn(
unsigned channel,
unsigned pitch,
unsigned velocity );
166 void writeNoteOn(
unsigned channel,
float frequency,
float amplitude );
167 void writeNoteOff(
unsigned channel,
unsigned pitch,
unsigned velocity );
168 void writeNoteOff(
unsigned channel,
float frequency,
float amplitude );
169 void writePolyTouch(
unsigned channel,
unsigned pitch,
unsigned amount );
174 void writeSysEX(
long when,
unsigned char *msg );
194 void start(
int index);
206 void init(juce::String namS);
static void dumpDevices()
printing device info for all devices.
float mTempoScale
tempo scale (secs/beat / ticks/beat)
MIDIIO class: superclass of in and out; has a message buffer and current messages It's a model so you...
void open(int devID)
open a device
The Model/Observable/Subject class; instances of its subclasses should send themselves, this->changed(some_data); on "relevant" state changes; the code they inherit (from Model) manages updating the list of observer/dependent objects in that they each receive update(some_data); and can access the model-passed data (the model might pass "this").
juce::MidiMessageSequence * mTrak
track ptr
virtual void clear()
stop MIDI stream
void open()
open the abstract
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
float getVelocityFloat()
has range of [0.0 1.0] mapped to [0 127] Data fields
void writeControlChange(unsigned channel, unsigned function, unsigned value)
CSL_MIDIMessage message()
void open()
method for opening the default stream.
juce::MidiMessage * mJMsg
JUCE-format message.
unsigned getProgramNumber()
juce::MidiInput * mDevice
my device ptr
MIDIIn class is-a MidiInputCallback too, and an "input-ready" flag.
void writeAftertouch(unsigned channel, unsigned amount)
[0, 127]
unsigned channel
0-indexed, so from 0 to 15
double mStartTime
the time I was started
void writePolyTouch(unsigned channel, unsigned pitch, unsigned amount)
void writeNoteOff(unsigned channel, unsigned pitch, unsigned velocity)
MIDINote#, [0, 127].
bool mIsOpen
instance status indicators
int mDeviceID
device ID which will/is opened.
MIDIIO()
< It's a model & sends itself "changed"
void nextEvent()
step to next event or reset flag
int evaluate(void *arg)
evaluate answers the message command
virtual void stop()
stop MIDI stream
unsigned getCommand()
note accessors
unsigned getControlFunction()
void writeProgramChange(unsigned channel, unsigned programNum)
void dumpMessage()
print current msg
unsigned getControlValue()
void setBufferSize(unsigned bufferSize)
InstrumentLibrary * mLibrary
instrument library
bool isNoteOn()
bool flags for events
void handleIncomingMidiMessage(juce::MidiInput *source, const juce::MidiMessage &message)
implement inherited MidiInputCallback
static int countDevices()
bool isOpen()
true if MIDI stream is opened.
MIDIPlayer(string nam, InstrumentLibrary *lib)
void handleError(CException *err)
error handler
juce::MidiFile mFile
JUCE MIDI file.
void writeNoteOn(unsigned channel, unsigned pitch, unsigned velocity)
MIDINote#, [0, 127].
juce::MidiMessageSequence * mergeTrax()
void writePitchWheel(unsigned channel, unsigned amount)
[0, 16384]
CMIDIMessageType
CMIDIMessageType enum of midi msg categories.
bool poll()
poll returns a bool (really quickly)
CMIDIMessage mMsg
current message (its flags determine the port state)
float time
timestamp in sec
virtual void stop()
start MIDI stream
void writeSysEX(long when, unsigned char *msg)
juce::MidiBuffer mBuffer
I/O buffer.
CMIDIMessage class (mapped to juce::MidiMessage)
CMIDIMessageType message
event type
void copyMessage(CMIDIMessage &source, CMIDIMessage &dest)
copy csl::CMIDIMessage <–> juce::MidiMessage
juce::MidiOutput * mOut
the juce midi output is public
unsigned getPolyAftertouch()
virtual void close()
closing MIDI stream
static bool mIsInitialized
< static flags to keep track of driver state
virtual void start()
start MIDI stream
MIDIOut class write msgs out to a device (or file)
std::map< int, InstrumentVector > InstrumentLibrary
void init(juce::String namS)
Base class of CSL exceptions (written upper-case). Has a string message.