No signal on UART1 TX pin with RPi Pico

Hello everyone,
I'm trying to build RPi Pico based MIDI clock source. The screen, the rotary encoder, the interruptions work perfectly but I just can't get any data on the UART1 TX pin (GPIO 4, pin 6 on the board). I checked all the connections and monitored the voltage on my oscilloscope. The voltage remains at zero. I tried with and without the 'Serial1.begin(31250)' before and after the 'MIDI.begin(MIDI_CHANNEL_OMNI);': nothing changed. I tried reassigning the UART1 TX pin to GPIO4: the microcontroller freezes. I tried sending data on UART0 and it sends data over USB but not over the UART0 TX pin. Could someone help me please ?

#include <TM1637Display.h>
#include <SimpleEncoder.h>
#include <RPi_Pico_TimerInterrupt.h>
#include <MIDI.h>
#define CLK 26
#define DIO 27
#define BUTTON_PIN 28
#define PINA 21
#define PINB 20

TM1637Display display(CLK, DIO);
float bpm = 60.0;
volatile unsigned int MIDIClockCounter = 0;
volatile bool MIDIClock = false;
SimpleEncoder encoder(BUTTON_PIN, PINA, PINB);
RPI_PICO_Timer ITimer0(0);
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI);

bool tick(struct repeating_timer *t){
  MIDIClock = true;
  MIDIClockCounter = (MIDIClockCounter+1) % 96;
  return true;
}

void setup() {
  Serial1.begin(31250);
  MIDI.begin(MIDI_CHANNEL_OMNI);
  display.setBrightness(0x0a);
  attachInterrupt(digitalPinToInterrupt(PINA), readEncoder, CHANGE);
  ITimer0.attachInterruptInterval((1/((bpm/60)*96)*1000000), tick);
}

void loop() {
  if(encoder.BUTTON_PRESSED){
    MIDI.sendRealTime(midi::Start);
    ITimer0.setInterval((1/((bpm/60)*96)*1000000), tick);
  }
  if(MIDIClockCounter >= 0 && MIDIClockCounter < 48){
    display.showNumberDecEx(bpm, 0b11110000);
  }
  else{
    display.showNumberDec(bpm);
  }
  noInterrupts();
  if(MIDIClock){
    MIDI.sendRealTime(midi::Clock);
    MIDIClock = false;
  }
  interrupts();
}

void readEncoder() {
  if (encoder.RIGHT) {
    bpm = (bpm + 0.5);
  }
  else {
    bpm = (bpm - 0.5);
  }
  if(bpm > 9999){
    bpm = 0.0;
  }
  else if(bpm < 0){
    bpm = 9999.5;
  }
}

UART0 is Serial1 on GPIO0 and 1.
UART1 is Serial2 on GPIO4 and 5.

Jumper pins 6 & 7 on a Pico and try this sketch.

void setup() {
   Serial.begin(115200);
   delay(2000);
   Serial2.setTX(4);
   Serial2.setRX(5);
   Serial2.begin(31250);
   Serial2.println("Hello world!\n");
}

void loop() {
   while( Serial2.available() ) {
      Serial.print((char)Serial2.read());
   }
}