Buffer too slow(?) for midi data...
funk
Junior Member
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
Comments
-
It depends on a lot of things, especially how the code is handling the buffer, but... I'm thinking that 40 bytes is a pretty small buffer for MIDI data - have you tried upping that to something more significant? If you're working in the Netlinx universe, you can make that buffer pretty freakin' big.
I'm guessing your 40-character buffer is simply overflowing...
Cool username, BTW.
- Chip -
We've got a working module for it. We use INTEGERS. We've got a bi directional module. When you control the faders on the mixer you see it on your touchpanel. When you use the faders on the touchpanel you see the faders move onb the mixer
. So use an integer array and make a function that check if there is data from the mixer then update the slider and then check for updates. -
Thanks guys!
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 ?
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums