+(defmacro-public define-music-function rest
+ "Defining macro returning music functions.
+Syntax:
+ (define-music-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
+ ...function body...)
+
+argX-type can take one of the forms @code{predicate?} for mandatory
+arguments satisfying the predicate, @code{(predicate?)} for optional
+parameters of that type defaulting to @code{#f}, @code{@w{(predicate?
+value)}} for optional parameters with a specified default
+value (evaluated at definition time). An optional parameter can be
+omitted in a call only when it can't get confused with a following
+parameter of different type.
+
+Predicates with syntactical significance are @code{ly:pitch?},
+@code{ly:duration?}, @code{ly:music?}, @code{markup?}. Other
+predicates require the parameter to be entered as Scheme expression.
+
+Must return a music expression. The @code{origin} is automatically
+set to the @code{location} parameter."
+
+ `(define-syntax-function (ly:music? (make-music 'Music 'void #t)) ,@rest))
+
+
+(defmacro-public define-scheme-function rest
+ "Defining macro returning Scheme functions.
+Syntax:
+ (define-scheme-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
+ ...function body...)
+
+argX-type can take one of the forms @code{predicate?} for mandatory
+arguments satisfying the predicate, @code{(predicate?)} for optional
+parameters of that type defaulting to @code{#f}, @code{@w{(predicate?
+value)}} for optional parameters with a specified default
+value (evaluated at definition time). An optional parameter can be
+omitted in a call only when it can't get confused with a following
+parameter of different type.
+
+Predicates with syntactical significance are @code{ly:pitch?},
+@code{ly:duration?}, @code{ly:music?}, @code{markup?}. Other
+predicates require the parameter to be entered as Scheme expression.
+
+Can return arbitrary expressions. If a music expression is returned,
+its @code{origin} is automatically set to the @code{location}
+parameter."
+
+ `(define-syntax-function scheme? ,@rest))
+
+(defmacro-public define-void-function rest
+ "This defines a Scheme function like @code{define-scheme-function} with
+void return value (i.e., what most Guile functions with `unspecified'
+value return). Use this when defining functions for executing actions
+rather than returning values, to keep Lilypond from trying to interpret
+the return value."
+ `(define-syntax-function (void? *unspecified*) ,@rest *unspecified*))
+
+(defmacro-public define-event-function rest
+ "Defining macro returning event functions.
+Syntax:
+ (define-event-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
+ ...function body...)
+
+argX-type can take one of the forms @code{predicate?} for mandatory
+arguments satisfying the predicate, @code{(predicate?)} for optional
+parameters of that type defaulting to @code{#f}, @code{@w{(predicate?
+value)}} for optional parameters with a specified default
+value (evaluated at definition time). An optional parameter can be
+omitted in a call only when it can't get confused with a following
+parameter of different type.
+
+Predicates with syntactical significance are @code{ly:pitch?},
+@code{ly:duration?}, @code{ly:music?}, @code{markup?}. Other
+predicates require the parameter to be entered as Scheme expression.
+
+Must return an event expression. The @code{origin} is automatically
+set to the @code{location} parameter."
+
+ `(define-syntax-function (ly:event? (make-music 'Event 'void #t)) ,@rest))