MADRIX Forum • GetMidiInNoteValue() not working
Page 1 of 1

GetMidiInNoteValue() not working

Posted: Thu May 02, 2013 3:04 am
by mcpantsface
I'm trying to run the example found in the documentation and I'm not getting any response with my MIDI controller (MPD32). Under Device Manager my device is the second one listed. When I verify that Madrix is in fact acquiring midi data, the MIDI Watcher is telling me Note On with Chn=02, Note=48, and Vol=127. In the example script I've set the parameters as follows and loaded it into the Main Output Macro. When I press the note, I get no indication that the script has seen a value change. How is this suppose to work?

Code: Select all

@scriptname="MIDItoMaster";
@author="jky";
@version="2.14b";
@description="Uses incoming MIDI to control the Master Fader";
const int NOTE=48; // MIDI Note for control
const int CHANNEL=2; // MIDI Channel for control
const int DEVICE_ID=2; // MIDI Device for control
void InitEffect()
{
}
void PreRenderEffect()
{
}
void PostRenderEffect()
{
if(IsMidiInEnabled()==1)
{
const float Value = (float)GetMidiInNoteValue(NOTE,CHANNEL,DEVICE_ID)/127.0;
//const float Value = (float)GetMidiInControlValue(NOTE,CHANNEL,DEVICE_ID)/127.0;
// MIDI CONTROLLER 0xb
SetMasterFader(Value*255);
}
}
void MatrixSizeChanged()
{
InitEffect();
}

Re: GetMidiInNoteValue() not working

Posted: Thu May 02, 2013 3:10 pm
by Wissmann
I think it is because of your device id.
If it is the second listed device the device id have to be 1 instead of 2 because this id starts to count from Zero.

Re: GetMidiInNoteValue() not working

Posted: Fri May 03, 2013 3:19 am
by mcpantsface
Unfortunately, changing the Device ID doesn't work. I've tried various combinations and I'm still getting no response. Is there any other way I can diagnose the situation? How is GetMidiInNoteValue() different from just GetNoteValue() used for M2L? My MIDI controller will trigger GetNoteValue() but this function does not work on the Main Output Macro. Thoughts?

Re: GetMidiInNoteValue() not working

Posted: Fri May 03, 2013 7:16 am
by Wissmann
Ok i test the script today on my own.
I Gues in your MidiWatcher it Looks like this.

Code: Select all

Raw Data Note On     2 048 127
if so, please use a channel value of 1 in your code, because the channels starts to Count form Zero as like as the devices. The Note numbers and Note values are displayed in the MidiWatcher on the same way you have to use in the script. Only the Channel starts by 1 because nobody say channel Zero in the case of Midi.
.
I hope this fix your issue.