Mercurial > hg > amuse
changeset 256:bc893627f92d
make gsharp events linked-events
author | Jamie Forth <j.forth@gold.ac.uk> |
---|---|
date | Thu, 24 Feb 2011 18:39:57 +0000 |
parents | f1e6d10fdb11 |
children | 30b6b848ec75 |
files | implementations/gsharp/classes.lisp implementations/gsharp/gsharp-import.lisp |
diffstat | 2 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/implementations/gsharp/classes.lisp Thu Feb 24 11:23:19 2011 +0000 +++ b/implementations/gsharp/classes.lisp Thu Feb 24 18:39:57 2011 +0000 @@ -12,7 +12,8 @@ :initform nil :accessor %gsharp-time-signatures))) -(defclass gsharp-pitched-event (standard-chromatic-pitched-event gsharp-object) +(defclass gsharp-pitched-event (standard-chromatic-pitched-event + linked-event gsharp-object) ((note :initarg :note :reader note) (slice-index :initarg :slice-index))) @@ -36,4 +37,4 @@ (defclass gsharp-key-signature-period (standard-key-signature-period gsharp-import-mixin) ()) (defclass gsharp-time-signature-period (standard-time-signature-period gsharp-import-mixin) - ()) \ No newline at end of file + ())
--- a/implementations/gsharp/gsharp-import.lisp Thu Feb 24 11:23:19 2011 +0000 +++ b/implementations/gsharp/gsharp-import.lisp Thu Feb 24 18:39:57 2011 +0000 @@ -1,9 +1,16 @@ (in-package "AMUSE-GSHARP") (defun make-gsharp-composition (events buffer timepoint interval &key tempi key-signatures time-signatures) - (let ((comp (make-instance 'gsharp-composition :buffer buffer :time timepoint :interval interval - :tempi tempi :key-signatures key-signatures :time-signatures time-signatures))) - (sequence:adjust-sequence comp (length events) :initial-contents events))) + (let ((comp (make-instance 'gsharp-composition :buffer buffer + :time timepoint :interval interval + :tempi tempi + :key-signatures key-signatures + :time-signatures time-signatures))) + (sequence:adjust-sequence comp (length events) :initial-contents events) + (sequence:dosequence (e comp t) ;; link events to composition + (%set-composition comp e)) + comp)) + (defun last-bar-p (bar) ;; I know most of this file is cut-and-pasted, but this is a @@ -244,4 +251,4 @@ (object) (list object)) -|# \ No newline at end of file +|#