Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1599)

Side by Side Diff: ly/music-functions-init.ly

Issue 5695059: Improving \harmonicBy... functions (Closed) Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Patch Set: Changed 'above' to 'at' in description Created 13 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 %%%% -*- Mode: Scheme -*- 1 %%%% -*- Mode: Scheme -*-
2 2
3 %%%% This file is part of LilyPond, the GNU music typesetter. 3 %%%% This file is part of LilyPond, the GNU music typesetter.
4 %%%% 4 %%%%
5 %%%% Copyright (C) 2003--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> 5 %%%% Copyright (C) 2003--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 %%%% Jan Nieuwenhuizen <janneke@gnu.org> 6 %%%% Jan Nieuwenhuizen <janneke@gnu.org>
7 %%%% 7 %%%%
8 %%%% LilyPond is free software: you can redistribute it and/or modify 8 %%%% LilyPond is free software: you can redistribute it and/or modify
9 %%%% it under the terms of the GNU General Public License as published by 9 %%%% it under the terms of the GNU General Public License as published by
10 %%%% the Free Software Foundation, either version 3 of the License, or 10 %%%% the Free Software Foundation, either version 3 of the License, or
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 grobdescriptions = 367 grobdescriptions =
368 #(define-scheme-function (parser location descriptions) (list?) 368 #(define-scheme-function (parser location descriptions) (list?)
369 (_i "Create a context modification from @var{descriptions}, a list 369 (_i "Create a context modification from @var{descriptions}, a list
370 in the format of @code{all-grob-descriptions}.") 370 in the format of @code{all-grob-descriptions}.")
371 (ly:make-context-mod 371 (ly:make-context-mod
372 (map (lambda (p) 372 (map (lambda (p)
373 (list 'assign (car p) (list (cdr p)))) 373 (list 'assign (car p) (list (cdr p))))
374 descriptions))) 374 descriptions)))
375 375
376 harmonicByFret = #(define-music-function (parser location fret music) (number? l y:music?) 376 harmonicByFret = #(define-music-function (parser location fret music) (number? l y:music?)
377 (_i "Convert @var{music} into harmonics; the resulting notes resemble 377 (_i "Convert @var{music} into mixed harmonics; the resulting notes resemble
378 harmonics played on a fretted instrument by touching the strings above @var{fret }.") 378 harmonics played on a fretted instrument by touching the strings at @var{fret}." )
379 (let* ((fret (number->string fret)) 379 (let* ((fret (number->string fret))
380 (pitch (fret->pitch fret))) 380 (pitch (fret->pitch fret)))
381 (make-sequential-music 381 (make-sequential-music
382 (list 382 (list
383 #{ 383 #{
384 \set harmonicDots = ##t
384 \override TabNoteHead #'stencil = #(tab-note-head::print-custom-fret -label fret) 385 \override TabNoteHead #'stencil = #(tab-note-head::print-custom-fret -label fret)
386 \override NoteHead #'Y-extent = #(ly:make-unpure-pure-container
387 ly:grob::stencil-height
388 (lambda (grob start end)
389 (ly:grob::stencil-heigh t grob)))
390 \override NoteHead #'stencil = #(lambda (grob) (ly:grob-set-property ! grob 'style 'harmonic-mixed)
391 (ly:note-head::print grob))
385 #} 392 #}
386 (make-harmonic 393 (make-harmonic
dak 2012/02/24 14:32:31 As each #{...#} carries a bit of overhead, there i
387 (calc-harmonic-pitch pitch music)) 394 (calc-harmonic-pitch pitch music))
388 #{ 395 #{
396 \unset harmonicDots
389 \revert TabNoteHead #'stencil 397 \revert TabNoteHead #'stencil
398 \revert NoteHead #'Y-extent
399 \revert NoteHead #'stencil
390 #})))) 400 #}))))
391 401
392 harmonicByRatio = #(define-music-function (parser location ratio music) (number? ly:music?) 402 harmonicByRatio = #(define-music-function (parser location ratio music) (number? ly:music?)
393 (_i "Convert @var{music} into harmonics; the resulting notes resemble 403 (_i "Convert @var{music} into mixed harmonics; the resulting notes resemble
394 harmonics played on a fretted instrument by touching the strings above the point 404 harmonics played on a fretted instrument by touching the strings at the point
395 given through @var{ratio}.") 405 given through @var{ratio}.")
396 (let ((pitch (ratio->pitch ratio)) 406 (let ((pitch (ratio->pitch ratio))
397 (fret (ratio->fret ratio))) 407 (fret (ratio->fret ratio)))
398 (make-sequential-music 408 (make-sequential-music
399 (list 409 (list
400 #{ 410 #{
411 \set harmonicDots = ##t
401 \override TabNoteHead #'stencil = #(tab-note-head::print-custom-fret- label fret) 412 \override TabNoteHead #'stencil = #(tab-note-head::print-custom-fret- label fret)
413 \override NoteHead #'Y-extent = #(ly:make-unpure-pure-container
414 ly:grob::stencil-height
415 (lambda (grob start end)
416 (ly:grob::stencil-height grob)))
417 \override NoteHead #'stencil = #(lambda (grob) (ly:grob-set-property! grob 'style 'harmonic-mixed)
418 (ly:note-head::print grob))
402 #} 419 #}
403 (make-harmonic 420 (make-harmonic
404 (calc-harmonic-pitch pitch music)) 421 (calc-harmonic-pitch pitch music))
405 #{ 422 #{
423 \unset harmonicDots
406 \revert TabNoteHead #'stencil 424 \revert TabNoteHead #'stencil
425 \revert NoteHead #'Y-extent
426 \revert NoteHead #'stencil
407 #})))) 427 #}))))
408 428
409 instrumentSwitch = 429 instrumentSwitch =
410 #(define-music-function 430 #(define-music-function
411 (parser location name) (string?) 431 (parser location name) (string?)
412 (_i "Switch instrument to @var{name}, which must be predefined with 432 (_i "Switch instrument to @var{name}, which must be predefined with
413 @code{\\addInstrumentDefinition}.") 433 @code{\\addInstrumentDefinition}.")
414 (let* ((handle (assoc name instrument-definitions)) 434 (let* ((handle (assoc name instrument-definitions))
415 (instrument-def (if handle (cdr handle) '()))) 435 (instrument-def (if handle (cdr handle) '())))
416 436
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 Use this if you want to have a scheme expression evaluated 1156 Use this if you want to have a scheme expression evaluated
1137 because of its side-effects, but its value ignored.")) 1157 because of its side-effects, but its value ignored."))
1138 1158
1139 withMusicProperty = 1159 withMusicProperty =
1140 #(define-music-function (parser location sym val music) 1160 #(define-music-function (parser location sym val music)
1141 (symbol? scheme? ly:music?) 1161 (symbol? scheme? ly:music?)
1142 (_i "Set @var{sym} to @var{val} in @var{music}.") 1162 (_i "Set @var{sym} to @var{val} in @var{music}.")
1143 1163
1144 (set! (ly:music-property music sym) val) 1164 (set! (ly:music-property music sym) val)
1145 music) 1165 music)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b