From the ATtiny48 data sheet(PDF). The example he starts with sets the tone, a simple analog input to trigger once a certain level is reached. Using an analog read function followed by a compare ...