lilypond-devel
[Top][All Lists]
Advanced

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

Re: Yet another 2 patches for music streams


From: Han-Wen Nienhuys
Subject: Re: Yet another 2 patches for music streams
Date: Mon, 22 May 2006 14:13:28 +0200
User-agent: Thunderbird 1.5.0.2 (X11/20060501)

Erik Sandberg schreef:
Also, in general,  I think it should be possible to split patches up
further, eg. the tremolo stuff seems independent of the
partcombine/lyriccombine stuff.

A problem is my limited internet access. I can cvs diff very seldom; I
often work several days on lily between the diffs. This makes it
difficult/troublesome to keep patches atomic.

Currently I keep 3 copies of the lily tree, so I can maintain 2
independent diff branches + one unmodified version; this already leads
to problems (the tremolo stuff was first supposed to go into branch 2,
but was accidentally added to branch 1 instead).

You might want to experiment with some of the newer VC systems. Someone on the list mirrors lilypond CVS with GIT.


>+         dir_ = RIGHT;
>+       }
>+      if (dir == STOP)
>+       {

They don't represent the same thing. RIGHT means that the right
beam-count is modified, STOP means that an event stops a spanner.

I know they don't, that's why I suggest to use different names.

> +      SCM tremolo_symbol = ly_symbol2scm ("TremoloSpanEvent");
>+ SCM start_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (START));
>+      unsmob_music (start_event_scm)->set_spot (*origin);
>+ SCM stop_event_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"), tremolo_symbol, scm_from_int (STOP));
>+
>+      Music *start_event = unsmob_music (start_event_scm);
>+      Music *stop_event = unsmob_music (stop_event_scm);

I think you're leaking memory here, some unprotects are necessary.

The Music objects are created by SCM code, I thought stuff returned
from Scheme was unprotected in general?

Yes, you're right. sorry.

I don't understand. What is this for?

I don't remember right now (I added those lines last summer). It might
be related to problems with grace notes, or somethign like that.
Should I remove hte lines if I can't find a more clear justification?

Yes.

> -     (tremolo-type ,integer? "")
> +     (tremolo-type ,integer? "speed of tremolo, e.g. 16 for c4:16")

hmm. That sucks, we should store the negative log (-4 for 16) rather
than 16.

why negative?

negative log of the duration, log2(1/16) = -4

> +#define LOWLEVEL_MAKE_SYNTAX(proc, args)     \
> +  scm_apply_0 (proc, args)
> +/* Syntactic Sugar. */
>  #define MAKE_SYNTAX(name, location, ...)     \
> - scm_apply_0 (ly_lily_module_constant (name), scm_list_n (make_input (location), __VA_ARGS__, SCM_UNDEFINED)); > + LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant (name), scm_list_n (make_input (location), __VA_ARGS__, SCM_UNDEFINED));
>

I don't see the point of LOWLEVEL_MAKE_SYNTAX

It was used for music functions first, then I found a different way to
implement music functions. The macro can be used to use arbitrary
function objects iso. symbols to represent functions.



I think the proper way is to make it a music macro; is it OK to keep
it a music function until music macros exist? (also, the music
function code attempts to signal errors when \once is used in the
wrong place, so from a user's point of view, little changes)

Why do you want to make it a macro?

>  (define-ly-syntax-loc (repeat type num body alts)
>    (make-repeat type num body alts))
> +
> +(define-ly-syntax-loc (context-specification type id mus ops create-new?)

I believe that according to Scheme coding standards, the ? is only used
on procedures, so this should just be create-new.

ok. I recall seeing a ? in an existing non-procedure symbol in lily;
I'll remove it the next time I see it.

please do.


--

Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com





reply via email to

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