Buffer too slow(?) for midi data...
funk
Posts: 18
I'm fairly new to AMX programming in combination with midi. I'm using an AXB-Midi connected to a NI-3000 to control a yamaha 01v96 v2 mixer.
All is well when I control the mixer by midi , but when I operate the mixer itself, the databuffer in my program seems to 'miss' some incomming data.
This is what happens:
- When you control the fader on the mixer, it sends constant updates of it's value ($B0,nFader,nValue). When you stop moving the fader, the sending of data stops.
- My program contains a buffer array (midi_data[40]) for this incoming data.
- I see ALL the data coming into the NI-3000 in NetLinx Studio's Device Notification
- BUT, only about a fourth is captured by the buffer, and therefore my onscreen data does not correspond with the actual mixer (e.g. the fader is at zero while the 'on screen' is still halfway) which causes problems etc. etc.
Took me a while to figure out why my program didn't work well. But I don't understand why this happens and how to solve it. Are buffers just too slow...?? HELP
All is well when I control the mixer by midi , but when I operate the mixer itself, the databuffer in my program seems to 'miss' some incomming data.
This is what happens:
- When you control the fader on the mixer, it sends constant updates of it's value ($B0,nFader,nValue). When you stop moving the fader, the sending of data stops.
- My program contains a buffer array (midi_data[40]) for this incoming data.
- I see ALL the data coming into the NI-3000 in NetLinx Studio's Device Notification
- BUT, only about a fourth is captured by the buffer, and therefore my onscreen data does not correspond with the actual mixer (e.g. the fader is at zero while the 'on screen' is still halfway) which causes problems etc. etc.
Took me a while to figure out why my program didn't work well. But I don't understand why this happens and how to solve it. Are buffers just too slow...?? HELP
0
Comments
I'm guessing your 40-character buffer is simply overflowing...
Cool username, BTW.
- Chip
The buffer size was the problem in this case. I 'assumed' that with a bufferoverflow, I would lose the data at the end of the array, but that the incoming data would still flow in fine. I assumend wrong
Now I have to figure out how to handle these LOADS of data. Setting two faders to zero and back to -90 gives me a array with a length of about 660... but that's a different story.
P.S. Any change of providing me with the module for inspiration ?