Mike0021 commited on
Commit
4afcabe
·
verified ·
1 Parent(s): 2b60549

replace weak examples with verified ensembles

Browse files
.gitattributes CHANGED
@@ -39,3 +39,5 @@ examples/neon-groove.mp3 filter=lfs diff=lfs merge=lfs -text
39
  examples/bach-air-violin-piano.mp3 filter=lfs diff=lfs merge=lfs -text
40
  examples/double-tracked-pop-rock.mp3 filter=lfs diff=lfs merge=lfs -text
41
  examples/livery-stable-blues-jazz-band.mp3 filter=lfs diff=lfs merge=lfs -text
 
 
 
39
  examples/bach-air-violin-piano.mp3 filter=lfs diff=lfs merge=lfs -text
40
  examples/double-tracked-pop-rock.mp3 filter=lfs diff=lfs merge=lfs -text
41
  examples/livery-stable-blues-jazz-band.mp3 filter=lfs diff=lfs merge=lfs -text
42
+ examples/bach-brandenburg-no2-ensemble.mp3 filter=lfs diff=lfs merge=lfs -text
43
+ examples/harry-mitchell-jazz-quartet.mp3 filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -16,7 +16,7 @@ A custom ZeroGPU interface for [MuScriptor](https://github.com/muscriptor/muscri
16
 
17
  The app runs the 307M-parameter medium checkpoint, streams transcription progress after each 5-second audio window, renders an interactive color-coded piano roll, and exports both the full arrangement and isolated instrument MIDI files.
18
 
19
- Three one-click real-music examples are included: a 1920 violin-and-piano performance of Bach's *Air*, the Original Dixieland Jass Band's 1917 *Livery Stable Blues*, and a modern double-tracked pop-rock guitar performance. Their public-domain and Creative Commons provenance is documented in [`examples/README.md`](examples/README.md). Example results are cached lazily after first use so startup never consumes ZeroGPU quota.
20
 
21
  The checkpoint is gated under CC BY-NC 4.0. This Space requires an `HF_TOKEN` secret whose owner has accepted access to [`MuScriptor/muscriptor-medium`](https://huggingface.co/MuScriptor/muscriptor-medium).
22
 
 
16
 
17
  The app runs the 307M-parameter medium checkpoint, streams transcription progress after each 5-second audio window, renders an interactive color-coded piano roll, and exports both the full arrangement and isolated instrument MIDI files.
18
 
19
+ Three one-click real-music examples are included: Bach's *Brandenburg Concerto No. 2* with chamber orchestra, a live modern performance by the Harry Mitchell Quartet, and a double-tracked pop-rock guitar performance. Each example uses verified instrument guidance selected from live quality tests. Their Creative Commons provenance is documented in [`examples/README.md`](examples/README.md). Example results are cached lazily after first use so startup never consumes ZeroGPU quota.
20
 
21
  The checkpoint is gated under CC BY-NC 4.0. This Space requires an `HF_TOKEN` secret whose owner has accepted access to [`MuScriptor/muscriptor-medium`](https://huggingface.co/MuScriptor/muscriptor-medium).
22
 
app.py CHANGED
@@ -473,12 +473,15 @@ def transcribe_audio(
473
 
474
  elapsed = time.perf_counter() - started
475
  notes = _notes_from_events(events)
476
- preview_tracks = _track_payloads(notes, requested)
 
 
 
477
  track_names = [track["key"] for track in preview_tracks]
478
  full_path, track_paths, full_bytes, midi_by_instrument = _write_outputs(
479
  events, track_names
480
  )
481
- tracks = _track_payloads(notes, requested, midi_by_instrument)
482
  print(
483
  "[MuScriptor Studio] "
484
  f"{audio_name}: {duration:.2f}s audio, {len(tracks)} tracks, "
@@ -601,30 +604,35 @@ EXAMPLES_HEADING = """
601
  <div>
602
  <span class="examples-kicker">Try a session</span>
603
  <h2>Start with an example</h2>
604
- <p>Real performances spanning classical, early jazz and layered pop-rock.</p>
605
  </div>
606
- <span class="examples-hint">One click · 10–12 seconds</span>
607
  </div>
608
  """
609
 
610
  EXAMPLE_ROWS = [
611
  [
612
- str(EXAMPLE_ROOT / "bach-air-violin-piano.mp3"),
613
- ["violin", "acoustic_piano"],
614
  False,
615
  1.0,
616
  1,
617
  ],
618
  [
619
- str(EXAMPLE_ROOT / "livery-stable-blues-jazz-band.mp3"),
620
- ["trumpet", "clarinet", "trombone", "drums"],
621
  False,
622
  1.0,
623
  1,
624
  ],
625
  [
626
  str(EXAMPLE_ROOT / "double-tracked-pop-rock.mp3"),
627
- [],
 
 
 
 
 
628
  False,
629
  1.0,
630
  1,
@@ -632,8 +640,8 @@ EXAMPLE_ROWS = [
632
  ]
633
 
634
  EXAMPLE_LABELS = [
635
- "Bach — Air · 1920 violin & piano · 12s",
636
- "Livery Stable Blues · 1917 jazz band · 12s",
637
  "Layered Pop-Rock · real guitars & bass · 10s",
638
  ]
639
 
@@ -745,7 +753,7 @@ with gr.Blocks(title="MuScriptor — Audio to MIDI") as demo:
745
  examples_per_page=3,
746
  example_labels=EXAMPLE_LABELS,
747
  label=None,
748
- elem_id="examples-gallery",
749
  api_visibility="private",
750
  api_name="load_example",
751
  )
 
473
 
474
  elapsed = time.perf_counter() - started
475
  notes = _notes_from_events(events)
476
+ # Instrument hints guide decoding, but a hinted instrument with no
477
+ # decoded notes is not a real output track. Keep hinted placeholders
478
+ # during progress, then export only non-empty detections.
479
+ preview_tracks = _track_payloads(notes)
480
  track_names = [track["key"] for track in preview_tracks]
481
  full_path, track_paths, full_bytes, midi_by_instrument = _write_outputs(
482
  events, track_names
483
  )
484
+ tracks = _track_payloads(notes, midi_by_instrument=midi_by_instrument)
485
  print(
486
  "[MuScriptor Studio] "
487
  f"{audio_name}: {duration:.2f}s audio, {len(tracks)} tracks, "
 
604
  <div>
605
  <span class="examples-kicker">Try a session</span>
606
  <h2>Start with an example</h2>
607
+ <p>Real performances spanning chamber orchestra, modern jazz and layered pop-rock.</p>
608
  </div>
609
+ <span class="examples-hint">One click · 10–14 seconds</span>
610
  </div>
611
  """
612
 
613
  EXAMPLE_ROWS = [
614
  [
615
+ str(EXAMPLE_ROOT / "bach-brandenburg-no2-ensemble.mp3"),
616
+ ["trumpet", "flutes", "oboe", "string_ensemble"],
617
  False,
618
  1.0,
619
  1,
620
  ],
621
  [
622
+ str(EXAMPLE_ROOT / "harry-mitchell-jazz-quartet.mp3"),
623
+ ["acoustic_piano", "tenor_sax", "acoustic_bass", "drums"],
624
  False,
625
  1.0,
626
  1,
627
  ],
628
  [
629
  str(EXAMPLE_ROOT / "double-tracked-pop-rock.mp3"),
630
+ [
631
+ "distorted_electric_guitar",
632
+ "acoustic_guitar",
633
+ "electric_bass",
634
+ "drums",
635
+ ],
636
  False,
637
  1.0,
638
  1,
 
640
  ]
641
 
642
  EXAMPLE_LABELS = [
643
+ "Bach — Brandenburg No. 2 · chamber orchestra · 12s",
644
+ "Harry Mitchell Quartet · live jazz · 14s",
645
  "Layered Pop-Rock · real guitars & bass · 10s",
646
  ]
647
 
 
753
  examples_per_page=3,
754
  example_labels=EXAMPLE_LABELS,
755
  label=None,
756
+ elem_id="examples-gallery-v2",
757
  api_visibility="private",
758
  api_name="load_example",
759
  )
examples/README.md CHANGED
@@ -1,22 +1,22 @@
1
  # Real-music example audio
2
 
3
- These examples are excerpts from genuine performances hosted by Wikimedia Commons. Each source, recording license, excerpt range, and modification is documented below. The clips were shortened, given brief edge fades, and transcoded to stereo 44.1 kHz MP3 at 112 kbps for this Space.
4
 
5
- ## Bach — Air on the G String
6
 
7
- - File: `bach-air-violin-piano.mp3`
8
- - Recording: J. S. Bach, *Air on the G String* (BWV 1068), recorded in 1920; Joel Belov, violin, with Robert Gayler, piano.
9
- - Source: [Air (Bach).ogg — Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Air_(Bach).ogg)
10
- - Rights: [Public Domain Mark 1.0](https://creativecommons.org/publicdomain/mark/1.0/); Commons identifies the recording as free of known copyright restrictions, including related and neighboring rights.
11
- - Modification: excerpt `03:1603:28`, shortened to 12 seconds, faded at the cut boundaries, and transcoded to MP3.
12
 
13
- ## Livery Stable Blues
14
 
15
- - File: `livery-stable-blues-jazz-band.mp3`
16
- - Recording: *Livery Stable Blues* by the Original Dixieland Jass Band, recorded 26 February 1917; cornet, clarinet, trombone, piano, and traps.
17
- - Source: [1917 alternate edit — Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Original_Dixieland_Jass_Band_-_Livery_Stable_Blues_(1917)_alternate_edit.ogg)
18
- - Rights: public-domain composition and U.S. public-domain sound recording under 17 U.S.C. § 1401 because it was published before 1926. Adam Cuerden also released the restoration edits into the public domain. The Commons page notes that public-domain status may differ outside the United States.
19
- - Modification: excerpt `00:28–00:40`, shortened to 12 seconds, faded at the cut boundaries, and transcoded to MP3.
20
 
21
  ## Layered Pop-Rock
22
 
 
1
  # Real-music example audio
2
 
3
+ These examples are excerpts from genuine performances hosted by Wikimedia Commons. Each source, recording license, excerpt range, and modification is documented below. The clips were shortened, given brief edge fades, loudness-normalized where needed, and transcoded to compact 44.1 kHz MP3 files for this Space.
4
 
5
+ ## Bach — Brandenburg Concerto No. 2
6
 
7
+ - File: `bach-brandenburg-no2-ensemble.mp3`
8
+ - Recording: J. S. Bach, *Brandenburg Concerto No. 2 in F major*, first movement; Vince DiMartino with the Lexington Bach Choir Orchestra. The excerpt features trumpet, recorder/flute, oboe, violin, and ensemble strings.
9
+ - Source: [Brandenburg Concerto No. 2 — Wikimedia Commons](https://commons.wikimedia.org/wiki/File:IMSLP83563_-_Brandenburg_Concerto_No.2_in_F_major,_BWV_1047_(Bach,_Johann_Sebastian)_-_1._(Allegro).ogg)
10
+ - Rights: [Creative Commons Attribution 3.0 Unported](https://creativecommons.org/licenses/by/3.0/).
11
+ - Modification: excerpt `00:0400:16`, shortened to 12 seconds, loudness-normalized, faded at the cut boundaries, and transcoded to MP3.
12
 
13
+ ## Harry Mitchell Quartet
14
 
15
+ - File: `harry-mitchell-jazz-quartet.mp3`
16
+ - Recording: a 2022 live performance by pianist Harry Mitchell with Jamie Oehlers on tenor saxophone, Karl Florisson on upright bass, and Ben Vanderwal on drums. The four musicians and instruments are visible in the source video; the lineup is also documented on [Harry Mitchell's official site](https://harrymitchell.net/shows).
17
+ - Source: [Harry Mitchell Quartet recording — Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Harry_Mitchell_Quartet_recording.webm), uploaded by Jack4576.
18
+ - Rights: [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/).
19
+ - Modification: excerpt `00:00.5–00:14.5`, shortened to 14 seconds, faded at the cut boundaries, and transcoded to MP3.
20
 
21
  ## Layered Pop-Rock
22
 
examples/{bach-air-violin-piano.mp3 → bach-brandenburg-no2-ensemble.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e7f34cae592a9532bbd747ba96ac4a10082095139bffbb622ce0d0759d91e4c0
3
- size 169004
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:352928346fbb50f728e3dde5285d69b2e1322a542e5ca0c25a1e4d87b00c1b6f
3
+ size 193141
examples/{livery-stable-blues-jazz-band.mp3 → harry-mitchell-jazz-quartet.mp3} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b247235d48ac85e87ee77dd85947151dde31ef8db16ed92b4ae59771d35c9bfa
3
- size 169004
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c606fc3d041d6f69d0410060b658304ba0a321643a67eeb7770b0df50ffb0ee9
3
+ size 225009