Recipes
A recipe gives an agent the steps of a larger job, for example the copy of a PDF score. The guide tool of the MCP server gives the agent the same text as this page.
Use a recipe
Name the recipe in your request, for example: "Use the transcribe-pdf recipe to copy ~/Downloads/minuet.pdf to ~/Scores/minuet.mj." The agent then gets the steps from guide.
In Claude Code, each recipe is also a slash command: /mcp__modaljazz__transcribe-pdf, and so on.
transcribe-pdf: Copy the music of a PDF score into a ModalJazz score.import-musicxml: Make a ModalJazz score from a MusicXML file, and check it.fix-measures: Read, change, and check a range of measures.
Programs that a recipe can use
Some recipes use other programs if they are installed. The guide tool tells the agent which of them are on your Mac. You do not need them, but a recipe works better with them.
| Program | For | Install with Homebrew |
|---|---|---|
pdftoppm (poppler) | Pictures of the pages of a PDF | brew install poppler |
gs (Ghostscript) | Pictures of the pages of a PDF, if pdftoppm is not installed | brew install ghostscript |
An agent does not install a program without your permission.
transcribe-pdf
Copy the music of a PDF score into a ModalJazz score.
Can use: pdftoppm, gs
-
Ask the user if the program that made the PDF can export MusicXML. If it can, use that file and follow the
import-musicxmlrecipe. MusicXML is more exact than a picture of the page. -
Make a PNG image of each page at about 150 dpi:
- With
pdftoppm(poppler):pdftoppm -png -r 150 score.pdf page. - With
gs(Ghostscript), ifpdftoppmis not installed:gs -dNOPAUSE -dBATCH -sDEVICE=png16m -r150 -sOutputFile=page-%d.png score.pdf. - If neither program is installed, tell the user. Do not install software without asking the user.
- With
-
Look at the first page. Find the title, the composer, the parts, the key, the time, and the tempo.
-
Make the score:
new_scorewith a new path and the nearest template, for examplepiano. The new score has eight empty measures.run_commandwith:instrumentto add, remove, move, or rename parts. Put the label of the part in front, asscore_summaryshows it::P3 instrument rename "Tenor",:P5 instrument brace off. With no label,:instrumentacts on P1. In a name,|starts a new line::P1 instrument rename "S|A"stacks "S" over "A".run_commandwith:title,:composer,:key,:time, and:tempo.run_commandwith:bars +Nto get the number of measures of the PDF.
Then call
score_summaryto see the staff labels. -
Call
text_formatonce and read it before you write. -
Write one page, or one system, with each
write_measurescall. Large writes are fast and correct, so do not cut the music into small steps of a few measures. -
After each write, read the same measures back with
read_measures. Compare the text with the page image: the notes, the rhythm, the ties, the accidentals, the dynamics, and the marks. Fix each error before you write the next page. This check is the most important step. -
At the end, call
score_summary, and compare the number of measures with the PDF. Callcheck_collisions: for each line, look at the measure in the page image, and write the measure again with the mark where the PDF has it (another side, as!p:above, or another time). Callsave.
import-musicxml
Make a ModalJazz score from a MusicXML file, and check it.
- Call
score_summarywith the MusicXML file (.musicxml,.xml, or.mxl). The tools read the file. The reply shows the import warnings, if there are any. - Read the measures that the warnings name with
read_measures. Fix them withwrite_measuresorrun_command. - Read some measures from the start, the middle, and the end of the score. Compare them with the original, if the user can show it.
- Call
savewithtoset to a path that ends in.mj. The MusicXML file does not change.
fix-measures
Read, change, and check a range of measures.
- Call
score_summaryto see the staff labels and the number of measures. - Read the measures with
read_measures. Givestavesto read only some staves. - Make the change:
- Use
run_commandfor a change that a:command can make, for example:5-8 transpose +P8or:5 key D.list_commandsshows the commands. - Use
write_measuresfor other changes. Write all the lines of a staff for each measure in the range. A staff with no line in the text does not change.
- Use
- Read the same measures again, and check that the change is correct.
If it is not correct, call
undoand try again. - Call
savewhen the user wants the change in the file.