File: chain.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 (37 lines) | stat: -rw-r--r-- 753 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
# This file demonstrates the use of the %chain block.

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

@body {
	@channel 1 "guitar" {
		$patch guitar_steel

		# C major scale
		%chain 4:1 {
			start c5 # Start on c5

			c5 [ 1 e5 4 d5 ] # c5 can be followed by e5 or d5
                             # The numbers in front of the notes
                             # are weighting factors, ie d5 will
                             # be chosen more often than e5

			# set up rest of scale
			d5 [ 3 e5 1 g5 ]
			e5 [ 1 f5 ]
			f5 [ 1 g5 ]
			g5 [ 1 a5 ]
			a5 [ 2 b5 1 c5 ]
			b5 [ 1 a5 2 c6 1 c5 ]
			c6 [ 1 b5 3 c5 1 g5 ]

			# Note lengths
			rhythm [
			          1  16 # 16th notes 1/5 probability 
			          4   8 # 6th notes 4/5 probability
			]
		}
	}
}