MIDI file is generated correctly with only piano.

## Track 2

Measure 001

0x00000040: 000000 0000 2 dt=0000 Sequence/Track Name: “Piano”

0x00000049: 000000 0000 2 dt=0000 Program Change: 0x00

0x0000004c: 000000 0000 2 dt=0000 +++ a1 dur=408

0x00000050: 000000 0000 2 dt=0000 +++ a dur=1632

0x00000053: 000408 0408 2 dt=0408 — a1 dur=0

0x00000058: 000474 0474 2 dt=0066 +++ h1 dur=414

0x0000005c: 000888 0888 2 dt=0414 — h1 dur=0

0x00000061: 000961 0961 2 dt=0073 +++ a1 dur=407

0x00000065: 001368 1368 2 dt=0407 — a1 dur=0

0x0000006a: 001439 1439 2 dt=0071 +++ h1 dur=409

0x0000006e: 001632 1632 2 dt=0193 — a dur=0

0x00000073: 001848 1848 2 dt=0216 — h1 dur=0

0x00000077: 001918 1918 2 dt=0070 +++ a dur=1634

With a Violin one hears in Midi file buzz/hum.

Also with an empty line for Violin the hum is generated.

The tone F1# is activated, it is the note with the index 30 decimal.

I this note not used but.

You can check it, why it is so?

Legend:

1.column: Hex-Postion in File

dt=… : delta-time µs

+++ : note on

— : note off

dur= duration

Track 2

Measure 001

0x00000040: 000000 0000 2 dt=0000 Sequence/Track Name: “Violin”

0x0000004a: 000000 0000 2 dt=0000 Program Change: 0x28

0x0000004d: 000000 0000 2 dt=0000 +++ F1# dur=7678 <==== This is the mistake

0x00000051: 000000 0000 2 dt=0000 Controller Change: 0x01 0x3f

Measure 004

0x00000055: 007678 0000 2 dt=7678 — F1# dur=0

0x0000005a: 007678 0000 2 dt=0000 End of Track

## Track 3

Measure 001

0x00000066: 000000 0000 3 dt=0000 Sequence/Track Name: “Piano”

0x0000006f: 000000 0000 3 dt=0000 Program Change: 0x00

0x00000072: 000000 0000 3 dt=0000 +++ a1 dur=408

0x00000076: 000000 0000 3 dt=0000 +++ a dur=1632

0x00000079: 000408 0408 3 dt=0408 — a1 dur=0

0x0000007e: 000474 0474 3 dt=0066 +++ h1 dur=414

0x00000082: 000888 0888 3 dt=0414 — h1 dur=0

0x00000087: 000961 0961 3 dt=0073 +++ a1 dur=407

0x0000008b: 001368 1368 3 dt=0407 — a1 dur=0

0x00000090: 001439 1439 3 dt=0071 +++ h1 dur=409

0x00000094: 001632 1632 3 dt=0193 — a dur=0

0x00000099: 001848 1848 3 dt=0216 — h1 dur=0

0x0000009d: 001918 1918 3 dt=0070 +++ a dur=1634

_midi-error.zip (1.04 MB)