Hi,
#+begin_src lilypond :file ionian.png
\version "2.24.1"
\relative c' {
c d e f
g a b c
b a g f
e d c d
e f g a
b c b a
g f e d
c1
}
#+end_src
Adding #(ly:set-option 'crop #t) to the file gives a cropped output in the file 'ionian.cropped.png' but the ionian.png is still fullpage. I was looking in ob-lilypond to change the outputfile name but the easy solution is to just give the cropped name as the :file argument:
:file ionian.cropped.png
Then the file is shown inline in the #+RESULT: block. This works for other file formats two, like pdf and eps.
Here's a short version:
#+begin_src lilypond :file ionian.cropped.png
\Version "2.24.1"
#(ly:set-option 'crop #t)
\relative c' {
c d e f
}
#+end_src