MusicBoxConverter/README.md

77 lines
3.4 KiB
Markdown
Raw Normal View History

# MusicBoxConverter
> Converts MIDI files into music box scores that are ready to print.
2021-07-24 00:45:47 +00:00
## System Requirements
- Linux:
- [Mono](https://www.mono-project.com/download/stable/) (`dotnet` might work but is untested)
- Windows:
- Visual Studio (the free version is fine - it's just the developer command prompt you need)
- All operating systems:
- [Git](https://git-scm.com/downloads) (`sudo apt install git` on apt-based systems)
- For printing:
- [Inkscape](https://inkscape.org/)
- [ImageMagick](https://imagemagick.org/) (`sudo apt install imagemagick` on apt-based systems)
- [pdfposter](https://pdfposter.readthedocs.io/en/stable/Installation.html) (`sudo apt install pdfposter` on apt-based systems)
2020-04-24 23:41:03 +00:00
## Getting Started
This program is written in C♯. To get started, first clone this repository and compile it:
```bash
git clone https://git.starbeamrainbowlabs.com/sbrl/MusicBoxConverter.git
cd MusicBoxConverter
msbuild
```
2021-07-24 00:45:47 +00:00
This should work regardless of whether you're on Linux or Windows.
If you're on Windows, you'll either need to use a _Visual Studio Developer Command Prompt_ or open the solution file in _Visual Studio_ itself and hit the build button.
2020-04-24 23:41:03 +00:00
2021-07-24 00:45:47 +00:00
Once the build is complete, the binary (and associated libraries) can be found in `MusicBoxConverter/bin/Debug` (or `MusicBoxConverter/bin/Release` if you did a release build).
2021-07-24 01:40:18 +00:00
If you're having trouble building it, please [get in touch](https://starbeamrainbowlabs.com/) and I'll send you a build (when [this bug is fixed](https://github.com/go-gitea/gitea/issues/16526), I'll be able to create a release and upload the binaries there)
2020-04-24 23:41:03 +00:00
2017-12-03 16:52:50 +00:00
## Usage
1. Export the MuseScore file to a MIDI file
2. Run the MIDI file through this program.
3. Open the resulting SVG in Inkscape
2019-02-21 23:11:57 +00:00
4. Print the SVG to PDF (or `inkscape --export-pdf output.pdf input.svg`)
2017-12-03 16:52:50 +00:00
5. Open the resulting PDF in LibreOffice Draw
6. Print to your actual printer - tiling over multiple pages if required.
2021-07-24 00:45:47 +00:00
This somewhat convoluted process prevents anyone from automatically rescaling it along the way, and thus misaligning the green lines in the SVG file generated by the program.
2017-12-03 16:52:50 +00:00
2019-02-21 23:50:40 +00:00
If the above doesn't work, it's probably LibreOffice Draw scaling it even though you've told it not to. In that case, try this:
```bash
# Convert MIDI -> SVG
./MusicBoxConverter.exe --input song.midi --output score.svg
2021-07-24 00:45:47 +00:00
# Convert SVG → PNG
inkscape -o score.png score.svg
# Convert the PNG to PDF, rotating by 90 degrees (for portrait printing)
2019-02-21 23:50:40 +00:00
convert score.png -rotate 90 score.pdf
# Split the PDF up into multiple pages for the printer
# -s1 Don't scale the output
# -m Sets the output paper size. Defaults to A4 (21x29.7cm) if unspecified, but may need to reduce by a cm or 2 on each side (as below) if things get cut off.
2019-02-24 00:36:16 +00:00
pdfposter -s1 -m 20x27.7cm score.pdf print.pdf
2019-02-21 23:50:40 +00:00
```
2019-02-22 01:05:13 +00:00
....if that cuts things off at the edges, try doing it like this:
```bash
convert score.svg score.pdf
pdfposter -s1 score.pdf print.pdf
```
2021-07-24 00:45:47 +00:00
## Useful Links
- [ffmpeg - showspectrumpic manual](https://ffmpeg.org/ffmpeg-filters.html#showspectrumpic)
- [Frequency to Musical Note Converter](https://newt.phys.unsw.edu.au/music/note/)
2021-01-27 19:15:27 +00:00
2021-07-24 00:45:47 +00:00
2021-01-27 19:15:27 +00:00
## License
This project is released under the Mozilla Public License 2.0. The full license text is included in the `LICENSE` file in this repository. Tldr legal have a [great summary](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) of the license if you're interested.