Convert a scratch project file to a MusicXML for Sinsy (Singing Voice Synthesis)

This project is maintained by memakura


Convert a Scratch Project File to a MusicXML for Singing Voice Synthesis

What does this tool do?

How to use

Let’s synthesize vocal part of “Twinkle twinkle little star” using the following score. We code the second measure and after. When the first note is not a rest, an empty measure with a rest will be automatically inserted at the beginning.


Step 1. Prepare a scratch project file (.sb2)

  1. Create a scratch project with lyrics and a melody line. You can refer to or copy a sample project here.
    • Note that the name of the sprite needs to be “song”.
    • Use a pair of “Say …” and “play note … for … beats” for a sound.
    • Use “rest for … beats” for a rest.
    • Use preset variables for duration.
    • Use hyphen to connect multiple syllables.
      • “twin-“ + “kle”
      • “lit-“ + “tle”
      • “won-“ + “der”
    • One note cannot cross over a bar line between measures.
  2. Save/download the scratch project as a sb2 file.
    • Scratch offline editor can also be used after downloading sb2 file.


Step 2. Convert the scratch project file (.sb2) to MusicXML (.xml)

  1. Click the button at the top of this page and upload your scratch project (sb2) file.
  2. Download a generated XML file (song.xml).

Step 3. Input the MusicXML file to Sinsy

  1. Upload the xml file to Sinsy (Singing Voice Synthesis).
  2. Download or play the generated wave file.


Required files for local use

Download the following files from [Download Zip] and save in the same folder.

Synthesized examples by Sinsy

  1. test/song-homesweethome.wav
  2. test/song-furusato.wav
  3. Sing “Happy birthday” with four sprites (online) (generated from Japanese lyrics)



Appendix: Synchronization Test

  1. test/timing-test-homesweethome.sb2
    • Combines a generated wave file and the original scratch project and plays simultaneously.
    • You can find that “song” sprite is slower than wave file.
    • To synchronize precisely, it might be better to use timer in a scratch script.
  2. test/timing-test-furusato.sb2
    • In “song” sprite, variable “beginning-silent-duration” is used to adjust start timing. However, “Song” sprite has some delay especially when many blocks exist.
    • Sprite “Giga” uses “timer”. So it is synchronized precisely with the song (wave file).