Trying to use a buzzer, tone and noTone freeze my program

Not really - PWM implies a single frequency and variable duty-cycle.
tone() uses the timers in CTC (clear timer on compare) mode to give variable frequency.