Skip to content

5.Example Barney Miller Theme audio to tab

ScottVR edited this page Nov 4, 2026 · 1 revision

Written for gtrsnipe v0.2, whose mapper chose each note's position greedily. Since v0.3.0:

  • the default mapper optimizes the whole piece, so the tab below may come out differently today; add --optimizer greedy for the v0.2 mapper;
  • Basic-Pitch has been removed, and librosa's pYIN, described below, is the only pitch detector;
  • audio input needs pip install 'gtrsnipe[audio]', and --stem-track (Demucs) also needs pip install 'gtrsnipe[separation]'.

SO the machine learning model I started out with turns out to be too good at detecting pitch bends and small nuances in timings etc so i was unable to get any usable MIDI to transcribe to TAB from Basic-Pitch. Instead, I rolled my own pitch detection (well, I rolled librosa's implementation of pYIN into gtrsnipe ) the old-fashioned way to reasonable success.

The trade-off is that this average pitch detection is by virtue monophonic so I was limited to testing on bass or some other instrument part not likely to be played polyphonically (or be noticed that it was not.) I needed a good bass-line for gtrsnipe to try to transcribe from the actual audio so I went to YouTube and found a clip of the opening theme song to Barney Miller. I converted the youtube video to an mp3 with ffmpeg, then fed the mp3 to demucs_6s to isolate the bass part into its own WAV file. I read this WAV with librosa.pYIN for frequency estimation on it and output the resulting pitches to MIDI notes, which were then consumed by the gtrsnipe fretboard mapper algorithm to give us this totally decent tab for the bass line to Barney Miller.

Note (v0.6.10): the command in the tab's header below no longer runs as shown: --pre-quantize is gone, and pre-quantizing is on by default (--no-pre-quantize turns it off). Today's command is the same without it:

gtrsnipe -i barney_miller.mp3 --pitch-engine librosa -o barney_miller-bass.tab --bass --stem-track bass --dedupe -y --quantization-resolution 0.0625 --max-line-width 80 --sweet-spot-high 5 --fretted-open-penalty 0 --string-switch-penalty 0
// Title: barney_miller
// Tempo: 172 BPM
// Time: 4/4
// Tuning (High to Low): G2 D2 A1 E1

// Transcribed with: gtrsnipe -i x:\barney_miller.mp3 --pitch-engine librosa -o barney_miller-bass.tab --bass --stem-track bass --dedupe -y --quantization-resolution 0.0625 --pre-quantize --max-line-width 80 --sweet-spot-high 5 --fretted-open-penalty 0 --string-switch-penalty 0


G|-------------------------|-----------------|
D|-------------------------|-----------------|
A|-------------------------|-----1--h2--h3--3|
E|----1-----3--h4--4--h5---|-----------------|

G|----------------------------------------------|---------------------|
D|-------------------------------------3--------|---------------------|
A|---3---h5---h6---p5--p3--3---------------5--p3|--------------------0|
E|-----------------------------6--p5------------|--1-----3---h4-------|

G|------------------------------|---------------------------------------------|
D|------------------------------|---------------------------------------------|
A|----1--h2---h3--3-----3--3--h5|--h6---p5---p3-------------6---p3------------|
E|------------------------------|-----------------6---p5-------------1----1---|

G|---------------------------------------------|
D|---------------------------------------------|
A|-----------------------2--h3----3--h5--h6--p5|
E|---1---h3--3--h5----6------------------------|

G|---------------------------------------------------|
D|--------------3------------------------------------|
A|--p3--p1--p0-----5--p3----------------------------2|
E|------------------------1---1----3--h4--h5-----6---|

G|------------------------------------------1---1---------|
D|----------------------------------3--p2------------1--h3|
A|--h3----3--h5--h6--p5--p3-------------------------------|
E|---------------------------5--h6------------------------|

G|--1-----1-----------1--h5---5--h6---6--h7---7--7--h8--------1|
D|-----3-------1--h3---------------------------------------3---|
A|------------------------------------------------------6------|
E|-------------------------------------------------------------|

G|-----1---1-------------1---h5--5--h6--h7--h8--------------|
D|--3-------------1--h3----------------------------3--------|
A|-------------0--------------------------------5----------0|
E|-----------------------------------------------------1----|

G|----------------------------------------------------|
D|-----------------1---h2---h3--p1--h3-----------0---0|
A|--0--0---0--h1--------------------5--------1--------|
E|---------------------------------------1------------|

G|------------------------------------------------------------|
D|--h1--1--h2---h3-----------------------1--1--h2--2--h3------|
A|------------------------0---0--h1---1-----------------------|
E|-------------------1------------------------------------1--1|

G|----------------------------1--1---1-----------1---|
D|-------------------3-----3--------------1--h3-----3|
A|---3--h5---p3--h5-----5----------------------------|
E|---------------------------------------------------|

G|--1------------------5---p4--h6----7--7--7----------------1|
D|------1---h3-----6---------------------------------3--p1---|
A|--------------5-----------------------------6---6----------|
E|-----------------------------------------------------------|

G|--1-----------1-----1--------------1-----5------6----|
D|-------1--h3-----3-----1--1---h3------4------6-------|
A|----------------------------------------------------5|
E|-----------------------------------------------------|

G|--6--6--h7--7--h8------------------------0--h2--h3--h4---4----|
D|--------------------------------------------------------------|
A|-----------------------------2---2---2------------------------|
E|-------------------5--5--h6----------------------------------5|

G|-----------------2---2--h3--3---p2--h3--h4---------|
D|---------------------------------------------------|
A|------2--2--2--------------------------------2---p0|
E|--h6-----------------------------------------------|

G|------------2--h3--3-------------------------------|---------------------|
D|---------4-----------------------------------------|--1--h4--h5--h6------|
A|--2--2-----------------2---2---------------2---2--2|---------------------|
E|-------------------------------4---h5--5-----------|--------------------1|

G|--------------------------------------------------|
D|--------------------------------------------------|
A|------------------------2--h3----3--h5--h6--p5--p3|
E|---3--h4--h5----5---h6----------------------------|

G|----------------------------------------|
D|----------3-----------------------------|
A|--p1--p0-----5--p3--------0----1--h2--h3|
E|--------------------1-------------------|

G|--------------------------------------------------------|
D|--------------------------------------------------------|
A|---3---3--h5--5---p3--p1--p0--h4--h5--p3----------------|
E|------------------------------------------1----3--h4--h5|

G|--------------------------------------------------|
D|-------------------------------------------0--0---|
A|-------2--h3----3--h5--h6--p5--p3--p1--p0--------3|
E|----6---------------------------------------------|

G|---------------------------------|
D|---------------------------------|
A|-----------------------2--h3----3|
E|--1----3--h4--h5----6------------|

G|-------------------------------------1---1-----------1--1--1|
D|--------------------------3--p1--h3-----------1--h3---------|
A|--h5--h6--6--p5--p3--p1-------------------------------------|
E|------------------------------------------------------------|

G|---------3--h5---5--h6---6--h7---7--7--h8--------------1---1|
D|--1--h3------------------------------------------3--3-------|
A|-------------------------------------------6--6-------------|
E|------------------------------------------------------------|

G|---------1--1---h3---p1---------1---h5---5--h6--6---h7--7--7|
D|--2--h3------------------0--h1------------------------------|
A|------------------------------------------------------------|
E|------------------------------------------------------------|

G|--h8---------1---1---1----------1-----1----------------1---1|
D|----------3--------------1--h3-----3------1--1--h3--3-------|
A|-------6----------------------------------------------------|
E|------------------------------------------------------------|

G|--h5---5--h6--6---6--h7--7---7--7--h8---------------1--1|
D|-----------------------------------------6-------3------|
A|----------------------------------------------6---------|
E|--------------------------------------------------------|

G|--------------------1---1------------1-----------------|
D|--3---p1--h3--3--3-----------1--h3---------------------|
A|-------------------------------------------------------|
E|----------------------------------------4--p3---p2---p1|

G|----------------------------|
D|----------------------------|
A|-----------------3-----3--h5|
E|----3--h4--h5---------------|

G|-------------------------------------------------|
D|----------------------0--------------------------|
A|--h6--p5--p3--p1--p0------3---------------------2|
E|-----------------------------1-----3--h4--h5-----|

G|-----------------------------------------------|
D|--------------------------------3--------------|
A|---h3----3--h5--h6--p5-------------5--p3-------|
E|------------------------6---p5------------1---1|

G|----------------------------------------------------|
D|----------------------------------------------------|
A|------------------2--h3----3--h5--h6--p4--p3--p1--p0|
E|--3--h4--h5----6------------------------------------|

G|---------------------------------------|
D|--3------------------------------------|
A|-----3----------------------------2--h3|
E|---------1---1----3--h4--h5----6-------|

G|----------------------------------1---1-----------1-----1|
D|------------------------------3------------1--h3-----3---|
A|---3--h5--h6--p4--p3--p1--1------------------------------|
E|---------------------------------------------------------|

G|-----------1--h5---5--h6---6--h7---7--7--h8---------------1|
D|----1--h3------------------------------------------3--p1---|
A|---------------------------------------------6--6----------|
E|-----------------------------------------------------------|

G|--1-----------1--1--h5-----6--h7--7------------------|
D|-------1--h3------------5---------------3------------|
A|-------------------------------------6-----------0--0|
E|--------------------------------------------1--------|

G|---------------------------------------------------------|
D|-------------0--h2--2--h3---3------------0---0--h1--1--h2|
A|--0--0--h1---------------------------1-------------------|
E|--------------------------------1------------------------|

G|--------------------------------------------------|
D|--h3---3-----------0---0--h1--1--h2---h3--3-------|
A|---------------1---------------------------------3|
E|-----------1---------------------------------1----|

G|---------------------------------------------1-----1------|
D|-------------------3--3--h5--h6---6-------3-----3-----1--1|
A|--h5---p3--h5--5-----------------------6------------------|
E|----------------------------------------------------------|

G|-------1--h5---5--h6---6--h7---7--7--h8---------------1---1|
D|--h3-------------------------------------------3--p1-------|
A|-----------------------------------------6--6--------------|
E|-----------------------------------------------------------|

G|-------------1-----1--------------1-----5---h6--6------6--h7--7|
D|--1--h3--p1-----3------1--1--h3------4-------------------------|
A|----------------------------------------------------5----------|
E|---------------------------------------------------------------|

G|--h8---------------------4---p2--2--h3--h4---4----------|
D|--------------------------------------------------------|
A|-----------------2---2---------------------------------2|
E|-------5--h6--6---------------------------------5--h6---|

G|------4--4------2--h3--h4---p2--h3--h4--------------|
D|-------------4--------------------------------------|
A|--2--------------------------------------2---p0----2|
E|----------------------------------------------------|

G|-----3--3----------4-------------------4-----------0|
D|--4--------------------------------------------1----|
A|-----------2---2-------------------2-------2--------|
E|-----------------------4---h5--5--------------------|

Clone this wiki locally