3 stepper motors with different variable speed - solved

I would start with something like this:

const unsigned long MaxStepsPerSecond = 1000;

void loop()
{
  unsigned long currenMicros = micros();

  unsigned long Speed1 = (analogRead(A0) * MaxStepsPerSecond) / 1024;
  unsigned long Speed2 = (analogRead(A1) * Speed1) / 1024;
  unsigned long Speed3 = (analogRead(A2) * Speed2) / 1024;

  if (Speed1 > 0)
  {
    unsigned long microsPerHalfStep = 500000ul / Speed1;
    static lastMicros = 0;
    if (currenMicros - lastMicros >=  microsPerHalfStep)
    {
      lastMicros = currentMicros;
      digitalWrite(S1Pin, !digitalRead(S1Pin)); // Toggle
    }
  }

  if (Speed2 > 0)
  {
    unsigned long microsPerHalfStep = 500000ul / Speed2;
    static lastMicros = 0;
    if (currenMicros - lastMicros >=  microsPerHalfStep)
    {
      lastMicros = currentMicros;
      digitalWrite(S2Pin, !digitalRead(S2Pin)); // Toggle
    }
  }

  if (Speed3 > 0)
  {
    unsigned long microsPerHalfStep = 500000ul / Speed2;
    static lastMicros = 0;
    if (currenMicros - lastMicros >=  microsPerHalfStep)
    {
      lastMicros = currentMicros;
      digitalWrite(S3Pin, !digitalRead(S3Pin)); // Toggle
    }
  }
}