Motor moving on frequency

Hi! We are 3 students who are struggeling with a arduino project.
We want a motor to move according to the bass of a song. We have this code which works according to the amount of sound that the microphone gets. But we want it to work on the hight of the frequency. We have tried to include the LowPassFilter in our code but this didn’t gave any result.
Is there somebody who can help us change the code?
(the codes for the LED lights are unnecessary)

// for servo stuff we include the servo library
#include <Servo.h>
// creating a servo object
Servo myservo;

// Some Varuables we need
int ServoPin = 9;
int SoundInPin = A0;
int LedPin = 12;
// the setup routine runs once when you press reset:
void setup() {
// initialize

pinMode(SoundInPin, INPUT);
pinMode(LedPin, OUTPUT);

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(SoundInPin);
// we Maop a nother value of this for LED that can be a integer betwen 0…255
int LEDValue = map(sensorValue,0,512,0,255);
// We Map it here down to the possible range of servo moovment.
sensorValue = map(sensorValue,0,512,0,180);
// note normaly the 512 is 1023 becouse of analog reading shud go so far, but i changed that to get better readings.
// setting the servo into standard position
int MoveDelayValue = map(sensorValue,0,255,0,sensorValue);

// maping the same reading a little bit more down to calculate the time your servo gets to make the one Move
if (sensorValue > 130) { // to cut off some static readings only if the reading gets higher then 33 it begings to work
delay(1); // a static delay to smooth things out…
// now move the servo to our mapped reading
// turn led on with the calculated value for it
analogWrite(LedPin, sensorValue);
// and do that move in this delay time

} // Done. now we close that part.
// turn off the led again.
analogWrite(LedPin, 0);
// and this repeats all the time.