lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about large-scale use of Pitch objects


From: David Kastrup
Subject: Re: question about large-scale use of Pitch objects
Date: Wed, 08 Aug 2018 17:15:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

David Nalesnik <address@hidden> writes:

> Hi all,
>
> I'm working with very large Scheme lists of pitches in an ly file,
> transforming them, and passing them about from function to function.
> Right now, I'm using actual Pitch objects (such as you would produce
> with ly:make-pitch).  Would it be a better idea to work with pitches
> simply as number lists--for example, (0 0 0) for middle C--and
> instantiate the pitches only at the end when I'm ready for
> typesetting?

No?

> This would of course require writing Scheme versions of
> ly:pitch-transpose, ly:pitch-diff, and the like.
>
> This may be a "try it and see" type of question, but I thought I would
> ask before I embark on such a major revision of my work.

Pitches as a data structure contain one allocation.  In contrast, a list
contains one allocation for each element (short of immediate SCM data
types which small integers are) and one allocation for its containing
cons cell each.  Those allocations are of a "more standard" size but I
doubt that will make all that much of a difference.

So I suspect that you are likely to end up worse than what you started
with.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]