File: AddDuplicateMeasure.scm

package info (click to toggle)
denemo 2.6.49-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 66,916 kB
  • sloc: ansic: 94,587; lisp: 38,713; xml: 22,675; python: 1,930; sh: 1,239; makefile: 642; yacc: 288; sed: 93
file content (35 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
;;;AddDuplicateMeasure
(d-PushClipboard)
(d-SelectMeasure)
(d-Copy)
(if (d-MoveToMeasureRight)
	(if (None?)
		#t ; Empty measure
		(d-InsertMeasureBefore)); create empty measure
	(begin ; End of staff
		(d-AppendMeasureAllStaffs)
		(d-MoveToMeasureRight)))
(d-Paste)
(d-PopClipboard)
(if AddDuplicateMeasure::params
	(begin
		(d-PushPosition)
		(while (d-PrevChordInMeasure))
		(let ((channel (d-StaffProperties "query=midi_channel")) (ticks #f) (time 0)(key #f)
		      (prognum (d-StaffProperties "query=midi_prognum")))
		      (define command (number->string (logior (string->number channel) #xC0)))
		    (d-OutputMidiBytes (string-append command  " " prognum))
		    (let loop ()
			(set! ticks (d-GetDurationInTicks))
			(if (d-GetNonprinting)
			    (begin
				(set! channel "9")
				(set! key 60))
			    (set! key (d-GetNoteAsMidi)))
			(if (and ticks key)
			    (begin
				(d-OneShotTimer time (string-append "(d-PlayMidiNote  " (number->string key) " 127 " channel " " (number->string ticks) ")"))
				(set! time (+ time ticks))))
			(if (d-NextChordInMeasure)
			    (loop))))
		(d-PopPosition)))