Need help combining 2 sketches

Hello all,

I am very new to the Arduino platform and programming and have been working on a project for my work. I need to combine both sketches so that the Arduino runs the program to “burn in” the lasers and then plays the song at the end when the process is completed. Right now the burn tester sketch has a melody written into it (by ex-coworker), I want to remove this melody and insert the imperial march melody instead. If someone can please help me combine these two it would be much appreciated!!

Burn tester:

int pulse = 13; //labels pin 13 as pulse
#include “pitches.h” //setup for music
int melody = {NOTE_F3,NOTE_F3,NOTE_C4,NOTE_C4,NOTE_F4,NOTE_F4,NOTE_C4,NOTE_C4,
NOTE_F3,NOTE_F3,NOTE_C4,NOTE_C4,NOTE_F4,NOTE_F4,NOTE_C4,NOTE_C4,
NOTE_F3,NOTE_F3,NOTE_C4,NOTE_C4,NOTE_F4,NOTE_F4,NOTE_C4,NOTE_C4,
NOTE_F3,NOTE_F3,NOTE_C4,NOTE_C4,NOTE_F4,NOTE_F4,NOTE_C4,NOTE_C4,
};
int noteDurations = {8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8};
void setup() {
pinMode(pulse,OUTPUT); //sets pulse pin to output
}
void loop() {
//pulse the lasers 100 times for .1 second intervals
for(int x = 0; x < 100; x = x+1) {
digitalWrite(pulse, HIGH);
delay(100);
digitalWrite(pulse, LOW);
delay(100);
}
//laser on for 5 minutes
for(int x = 100; x < 101; x = x+1) {
digitalWrite(pulse, HIGH);
delay(300000);
digitalWrite(pulse, LOW);
delay(5000);
}
//play music
for (int x = 101; x < 134; x++) {

int noteDuration = 1000/noteDurations[x-101];
tone(8, melody[x-101],noteDuration);

int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);

noTone(8);
}
//after 5 seconds laser on for 30 seconds
delay(5000);
digitalWrite(pulse,HIGH);
delay(30000);
digitalWrite(pulse,LOW);
//infinitely delay in 1 second intervals
for (int x=135; x=135; x++) {
digitalWrite(pulse,LOW);
delay(1000);
}
}

Imperial March:

int speakerPin = 12;
//??? ?? pin 12 “speakerPin”

#define c 261
#define d 294
#define e 329
#define f 349
#define g 391
#define gS 415
#define a 440
#define aS 455
#define b 466
#define cH 523
#define cSH 554
#define dH 587
#define dSH 622
#define eH 659
#define fH 698
#define fSH 740
#define gH 784
#define gSH 830
#define aH 880
//?? ??? ??? ??? ??? ?? ???

void setup()
{
pinMode(ledPin,OUTPUT);
//?? pin ?? ??? “ledPin” ?? ??? ???
pinMode(speakerPin, OUTPUT);
//?? pin ?? ??? “speakerPin” ?? ??? ???
}

void loop() // ??? loop
{
march_theme();
}

void beep(unsigned char speakerPin, int frequency, long time)
{
digitalWrite(ledPin, HIGH);
//??? led!

int i;
long delay_time = (long)(1000000/frequency);
long loop_time = (long)((time1000)/(delay_time2));
for (i=0; i<loop_time; i++)
{
digitalWrite(speakerPin,HIGH);
delayMicroseconds(delay_time);
digitalWrite(speakerPin,LOW);
delayMicroseconds(delay_time);
}

digitalWrite(ledPin, LOW);

delay(20);
}

void march_theme()
{
//500 ms ??? ??? ??? ???

beep(speakerPin, a, 500);
beep(speakerPin, a, 500);
beep(speakerPin, a, 500);
beep(speakerPin, f, 350);
beep(speakerPin, cH, 150);

beep(speakerPin, a, 500);
beep(speakerPin, f, 350);
beep(speakerPin, cH, 150);
beep(speakerPin, a, 1000);

beep(speakerPin, eH, 500);
beep(speakerPin, eH, 500);
beep(speakerPin, eH, 500);
beep(speakerPin, fH, 350);
beep(speakerPin, cH, 150);

beep(speakerPin, gS, 500);
beep(speakerPin, f, 350);
beep(speakerPin, cH, 150);
beep(speakerPin, a, 1000);

beep(speakerPin, aH, 500);
beep(speakerPin, a, 350);
beep(speakerPin, a, 150);
beep(speakerPin, aH, 500);
beep(speakerPin, gSH, 250);
beep(speakerPin, gH, 250);

beep(speakerPin, fSH, 125);
beep(speakerPin, fH, 125);
beep(speakerPin, fSH, 250);
delay(250);

beep(speakerPin, aS, 250);
beep(speakerPin, dSH, 500);
beep(speakerPin, dH, 250);
beep(speakerPin, cSH, 250);

beep(speakerPin, cH, 125);
beep(speakerPin, b, 125);
beep(speakerPin, cH, 250);
delay(250);
beep(speakerPin, f, 125);
beep(speakerPin, gS, 500);
beep(speakerPin, f, 375);
beep(speakerPin, a, 125);

beep(speakerPin, cH, 500);
beep(speakerPin, a, 375);
beep(speakerPin, cH, 125);
beep(speakerPin, eH, 1000);

beep(speakerPin, aH, 500);
beep(speakerPin, a, 350);
beep(speakerPin, a, 150);
beep(speakerPin, aH, 500);
beep(speakerPin, gSH, 250);
beep(speakerPin, gH, 250);

beep(speakerPin, fSH, 125);
beep(speakerPin, fH, 125);
beep(speakerPin, fSH, 250);
delay(250);
beep(speakerPin, aS, 250);
beep(speakerPin, dSH, 500);
beep(speakerPin, dH, 250);
beep(speakerPin, cSH, 250);

beep(speakerPin, cH, 125);
beep(speakerPin, b, 125);
beep(speakerPin, cH, 250);
delay(250);
beep(speakerPin, f, 250);
beep(speakerPin, gS, 500);
beep(speakerPin, f, 375);
beep(speakerPin, cH, 125);

beep(speakerPin, a, 500);
beep(speakerPin, f, 375);
beep(speakerPin, c, 125);
beep(speakerPin, a, 1000);
}

for(int x = 100; x < 101; x = x+1) {

Unusual. Why?

IDK, I honestly know little to nothing about code and programming language. I am a hardware build it kinda guy, a ex coworker is the one who wrote the initial program and had a very janky setup for a test unit. I have rebuilt our control fixture and am wanting to change the melody that was originally written into the code.