how to control volume using arduino and slider sen

Hi, I have a question on how to control volume of a music played on the computer using arduino & processing & a slider sensor.
I’m very new to arduino, and I don’t know where to find codes for the programs. can any body help me?

[1] Create an arduino sketch that sends the values of the sensor on the serial uart
[2] Make a pogram that runs on your computer that recieves and interpret the serial data, and then sets volume accordingly.

Arduino example sketch:

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(analogRead(0));
delay(20);
}