A tiny graphical user interface that turns a HTML Flowkey page into a clean, paginated PDF of the sheet music.
⭐ Stay Updated & Like if you find it usefull, This helps me know people are interested, and I’ll post updates or improvements there.
This project is provided for educational and personal use only.
- You may use this tool to generate sheet music only for your own practice, in accordance with your Flowkey subscription.
- Do not use this tool to publish, distribute, or share copyrighted music scores obtained from Flowkey or any third-party service.
- Any misuse of this tool may violate copyright law and Flowkey’s terms of service.
- See the LICENSE file for full details.
- Save a HTML file from your internet browser.
- run the code to start the graphical user interface
- select parameters for the final layout ( measures per line, zoom..)
- Click "save PDF" and print the music sheet !
- Reads your saved HTML/HTM file.
- Extracts all sheet images into an
images/folder beside the HTML. - Detects barlines and wraps lines only at measure boundaries.
- Builds an A4 PDF with your chosen layout.
Clone this repository:
git clone https://github.com/pmgarderes/FlowkeyPracticePDF.git
cd FlowkeyPracticePDFInstall dependencies (Python 3.8+ recommended):
pip install -r requirements.txt- Open the song in your browser.
- (might be needed- see later) Scroll through all pages so every sheet image loads.
- Save the page locally (e.g., right-click-> “Save page as…” → Webpage, Complete).
- You’ll get
SongName.htm(l)in a folder you choose.
- You’ll get
python flowkey2pdf_gui_debug.py-
Select HTML/HTM…
Pick the.html/.htmyou saved. The app auto-fills theimages/folder beside it. -
1) Extract Images
- Downloads/copies every page of the sheet into
<html_folder>\images\sheet_###.png. - If it says “No images”, make sure you scrolled the whole song before saving.
- Downloads/copies every page of the sheet into
-
Set layout
- Measures per line: e.g.,
4.0(average target). - Zoom:
< 1.0= smaller (more content per page),> 1.0= larger. - Hard threshold (binarize tiles) (optional): check this only if some images appear with a colored or tinted background (e.g., green hue).
When enabled, it converts each tile to pure black & white before stitching. Normally this should stay unchecked, since it can slightly thin out staff lines.
- Measures per line: e.g.,
-
(Optional) Show advanced/debug
- Threshold: leave blank to auto-detect (Otsu on normalized grayscale), or type a number (e.g.,
200). - Min height %: how much of the staff height a vertical line must cover to count as a barline (default 50).
- Min continuous %: how uninterrupted that vertical line must be (default 50).
- Probe detection saves overlays (
debug/folder) showing detected bars (red) and measure boundaries (green).
Note: If you notice missing lines or other problems, please enable debugging, check “Save debug overlays”, and send me the resulting images from the
debug/folder together with the parameters you used — this will help identify the issue. - Threshold: leave blank to auto-detect (Otsu on normalized grayscale), or type a number (e.g.,
-
Build PDF
- Choose the output filename.
- The app writes a clean A4 PDF with no gaps between measures.
- Select HTML → Extract Images
- Measures per line =
4.0, Zoom =0.9 - (Optional) Probe detection → check
debug/overlay_*.png - Build PDF
YourSongFolder/
├─ YourSong.htm(l)
├─ images/
│ ├─ sheet_001.png
│ ├─ sheet_002.png
│ └─ ...
├─ debug/ (only if you used debugging)
│ ├─ stitched.png
│ ├─ stitched_gray.png
│ ├─ gray_norm.png
│ ├─ binary_norm_thrXXX.png
│ └─ overlay_thr...png
└─ YourPDF.pdf
This project is licensed under a Personal, Non-Commercial Use License.
See LICENSE for details.
-
Green-tinted pages?
The app converts images to grayscale internally before layout—this eliminates palette/ICC issues. If you still see tint, ensure you’re running the latest script and not an older version still in memory. -
“No images found”
- Scroll the whole piece before saving the HTML.
- Some songs may use different selectors; default is
.sheet-container .scrollable-sheet .sheet-image.
-
“No measures detected” or wrong splits
- Click Show advanced/debug → Probe detection.
- Try a Threshold of
180–210, or leave blank for auto. - If barlines don’t span both staves: set Min height % to
45, Min continuous % to45. - Check
debug/overlay_*.pngto see what the detector saw.
-
Paths / permissions
- If saving to OneDrive causes “Access denied”, choose another folder.
- The GUI uses a file picker, so you don’t need to type paths.
-
Speed
- Large songs: the first stitch/scale is the slowest step. It only happens once per “Build PDF”.