[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (top-repl): suggestions for a demo?
From: |
Jean Abou Samra |
Subject: |
Re: (top-repl): suggestions for a demo? |
Date: |
Wed, 28 Dec 2022 12:26:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 |
Le 19/12/2022 à 01:59, Eduardo Ochs a écrit :
Can anyone give me some examples of how to use the REPL to inspect
some interesting variables and data structures? I am hoping to get
something like a 5-line demo that I can use as a starting point...
This is a late reply, but try this:
\version "2.24.0"
mus = { c'1 <>\< \after 4 \! d'2 }
\include "scheme-sandbox.ly"
{ \mus }
$ ~/lilies/2.24.0/bin/lilypond test.ly
GNU LilyPond 2.24.0 (running Guile 2.2)
Processing `test.ly'
Parsing...
GNU Guile 2.2.7
Copyright (C) 1995-2019 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(#{ g100}#)> mus
[lots of output deleted]
scheme@(#{ g100}#)> (display-scheme-music mus)
(make-music
'SequentialMusic
'elements
(list (make-music
'NoteEvent
'duration
(ly:make-duration 0)
'pitch
(ly:make-pitch 0 0))
(make-music
'EventChord
'elements
(list (make-music 'CrescendoEvent 'span-direction -1)))
(make-music
'ContextSpeccedMusic
'property-operations
'()
'context-type
'Bottom
'element
(make-music
'SimultaneousMusic
'elements
(list (make-music
'SequentialMusic
'elements
(list (make-music
'SkipMusic
'duration
(ly:make-duration 2))
(make-music
'EventChord
'elements
(list (make-music
'CrescendoEvent
'span-direction
1)))))
(make-music
'NoteEvent
'duration
(ly:make-duration 1)
'pitch
(ly:make-pitch 0 1)))))))
scheme@(#{ g100}#)> (display-lily-music mus)
{ c'1 < >\< \after 4 \! d'2 }
scheme@(#{ g100}#)> (exit)
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Converting to `test.pdf'...
Success: compilation successfully completed
Keep in mind, though, that LilyPond doesn't operate in a single pass,
so "what LilyPond knows about the file at the current point" isn't
all that much: it has just desugared some high-level constructs like
\after into simpler music expressions. The story of what happens to
those music expressions afterwards is complicated.
Best,
Jean
OpenPGP_signature
Description: OpenPGP digital signature