--- language: - en license: cc-by-nc-4.0 base_model: - m-a-p/SheetSage2 - m-a-p/MERT-v2-FullSong tags: - music - music-transcription - abc-notation - sheetsage2 library_name: diffusers --- # SheetSage2 Diffusers *The YuE2 sample song, turned into the score below with the code below.* Diffusers version of [m-a-p/SheetSage2](https://huggingface.co/m-a-p/SheetSage2) with its [MERT-v2-FullSong](https://huggingface.co/m-a-p/MERT-v2-FullSong) encoder: it listens to a song and writes its lead sheet (melody, chords, beats, key and sections) as an ABC score. This repository holds only weights and configs: run it with the blocks in [OzzyGT/sheetsage2_custom_blocks](https://huggingface.co/OzzyGT/sheetsage2_custom_blocks), which ship the model code. Note: reading audio files needs [FFmpeg](https://ffmpeg.org/). ## Licensing The weights are CC BY-NC 4.0 (non-commercial), from [m-a-p](https://huggingface.co/m-a-p); see `LICENSE`. ## Sample score ```python import torch from diffusers import ModularPipelineBlocks blocks = ModularPipelineBlocks.from_pretrained("OzzyGT/sheetsage2_custom_blocks", trust_remote_code=True) pipe = blocks.init_pipeline() pipe.load_components(dtype=torch.float32) pipe.to("cuda") state = pipe(audio="city_lights.mp3") # task="melody" leaves the chords out print(state.get("abc")) ``` The start of the score: ``` X:1 T: M:4/4 L:1/32 Q:1/4=84 V: Vocal clef=treble name="Vocal Melody" snm="Vocal" V: Ins clef=treble name="Ins Melody" snm="Inst." K:C % intro V: Vocal z24z4"C"z4|"C"z32|"Em"z32|"F"z32| V: Ins z24z4G2G2|c4G4c4G4c4G4c2d2e4|B4G4B4G4B4G4B2c2d4|A8A8A8A8| ... % verse V: Vocal "C"z8e2e4e6d2d6c2d2-|"Em"d6z24z2|"Am"z8c2d4e6d2d6c2A2-|"F"A6z24z2| ``` The score works with [YuE2](https://huggingface.co/OzzyGT/YuE2-Modular): give it as `abc` to sing the same melody in a new style.