AS5600 issue : Midi scratch controller

Hello everybody !

With the help of chat Gpt and other AI, I created a midi scratch controller inspired by Rasteri and his sc 1000. RASTERI SC1000

The Hardware is :

an arduino pro micro

as5600 for the rotation

a metal disk programmed to be touch sensitive

some mechanical switches

an Innofader mini

some potentiometers.

It kinda works, but I have a specific problem that my poor knowledge in programming can't figure out. On very quick changes of direction, the controller is loosing some information on the rotation. and as a result it fails to come back at the start of the sound. I don't know if it's a limitation of the hardware or if it's the arduino code. I tried different arduino codes, still with the help of different Ai, but I only manage to increase the issue, not reduce it.
https://youtube.com/shorts/yQpR061ANuA?feature=share

https://youtube.com/shorts/yanFUpMlLvU?feature=share

Any ideas will be appreciated, and if you have ideas to upgrade this code, don't hesitate !

You're constraining midiValue to between -63 and 63. If the true angle update is greater than that amount, then you will lose some of the movement, and you won't end up back at the same place.

First of all, thanks for providing an answer :slight_smile:
I understand what you say, but then why is it when i make a full turn i don't loose any movement? It's only on fast direction change.

And what would be a good solution, knowing that midi signal is between 0 and 127?

On a slow direction change, you'll send many small updates and all the information will be conserved, since you don't overflow that counter.

I don't know much about MIDI, but could you send multiple messages in a single update? Something like:

int sendVal = 0;
for (int remaining = filteredAngle / jogWheelSensitivity; 
     remaining != 0; 
     remaining -= sendVal)  {
  sendVal = constrain(remaining, -63, 63);
  sendControlChange(1, jogWheelCC, sendVal);
}

ok I think I understand you explanation. I tried you solution (well, I gave your solution to my ai assistant, and tried multiple implementation it suggested), and it changes the problem. now every fast movement has the potential to loose track of the ... track. even on small but quick movement it misses some steps or go backwards. and there is a worse lag I think.

I'm sorry to hear that. Unfortunately, I don't know what code you actually tried so it is not possible for me to help with it. Also I don't know the midi libraries so it's possible that even if the code is correct my solution may not be workable.

OK I tried again after sleeping, and trying to understand what I was doing and guess what? Much better. I don't have the same issue anymore. On repetitive large fast movements sometimes, there is a loss, more random.I'm going to try it more extensively, but it seems that you were on the right track (pun intended) Thanks a lot !

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.