I dare you to make a song with this code

//This is a music player capable of making more than one tone, poor tone(), this works by basically making a fast
//multiplexing that combines all the virtual channels into a single pin, wich is D9, this can go from one to 16
//virtual channels, this also has the capacity of making percussion A.K.A. noise in chiptunes, wich you can extract
//from the pin D3, this is basically a combination of the Namco N163 and the Texas Instruments SN76489 audio processing 
//units.
//Changing the number of virtual channels is quite tricky, ill let some /*like these*/ on the code to indicate where to edit.
//I dare you to make a song, ill let a small guide in the code to rise or lower the amount of virtual channels

//Above 0 makes a tone, on 0 makes a pause, this only applies to virtual channels
//Below 0 (-1) makes a noise sound, and on 0 makes a pause, this only applies to the Noise channel

//!!!WARNING!!!
//This only works with AVR microcontrollers due to the use of AVR pheripherals
//If you are doing this on an ESP32, watch a tutorial for changing the pheripherals
//from AVR to ESP or any other board

#include <avr/pgmspace.h>

const int pinTone  = 9; // PB1 → audio
const int pinNoise = 3; // PD3 → noise

#define NOISE_CH 3 //I reccomend assigning the last virtual channel to this
#define SAMPLE_RATE 31250UL
#define NUM_CHANNELS 4 //Change the number according to the numbers of channels you have or want

// ====== CHANNELS ======
struct Channel {
  uint16_t freq;
  uint16_t tickDiv;
  uint16_t phase;
  uint8_t state;

  const int16_t* seq;
  const int16_t* dur;
  uint16_t index;

  unsigned long nextTime;
};

Channel ch[NUM_CHANNELS];

// ====== NOISE ======
volatile uint16_t lfsr = 0xACE1;
volatile uint8_t noiseOut = 0;
volatile uint8_t noiseEnable = 0;
volatile unsigned long noiseOffTime = 0;

// ====== DATA ======
const int16_t seq1[] PROGMEM = {/*Put your frequencies here*/};
const int16_t dur1[] PROGMEM = {/*Put your pause moments here*/};

const int16_t seq2[] PROGMEM = {/*Put your frequencies here*/};
const int16_t dur2[] PROGMEM = {/*Put your pause moments here*/};

const int16_t seq3[] PROGMEM = {/*Put your frequencies here*/};
const int16_t dur3[] PROGMEM = {/*Put your pause moments here*/};

//Add or remove the amount of blocks you want here 

//Noise channel
const int16_t seq4[] PROGMEM = {-1,0,-1,0,-1,0,-1,0};
const int16_t dur4[] PROGMEM = {500,500,500,500,500,500,500,500};

const int seqSize = 8; //Modify this according to the amount of sequences and durations your song
                      //does have, if they are not equal the player will cut or will start to read trash data

// ====== SET FREQ ======
void setFreq(uint8_t i, int16_t freq){

  // ===== NOISE CHANNEL =====
  if(i == NOISE_CH){

    if(freq == -1){
      noiseEnable = 1;
      noiseOffTime = millis() + 30;
    }

    if(freq == 0){
      noiseEnable = 0;
    }

    ch[i].tickDiv = 0;
    ch[i].phase = 0;
    ch[i].state = 0;
    return;
  }

  // ===== TONE =====
  if(freq == 0){
    ch[i].tickDiv = 0;
    ch[i].phase = 0;
    ch[i].state = 0;
    return;
  }

uint16_t div = (SAMPLE_RATE + (freq)) / (freq * 2);
  if(div == 0) div = 1;

  ch[i].tickDiv = div;
}

// ====== TIMER1 → TONES ======
ISR(TIMER1_COMPA_vect) {

  uint8_t mix = 0;

  for(uint8_t i=0;i<NUM_CHANNELS;i++){

    if(i == NOISE_CH) continue;

    if(ch[i].tickDiv){
      ch[i].phase++;
      if(ch[i].phase >= ch[i].tickDiv){
        ch[i].phase = 0;
        ch[i].state ^= 1;
      }
      mix |= ch[i].state;
    }
  }

  if(mix) PORTB |= (1 << PORTB1);
  else    PORTB &= ~(1 << PORTB1);
}

// ====== TIMER2 → NOISE + OUTPUT ======
ISR(TIMER2_COMPA_vect) {

  uint16_t bit = ((lfsr >> 0) ^ (lfsr >> 6)) & 1;
  lfsr = (lfsr >> 1) | (bit << 15);
  noiseOut = lfsr & 1;

  // Output to pin 3 (PD3)
  if(noiseEnable && noiseOut){
    PORTD |= (1 << PORTD3);
  } else {
    PORTD &= ~(1 << PORTD3);
  }
}

// ====== UPDATE ======
void updateChannel(uint8_t i){
  if(millis() >= ch[i].nextTime){

    int16_t f = pgm_read_word(&ch[i].seq[ch[i].index]);
    int16_t d = pgm_read_word(&ch[i].dur[ch[i].index]);

    setFreq(i, f);

    ch[i].nextTime = millis() + d;

    ch[i].index++;
    if(ch[i].index >= seqSize) ch[i].index = 0;
  }
}

// ====== SETUP ======
void setup() {

  pinMode(pinTone, OUTPUT);
  pinMode(pinNoise, OUTPUT);

  ch[0].seq = seq1; ch[0].dur = dur1;
  ch[1].seq = seq2; ch[1].dur = dur2;
  ch[2].seq = seq3; ch[2].dur = dur3;
  ch[3].seq = seq4; ch[3].dur = dur4;
  //Add or remove play sections according to your amount of channels

  for(int i=0;i<NUM_CHANNELS;i++){
    ch[i].index = 0;
    ch[i].nextTime = 0;
    ch[i].phase = 0;
    ch[i].state = 0;
    ch[i].tickDiv = 0;
  }

  noInterrupts();

  // Timer1 (audio)
  TCCR1A = 0;
  TCCR1B = 0;
  OCR1A = 511;
  TCCR1B |= (1 << WGM12);
  TCCR1B |= (1 << CS10);
  TIMSK1 |= (1 << OCIE1A);

  // Timer2 (noise)
  TCCR2A = 0;
  TCCR2B = 0;
  OCR2A = 63;
  TCCR2A |= (1 << WGM21);
  TCCR2B |= (1 << CS20);
  TIMSK2 |= (1 << OCIE2A);

  interrupts();
}

// ====== LOOP ======
void loop() {

  for(uint8_t i=0;i<NUM_CHANNELS;i++){
    updateChannel(i);
  }

  if(millis() > noiseOffTime){
    noiseEnable = 0;
  }
}

I don't understand the topic. What is the process?

The OP wants you to make a copy of the code, figure out (without any guidance or instruction) how to put appropriate note frequency and timing data into the array definitions, and use an AVR processor with appropriate speakers to play a song.

Insert arrays of tones from pitches.h and pause lengths in three voices.

i found out that this actual code makes a raspy sound in the speaker, according to the oscilloscope the OR operation is messsing up with the channels and distorts it, with a XOR operation just silences it, im working on a new code so it doesnt get too distorted and its able to sound decently

the app Frequency Sound Generator in Android or pitches.h allows you to hit the precise note, and a MIDI player or FamiTracker/Studio allows you to hit the exact tempo and timing, its a little more catchy with the tempo but its possible, im working at a super mario tone rn and im using FamiStudio to hit the exact tempo