Example #1
0
void addCtrlrMidiMessageToBuffer (MidiBuffer &bufferToAddTo, CtrlrMidiMessage &m)
{
	for (int i=0; i<m.getNumMessages(); i++)
	{
		bufferToAddTo.addEvent (m.getReference(i).m, 1);
	}
}
Example #2
0
void CtrlrProcessor::addMidiToOutputQueue (const CtrlrMidiMessage &m)
{
	for (int i=0; i<m.getNumMessages(); i++)
	{
		m.getReference(i).m.setTimeStamp(i+1);
		midiCollector.addMessageToQueue (m.getReference(i).m);
	}
}
Example #3
0
void CtrlrPanel::sendMidi (CtrlrMidiMessage &m, double millisecondCounterToStartAt)
{
	if (outputDevice)
	{
		if (millisecondCounterToStartAt == -1)
			outputDevice->sendMidiBuffer (m.getMidiBuffer(), globalMidiDelay);
		else
			outputDevice->sendMidiBuffer (m.getMidiBuffer(), millisecondCounterToStartAt);
	}
}
void CtrlrSysexProcessor::setMultiMessageFromString(CtrlrMidiMessage &message, const String &savedState)
{
	if (savedState.trim() == String::empty)
		return;

	StringArray messages;
	const int ch = message.getChannel();
	const int v  = message.getValue();
	const int n  = message.getNumber();

	message.getMidiMessageArray().clear();
	messages.addTokens (savedState.trim(), ":", "\"\'");

	for (int i=0; i<messages.size(); i++)
	{
		message.getMidiMessageArray().add (midiMessageExfromString (messages[i], ch, n, v));
	}
}
Example #5
0
const String extractVendorId (const CtrlrMidiMessage &message)
{
	MemoryBlock bl = message.getData();
	uint8 byte1 = 0xf7, byte2 = 0x00, byte3 = 0x00;
	if (bl.getSize() >= 5)
		byte1 = bl[5];

	if (byte1 == 0x0)
	{
		if (bl.getSize() >= 8)
		{
			byte2 = bl[6];
			byte3 = bl[7];
		}

		return (String::formatted ("%02x%02x%02x", byte1, byte2, byte3).toUpperCase());
	}

	return (String::formatted ("%02x", byte1).toUpperCase());
}
void CtrlrSysexProcessor::setSysExFormula(CtrlrMidiMessage &message, const String &formulaString)
{
	/* parse the formula to byte format */
	message.getMidiMessageArray().clear();
	message.getMidiMessageArray().add (sysexMessageFromString(formulaString, message.getValue(), message.getChannel()));
}
Example #7
0
const String dataPrefix (const CtrlrMidiMessage &data, const int prefixLength)
{
	return (dataPrefix (data.getData(), prefixLength));
}