[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about large-scale use of Pitch objects
From: |
David Nalesnik |
Subject: |
Re: question about large-scale use of Pitch objects |
Date: |
Wed, 8 Aug 2018 10:25:29 -0500 |
On Wed, Aug 8, 2018 at 10:15 AM David Kastrup <address@hidden> wrote:
>
> 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.
>
Thank you, David, for your explanation. This will save me quite a bit
of wasted effort.
David N.