File: note_choose.mg

package info (click to toggle)
midge 0.2.41%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 556 kB
  • sloc: perl: 5,508; modula3: 1,204; lisp: 869; makefile: 36; sh: 20
file content (58 lines) | stat: -rw-r--r-- 1,054 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# The first track is completely random. There are two
# choose blocks, one choosing from an `a' scale and the
# other from a `d' scale, each within a loop which
# produces 4 bars of output. Each note has the same
# length to fix the length of the loop. See time_choose.mg
# to see how to get a fixed length output from different
# length notes.

@head { $tempo 120 $time_sig 4/4 }

@body {

	# random notes on piano
	# 4 bars of a, 4 bars of d, repeated 4 times

	@channel 1 piano {

		$length 16 $patch 1 $volume 104

		%repeat 4 {

			%repeat 64 { # 4 bars

				# pick a note from the a scale
				%choose { 
					4 a3 2 c4 3 d4 3 e4 3 g4
					2 a4 2 e5 2 d5 1 g5
				}
			}

			%repeat 64 { # 4 bars

				# pick a note from the d scale
				%choose { 
					4 d3 2 f4 3 g4 3 a4 3 c4
					2 d4 2 a5 2 g5 1 c5
				}
			}
		}

	}

	# backing chords on organ

	%define Am { ( a2 c3 e3 a3 c4 e4 ) }
	%define Dm { ( d2 f3 a3 d3 f4 a4 ) }
	

	@channel 2 organ {

		$length 1 $octave 3 $patch 18

		%repeat 4 {
			%repeat 4 { ~Am }
			%repeat 4 { ~Dm }
		}
	}
}