Wailing siren

close.thank! :frowning:

Did you have a specific question? I looked at, found what I thought were some structural issues and made some changes.

¯_(ツ)_/¯

#define STATE_NORMAL 0
#define STATE_SHORT 1
#define STATE_LONG 2

static const byte BUTTON_2 = 4;
static const byte SOUND = A0;  // A5
static const char SHORT_PRESSED = 1;
static const char LONG_PRESSED = 2; 

int x = 0;
char mnext;

void setup()
{
    Serial.begin(9600);
    //pinMode(BUTTON_1, INPUT_PULLUP);
    pinMode(BUTTON_2, INPUT_PULLUP);
    pinMode(SOUND, OUTPUT);
    pinMode(13,OUTPUT);
    digitalWrite(13,HIGH);
    mnext=0;
}//setup

void loop() 
{
    if ( digitalRead(BUTTON_2) == LOW ) 
    { 
        //  WAIL #2
        if ( mnext == 0) 
        {
            mnext = 1;
            for( x = 800; x<1200; x++) 
            {
                tone(SOUND,x);
                delayMicroseconds(250);
                if ( digitalRead(BUTTON_2) == HIGH ) 
                {
                    mnext = 3;
                    break;
                }//if
            }//for
        }//if   
      
        if ( mnext == 1) 
        {
            mnext = 2;
            for( x = 1200; x<1300; x++) 
            {
                tone(SOUND,x);
                delayMicroseconds(400);
                if ( digitalRead(BUTTON_2) == HIGH )
                {
                    mnext = 3;
                    break;
                }//if
            }//for
            
            for( x = 1300; x <1650; x++)
            {
                tone(SOUND,x);
                delayMicroseconds(5000);
                if ( digitalRead(BUTTON_2) == HIGH ) 
                {
                    mnext = 3;
                    break;
           
                }//if
                
            }//for
                   
            for( x = 1650; x >750; x--)
            {
                tone(SOUND,x);
                delayMicroseconds(3500);
                if ( digitalRead(BUTTON_2) == HIGH ) 
                {
                    mnext = 3;   
                    break;
           
                }//if 
            }//for
        }//if
               
        if ( mnext == 2 ) 
        {
            mnext = 0;    
            
        }//if
            
        if ( mnext == 3 ) 
        {
            noTone(SOUND);
            mnext = 0;
        }//if
    
        //delay(0);
        
    }//if
    
}//loop

I want:
when pressing the button ---> sound pulls up.
When removing the button ---> the sound pulls down slowly