I understand that inString needs a new value to stop the song from playing but i have no idea what to write. I have been searching for rewind() in the minim-library but cant really get it working.
The variable inString starts out null. It is assigned a value when serial data arrives. Once assigned a value, it can never be null again.
So, your if test should be
if(inString != null && inString.length() > 0)
Then, inside the block, you need to set inString to an empty string.
inString = "";
AFTER getting the value from it.
An else block to go with the if(i > 20) statement would be useful.
In the else block, stop the song from playing.
let me know if im unclear about anything else.
You seem to be unclear on the need to post the Arduino code. Let's clear that up right away. You need to post the Arduino code, too.