OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl> |
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> | 4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 3843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3854 (let ((len (match:substring match 1)) | 3854 (let ((len (match:substring match 1)) |
3855 (dots (match:substring match 2))) | 3855 (dots (match:substring match 2))) |
3856 (list (cond ((string=? len "breve") -1) | 3856 (list (cond ((string=? len "breve") -1) |
3857 ((string=? len "longa") -2) | 3857 ((string=? len "longa") -2) |
3858 ((string=? len "maxima") -3) | 3858 ((string=? len "maxima") -3) |
3859 (else (log2 (string->number len)))) | 3859 (else (log2 (string->number len)))) |
3860 (if dots (string-length dots) 0))) | 3860 (if dots (string-length dots) 0))) |
3861 (ly:error (_ "not a valid duration string: ~a") duration-string)))) | 3861 (ly:error (_ "not a valid duration string: ~a") duration-string)))) |
3862 | 3862 |
3863 (define-markup-command (note layout props duration dir) | 3863 (define-markup-command (note layout props duration dir) |
3864 (string? number?) | 3864 (ly:duration? number?) |
3865 #:category music | 3865 #:category music |
3866 #:properties (note-by-number-markup) | 3866 #:properties (note-by-number-markup) |
3867 " | 3867 " |
3868 @cindex notes within text by string | 3868 @cindex notes within text by duration |
3869 | 3869 |
3870 This produces a note with a stem pointing in @var{dir} direction, with | 3870 This produces a note with a stem pointing in @var{dir} direction, with |
3871 the @var{duration} for the note head type and augmentation dots. For | 3871 the @var{duration} for the note head type and augmentation dots. For |
3872 example, @code{\\note #\"4.\" #-0.75} creates a dotted quarter note, with | 3872 example, @code{\\note @{4.@} #-0.75} creates a dotted quarter note, with |
3873 a shortened down stem. | 3873 a shortened down stem. |
3874 | 3874 |
3875 @lilypond[verbatim,quote] | 3875 @lilypond[verbatim,quote] |
3876 \\markup { | 3876 \\markup { |
3877 \\override #'(style . cross) { | 3877 \\override #'(style . cross) { |
3878 \\note #\"4..\" #UP | 3878 \\note {4..} #UP |
3879 } | 3879 } |
3880 \\hspace #2 | 3880 \\hspace #2 |
3881 \\note #\"breve\" #0 | 3881 \\note {\\breve} #0 |
3882 } | 3882 } |
3883 @end lilypond" | 3883 @end lilypond" |
3884 (let ((parsed (parse-simple-duration duration))) | 3884 (note-by-number-markup layout props |
3885 (note-by-number-markup layout props (car parsed) (cadr parsed) dir))) | 3885 (ly:duration-log duration) |
| 3886 (ly:duration-dot-count duration) |
| 3887 dir)) |
3886 | 3888 |
3887 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3889 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3888 ;; the rest command. | 3890 ;; the rest command. |
3889 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3891 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3890 | 3892 |
3891 (define-markup-command (rest-by-number layout props log dot-count) | 3893 (define-markup-command (rest-by-number layout props log dot-count) |
3892 (number? number?) | 3894 (number? number?) |
3893 #:category music | 3895 #:category music |
3894 #:properties ((font-size 0) | 3896 #:properties ((font-size 0) |
3895 (style '()) | 3897 (style '()) |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4429 (markup?) | 4431 (markup?) |
4430 #:category graphic | 4432 #:category graphic |
4431 " | 4433 " |
4432 @cindex placing vertical brackets around text | 4434 @cindex placing vertical brackets around text |
4433 | 4435 |
4434 Draw vertical brackets around @var{arg}. | 4436 Draw vertical brackets around @var{arg}. |
4435 | 4437 |
4436 @lilypond[verbatim,quote] | 4438 @lilypond[verbatim,quote] |
4437 \\markup { | 4439 \\markup { |
4438 \\bracket { | 4440 \\bracket { |
4439 \\note #\"2.\" #UP | 4441 \\note {2.} #UP |
4440 } | 4442 } |
4441 } | 4443 } |
4442 @end lilypond" | 4444 @end lilypond" |
4443 (let ((th 0.1) ;; todo: take from GROB. | 4445 (let ((th 0.1) ;; todo: take from GROB. |
4444 (m (interpret-markup layout props arg))) | 4446 (m (interpret-markup layout props arg))) |
4445 (bracketify-stencil m Y th (* 2.5 th) th))) | 4447 (bracketify-stencil m Y th (* 2.5 th) th))) |
4446 | 4448 |
4447 (define-markup-command (parenthesize layout props arg) | 4449 (define-markup-command (parenthesize layout props arg) |
4448 (markup?) | 4450 (markup?) |
4449 #:category graphic | 4451 #:category graphic |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4902 (throw key | 4904 (throw key |
4903 (interpret-markup-list | 4905 (interpret-markup-list |
4904 layout props args))) | 4906 layout props args))) |
4905 (make-null-markup)))))) | 4907 (make-null-markup)))))) |
4906 (lambda (key stencils) | 4908 (lambda (key stencils) |
4907 (map | 4909 (map |
4908 (lambda (sten) | 4910 (lambda (sten) |
4909 (interpret-markup layout props | 4911 (interpret-markup layout props |
4910 (compose (make-stencil-markup sten)))) | 4912 (compose (make-stencil-markup sten)))) |
4911 stencils))))) | 4913 stencils))))) |
OLD | NEW |