Dan Eble [Sat, 2 May 2015 02:21:43 +0000 (22:21 -0400)]
Issue 4365: non-member unsmob<T> replaces T::unsmob and T::is_smob
Hide Smob_base<>::is_smob() to prevent the misleading situation of
D::is_smob(S) returning true when S represents an ancestor of D rather
than a D. This issue was previously worked around by overriding
is_smob in several derived smob classes; that is no longer needed.
LY_ASSERT_SMOB() now returns a smob pointer. This is not used yet,
but is available for future use to avoid unsmobbing twice.
Smob_base<>::smob_p() is hidden because there doesn't seem to be a
need for it to be public.
Files in lily/include were edited by hand. Files in lily itself were
processed with the following sed script.
David Kastrup [Sun, 17 May 2015 10:04:32 +0000 (12:04 +0200)]
Issue 4400: Rework LY_DECLARE_SMOB_PROC to declare a member function
This is nicer to work with. LY_DECLARE_SMOB_PROC now needs to
additionally get the class name for declaring the smob procedure: this
is astonishingly hard to avoid. Moving the initialization out of
Smob_base<Super>::init into a separate routine smob_proc_init defined by
LY_DECLARE_SMOB_PROC considerably simplifies the initialization.
were done as hotfixes (apparently without associated tracker issues) to
get the current implementation of smobs to compile with old versions of
GCC in GUB as of Oct 2014. The attempts to make these versions of GCC
work were ultimately unsuccessful and GUB was upgraded to newer versions
of GCC.
It does not make sense to retain the workarounds that did not really
help.
David Kastrup [Tue, 12 May 2015 17:01:57 +0000 (19:01 +0200)]
Issue 2787: Sanitize usage of -DDEBUG, -DNDEBUG and assert
The compiler option -DNDEBUG is no longer being used: -DNDEBUG disables
the assert function, and assert is essentially stating that the program
cannot useful continue if the assertion is not met. -DNDEBUG is
basically an option for compiling an application to a limited amount of
ROM when aborting with a diagnostic is not preferable to crashing.
This is not the case for LilyPond. So expensive debugging options now
are enabled with -DDEBUG instead. There is a new configure option
--enable-checking defaulting to "off" for this now.
At the current point of time, setting --disable-optimising also has the
effect of enabling the checks: this will be retained until Patchy has
been adapted to using --enable-checking.
David Kastrup [Wed, 13 May 2015 08:55:45 +0000 (10:55 +0200)]
Issue 4394: NR: use -@code{s}/-@code{-sharp} for alteration suffix description
The previously used -s/--sharp in the pitch alteration suffix table did
not render in a sufficiently recognizable manner, making it hard to
guess that the proper note name would be `a-sharp' rather than `asharp'.
David Kastrup [Mon, 11 May 2015 15:47:46 +0000 (17:47 +0200)]
Issue 4389: Add aliases fflat et al for f-flat et al in bagpipe.ly
While the name conversion of issue 4209 is also done for bagpipe music,
as opposed to "normal" music the respective note names have no short
names and thus can be expected to be used in melodies rather than just
in isolated places like \key commands.
As the change is consequently much more likely to inconvenience bagpipe
players, aliases for the old names are added to bagpipe.ly.
David Kastrup [Sun, 17 May 2015 17:28:06 +0000 (19:28 +0200)]
Run scripts/auxiliar/update-with-convert-ly.sh
Afterwards revert all changes in Documentation/snippets/*.ly (thus
retaining Documentation/snippets/new), then run
scripts/auxiliar/makelsr.py, leaving only the files in
Documentation/snippets/new and their versions in Documentation/snippets
converted: if we don't want to retain the automatic conversion rule, we
only want to keep those files which do not get reconverted on reimport.
As a followup to the commits for issue 3245, this conversion rule
replaces uses of \relative with reference pitch by those without
reference pitch for a number of patterns where convert-ly can detect the
first actual note reliably.
The rule is prepared to skip over files containing \include or \language
with a non-c-using notename language since the patterns do not work for
them.
However, this part of the rule is disabled in this commit as it turns
out that the LilyPond code base converts well (and more thoroughly)
without it.
Dan Eble [Mon, 11 May 2015 02:02:34 +0000 (22:02 -0400)]
Issue 4385: Part_combine_iterator: remove residue related to marks
This could have been removed when the generation of mark events was
moved from C++ to Scheme in aae8f9ee8f62e8a57f4f60a60e639a040571f37b,
but it went unnoticed at that time.
On Cygwin environment,
Guile's uname returns the strings of "CYGWIN_NT-6.3" etc.
It contains unnecessary strings for the platform identification,
such as Windows version.
Therefore, to remove them to return the only "cygwin".
David Kastrup [Sun, 10 May 2015 14:03:42 +0000 (16:03 +0200)]
Issue 4372: convert-ly misses some bflat -> b-flat
In python/convert-rules.py, using '\b' for note name boundaries turns
out to be too audacious since bflat4 is one word. A proper solution
would be to match the variable wordsyntax and let the match expression
use a replacement function that triggers on the right words. However,
such a large number of matches would be expensive. So instead we are
using positive lookahead and lookbehind expressions to get reasonably
good matches.
David Kastrup [Wed, 6 May 2015 22:30:18 +0000 (00:30 +0200)]
Issue 4376: Add LY_ASSERT_DERIVED_SMOB macro
When LY_ASSERT_SMOB is called with a class that is actually derived from
some smobified base class providing is_smob and unsmob, the resulting
check and error message are inaccurate. This patch uses dynamic_cast to
implement a separate LY_ASSERT_DERIVED_SMOB attaining sensible behavior
in that case. When no derivation is involved, the performance impact is
minimal.
David Kastrup [Fri, 8 May 2015 09:04:01 +0000 (11:04 +0200)]
Issue 4378: Rewrite Protected_scm for static lifetime requirements
The use of Protected_scm is required where the per-instance object
marking mechanisms don't work. This patch changes its semantics to
cater exclusively for the use case of permanent variable life time (as
opposed to permanent value life time). It no longer employs the
reversible scm_gc_protect_object but rather uses scm_permanent_object
for protecting one cons cell as its principal storage mechanism.
It is also ensured that construction/destruction (which happen at very
early/late phases of program execution) do not require a working memory
subsystem.
David Kastrup [Thu, 7 May 2015 19:22:20 +0000 (21:22 +0200)]
Issue 4377: Run a script for using derived_unsmob where obvious
Script is:
matched="[^()]*"
for i in 1 2 3 4 5
do
matched="\\(($matched)\\|[^()]\\)*"
done
filelist="$(git grep -l '\<dynamic_cast[^>]*> ([_a-zA-Z]*::unsmob\>')"
typelist="$(sed -n 's/^.*\<dynamic_cast\s*<\([_a-zA-Z]\+\)\s*\*> (\([_a-zA-Z]*\)::unsmob\>.*$/\1/p' $filelist | sort -u )"
for typ in $typelist
do
# crazy: we have unsmob definitions that are not even used
if git grep -q "$typ::unsmob" || git grep -q "\\<$typ"'\s*\*\s*unsmob\s*(SCM'
then
echo "There already is $typ::unsmob"
sed -i '/unsmob (SCM/,/;/!s/\<dynamic_cast\s*<\('"$typ"'\)\s*\*> (\([_a-zA-Z]*\)::unsmob\s*(\('"$matched"'\))\s*)/\1::unsmob (\3)/g' $filelist
else
sed -i 's/\<dynamic_cast\s*<\('"$typ"'\)\s*\*> (\([_a-zA-Z]*\)::unsmob\s*(\('"$matched"'\))\s*)/derived_unsmob<\1> (\3)/g' $filelist
fi
done
The awkward bit at the start of the script is for matching matched
parentheses. This replaces the construct
dynamic_cast<T *>(xxx::unsmob (yyy))
with
derived_unsmob<T> (yyy)
where appropriate. If T::unsmob already exists, it is used
instead (apart from inside of its own definition, of course).
James Lowe [Thu, 19 Mar 2015 13:14:19 +0000 (13:14 +0000)]
Doc: NR section 3.5.x MIDI file creation tidy up
Issue 2877
I feel we're constantly updating a
'messy' chapter that doesn't really
follow many of the CG guidelines and
so could be better organized.
Apart from some @cindex or @seealso
references no new information and
nothing technical has been removed
but the information has been
reorganized so that it is (I hope)
grouped more logically.
Some snippets have been created from
the original text as they were
inappropriate for the NR.
The @lilypond examples have been simplified
and turned into @examples instead as the
engraving output is largely irrelevant
in a section about MIDI; saving space.
Trevor Daniels [Fri, 1 May 2015 21:56:47 +0000 (22:56 +0100)]
Issue 3687 (part 2): Amend docs to use \compressMMRests
Amend the examples in the LM and NR to use the \compressMMRests
music function rather than the predefs \compressFullBarRests and
\expandFullBarRests to avoid advocating the use of techniques
which may have undesirable side effects.
Issue 3687 (part 1): Provide a compress MM function for MM rests only
Multi-measure rests were previously compressed (i.e. all bars
following the first were removed) by using the \compressFullBarRests
predef. This simply turned on 'skipBars, which causes bar lines at
the ends of bars which contain either no rhythmic event or contain
a rhythmic event with a duration extending beyond the bar to be removed.
Such bars are generated by notes with durations longer than a bar,
like a1*3, or by shorter notes which extend beyond the bar.
This patch provides a function which also uses 'skipBars, but with
a filter so that 'skipBars is activated only when an actual MM rest
is encountered and deactivated by the first following rhythmic event.
Carl Sorensen [Sat, 25 Apr 2015 03:07:51 +0000 (21:07 -0600)]
Fix issue 4355 -- broken beam subdivision
When beams are subdivided, the number of beams joining the subdivisions
should match the length of the subdivision. Previously, the subdivisions
were joined by a single beam.
David Kastrup [Thu, 30 Apr 2015 18:48:09 +0000 (20:48 +0200)]
Issue 4360: Reorganize smob initialization to make it more reliable
This change is a nuisance in that it requires an explicit call to
ADD_SMOB_INIT for each Scheme-related class.
However, this setup guarantees that at the point Scheme execution
commences, all predicates of the likes of "ly:grob?" will be present.
It also guarantees that if a particular type should seem required during
_other_ initializations that happen to depend on the type and get
executed earlier, it will be provided early.
David Kastrup [Fri, 1 May 2015 22:35:35 +0000 (00:35 +0200)]
Issue 4364: Allow ImageMagick's compare to exit with status 1
Apparently Ubuntu 15.04 has a version of "compare" that cannot be easily
persuaded to return anything but exit status 1 (which indicates
dissimilar images but no actual error condition) so we allow this in
script/build/output-distance.py in order to keep "make check" from
failing.
This patch is somewhat artless but does the trick.