Where is NRP[N] Logic in Codebase? Specifically the [-2,-1] handling (token[5] maybe?) [CC,ByteValue,MSB7bitValue,99,-2
]:
#610
-
Where is the handing for this MidiMessageMultiList in the code? JUCE? Looking for Classname/MethodName
Thanks in advance for any responses!... |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I think the logic will be in the Ctrlr editor panel, not MIDI. As far as LUA is concerned this is just sending a MIDI Message. That will be bound to Juce using Luabind. |
Beta Was this translation helpful? Give feedback.
-
NRPN's are defined after line 664 of https://github.com/damiensellier/CtrlrX/blob/def8d6dcd72f90d71a8d90450c706a9bb669a56c/Source/Resources/XML/CtrlrIDs.xml#L146 NRPN's aren't that complicated. They are simply 4 MIDI CC's. Wikipedia explains them quite well. https://en.wikipedia.org/wiki/NRPN Basically send MIDI CC98 and then MIDICC99 to pick what parameter you are controlling then As to what parameter CC98 and 99 this is manufacturer and synth dependent, similar to the sysex spec. You'll need to track down a manual or document from the manufacturer to decode these for each synth. Note not every syth supports these. |
Beta Was this translation helpful? Give feedback.
-
@unityconstruct, can you please try to be a bit less verbose (not only in this thread but in all)? @Godlike-Productions answered you on where the definitions are. I'm completing that by saying that the last attribute -2 or -1 is used to indicate "controller" (-2) or "value" (-1)
The 2 first lines are indicating the controller number while the 2 last ones the values. |
Beta Was this translation helpful? Give feedback.
-
bl = MemoryBlock(messageArray.getReference(i).m.getRawData(), messageArray.getReference(i).m.getRawDataSize());
bl = midiMessagePattern(messageArray.getReference(i), messageArray.getReference(i).getTokenArray(), getGlobalVariables()); CtrlrMidiMessageEx midiMessageExfromString | CtrlrUtilities.ccp
const CtrlrMidiMessageEx midiMessageExfromString (const String &str, const int ch, const int number, const int value)
{
CtrlrMidiMessageEx ret;
StringArray tokens;
tokens.addTokens (str, ",", "\"\'");
if (tokens.size() >= 5)
{
ret.indirectNumberFlag = indirectFromString (tokens[1]);
ret.indirectValueFlag = indirectFromString (tokens[2]);
ret.overrideNumber = tokens[3].getIntValue();
ret.overrideValue = tokens[4].getIntValue();
if (tokens[0] == "CC")
ret.m = MidiMessage::controllerEvent (ch,number,value);
if (tokens[0] == "Aftertouch")
ret.m = MidiMessage::aftertouchChange (ch,number,value);
if (tokens[0] == "NoteOn")
ret.m = MidiMessage::noteOn (ch,number,(uint8)value);
if (tokens[0] == "NoteOff")
ret.m = MidiMessage::noteOff (ch,number,(uint8)value);
if (tokens[0] == "ChannelPressure")
ret.m = MidiMessage::channelPressureChange (ch,value);
if (tokens[0] == "ProgramChange")
ret.m = MidiMessage::programChange(ch,value);
if (tokens[0] == "SysEx")
{
return (CtrlrSysexProcessor::sysexMessageFromString(tokens[5], value, ch));
}
ret.setNumber(number);
ret.setValue(value);
return (ret);
}
else
{
jassertfalse; // Looks like there is not enough tokens to create a CtrlrMidiMessageEx object
return (CtrlrMidiMessageEx());
}
} CtrlrMidiMessage::patternChanged() : CtrlrMidiMessage.cppvoid CtrlrMidiMessage::patternChanged()
{
messagePattern.setSize(0);
for (int i=0; i<messageArray.size(); i++)
{
MemoryBlock bl(0);
if (messageArray.getReference(i).overrideValue == -2)
{
bl = MemoryBlock(messageArray.getReference(i).m.getRawData(), messageArray.getReference(i).m.getRawDataSize());
}
else
{
bl = midiMessagePattern(messageArray.getReference(i), messageArray.getReference(i).getTokenArray(), getGlobalVariables());
}
messagePattern.append (bl.getData(), bl.getSize());
}
} |
Beta Was this translation helpful? Give feedback.
-1,-2
is stored in a token array at index[4]NRPN ID
v.s. aNRPN VALUE
-2
CtrlrMidiMessageEx midiMessageExfromString | CtrlrUtilities.ccp
ret.overrideValue = tokens[4].getIntValue();