GetMidiInNoteValue() not working

This forum is assigned for bug reporting. Be as much accurate as you are possible.

Moderator: MADRIX Team

Locked
mcpantsface
Posts: 5
Joined: Thu Nov 29, 2012 4:44 am

GetMidiInNoteValue() not working

Post 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();
}
User avatar
Wissmann
Developer
Developer
Posts: 767
Joined: Fri Feb 23, 2007 3:36 pm
Location: Germany
Contact:

Re: GetMidiInNoteValue() not working

Post 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.
LEDs are nothing without control ;-)
mcpantsface
Posts: 5
Joined: Thu Nov 29, 2012 4:44 am

Re: GetMidiInNoteValue() not working

Post 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?
User avatar
Wissmann
Developer
Developer
Posts: 767
Joined: Fri Feb 23, 2007 3:36 pm
Location: Germany
Contact:

Re: GetMidiInNoteValue() not working

Post 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.
LEDs are nothing without control ;-)
Locked