Beeper sounds wrong

Here we go my 50 cents. I’ve made some tones and we can select each one with parameters

[gcode_macro PLAY_TONE]
gcode:
     {% set l = params.L|default(0)|int %}

   {% if l == 1 %} ; play first tone #Here we go
     M300 P184 S392
     M300 P184 S523
     M300 P187 S659
     M300 P417 S784
     M300 P139 S659
     M300 P400 S784  

   {% elif l == 2 %} #play second tone #Mario Death
     M300 P146 S494
     M300 P97 S698
     M300 P157 S0
     M300 P132 S698
     M300 P174 S698
     M300 P168 S659
     M300 P176 S587
     M300 P134 S523
     M300 P95 S330
     M300 P31 S0
   
  {% elif l == 3 %} #play second tone #MarioWorld start theme
    M300 P100 S659
    M300 P200 S659
    M300 P99 S659
    M300 P101 S0
    M300 P100 S523
    M300 P99 S659
    M300 P101 S0
    M300 P199 S784
    M300 P201 S0
    M300 P199 S392

   {% elif l == 4 %} #play third tone #Ode to joy
    M300 P353 S330
    M300 P353 S330
    M300 P353 S349
    M300 P353 S392
    M300 P353 S392
    M300 P353 S349
    M300 P353 S330
    M300 P353 S294
    M300 P353 S262
    M300 P353 S262
    M300 P353 S294
    M300 P353 S330
    M300 P529 S330
    M300 P176 S294
    M300 P706 S294

   {% else %}
     M300 P100 S0 #play nothing
   {% endif %}