spiffyscore

Check-in [ff85cece1d]
Login
Overview
Comment:Can now set an instrument's default octave beside the instrument's score
Timelines: family | ancestors | descendants | both | master
Files: files | file ages | folders
SHA1: ff85cece1dc2388809b14e8cfc4a74eff1442616
User & Date: spiffytech@gmail.com on 2010-11-18 03:10:24
Other Links: branch diff | manifest | tags
Context
2010-11-18
16:06
Did some composing stuff check-in: 1987470dfc user: spiffytech@gmail.com tags: master
03:10
Can now set an instrument's default octave beside the instrument's score check-in: ff85cece1d user: spiffytech@gmail.com tags: master
03:04
Bug: octave modifiers (,') were acting as (up,down) not (down,up) check-in: e6bf0dbf82 user: spiffytech@gmail.com tags: master
Changes

Modified cfg.py from [2306af4935] to [8500dd2d15].

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    tempo = 1/bps
    max_duration = 1

    composition = {
        "a": {  # Movement block 'a' for reuse throughout the piece
            "bassline": {  # Instrument 'melody'
                "score_line": "i1 %(time)f %(duration)f 10000 %(octave)d.%(note)s",
                "octave": 6,
                "grammars": {  # Notes for this instrument to use in this piece
                    "u": ["I,/2 z/2 I,/2 z/2 I,/2 z/2 V,/2 z/2 u u", "e"],
                    "e": [""],
                },
                "score": "u u u u u",
            },
        },
    }








|

|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    tempo = 1/bps
    max_duration = 1

    composition = {
        "a": {  # Movement block 'a' for reuse throughout the piece
            "bassline": {  # Instrument 'melody'
                "score_line": "i1 %(time)f %(duration)f 10000 %(octave)d.%(note)s",
                "octave": 5,
                "grammars": {  # Notes for this instrument to use in this piece
                    "u": ["I/2 z/2 I/2 z/2 I/2 z/2 V/2 z/2 u u", "e"],
                    "e": [""],
                },
                "score": "u u u u u",
            },
        },
    }

Modified parse.py from [40393160ad] to [668286027e].

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
        p[0] = p[2]

    def p_octave(p):
        '''pitch : pitch OCTAVE
        '''
        count = len(p[2])
        increment_or_decrement = 1 if p[2][0] == "'" else -1
        print "octave=", default_octave
        octave = default_octave + (count * increment_or_decrement)
        p[1].octave = octave
        p[0] = p[1]

    def p_pitch(p):
        '''pitch : BASENOTE
        '''
        p[0] = Note(p[1])

    def p_rest(p):
        ''' rest : REST
                | REST NOTE_LENGTH
        '''
        p[0] = Rest()
        if len(p) > 2:







<
|






|







127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
        p[0] = p[2]

    def p_octave(p):
        '''pitch : pitch OCTAVE
        '''
        count = len(p[2])
        increment_or_decrement = 1 if p[2][0] == "'" else -1

        octave = p[1].octave + (count * increment_or_decrement)
        p[1].octave = octave
        p[0] = p[1]

    def p_pitch(p):
        '''pitch : BASENOTE
        '''
        p[0] = Note(p[1], octave=default_octave)

    def p_rest(p):
        ''' rest : REST
                | REST NOTE_LENGTH
        '''
        p[0] = Rest()
        if len(p) > 2:

Modified test.sco from [c2061b1574] to [5fa24f6626].

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








































































octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
octave= 6
f1  0  512  10  1
i1 0.000000 0.500000 10000 5.09
i1 1.000000 0.500000 10000 5.09
i1 2.000000 0.500000 10000 5.09
i1 3.000000 0.500000 10000 5.04
i1 4.000000 0.500000 10000 5.09
i1 5.000000 0.500000 10000 5.09
i1 6.000000 0.500000 10000 5.09
i1 7.000000 0.500000 10000 5.04
i1 8.000000 0.500000 10000 5.09
i1 9.000000 0.500000 10000 5.09
i1 10.000000 0.500000 10000 5.09
i1 11.000000 0.500000 10000 5.04
i1 12.000000 0.500000 10000 5.09
i1 13.000000 0.500000 10000 5.09
i1 14.000000 0.500000 10000 5.09
i1 15.000000 0.500000 10000 5.04








































































<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
















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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
















f1  0  512  10  1
i1 0.000000 0.500000 10000 5.09
i1 1.000000 0.500000 10000 5.09
i1 2.000000 0.500000 10000 5.09
i1 3.000000 0.500000 10000 5.04
i1 4.000000 0.500000 10000 5.09
i1 5.000000 0.500000 10000 5.09
i1 6.000000 0.500000 10000 5.09
i1 7.000000 0.500000 10000 5.04
i1 8.000000 0.500000 10000 5.09
i1 9.000000 0.500000 10000 5.09
i1 10.000000 0.500000 10000 5.09
i1 11.000000 0.500000 10000 5.04
i1 12.000000 0.500000 10000 5.09
i1 13.000000 0.500000 10000 5.09
i1 14.000000 0.500000 10000 5.09
i1 15.000000 0.500000 10000 5.04
i1 16.000000 0.500000 10000 5.09
i1 17.000000 0.500000 10000 5.09
i1 18.000000 0.500000 10000 5.09
i1 19.000000 0.500000 10000 5.04
i1 20.000000 0.500000 10000 5.09
i1 21.000000 0.500000 10000 5.09
i1 22.000000 0.500000 10000 5.09
i1 23.000000 0.500000 10000 5.04
i1 24.000000 0.500000 10000 5.09
i1 25.000000 0.500000 10000 5.09
i1 26.000000 0.500000 10000 5.09
i1 27.000000 0.500000 10000 5.04
i1 28.000000 0.500000 10000 5.09
i1 29.000000 0.500000 10000 5.09
i1 30.000000 0.500000 10000 5.09
i1 31.000000 0.500000 10000 5.04
i1 32.000000 0.500000 10000 5.09
i1 33.000000 0.500000 10000 5.09
i1 34.000000 0.500000 10000 5.09
i1 35.000000 0.500000 10000 5.04
i1 36.000000 0.500000 10000 5.09
i1 37.000000 0.500000 10000 5.09
i1 38.000000 0.500000 10000 5.09
i1 39.000000 0.500000 10000 5.04
i1 40.000000 0.500000 10000 5.09
i1 41.000000 0.500000 10000 5.09
i1 42.000000 0.500000 10000 5.09
i1 43.000000 0.500000 10000 5.04
i1 44.000000 0.500000 10000 5.09
i1 45.000000 0.500000 10000 5.09
i1 46.000000 0.500000 10000 5.09
i1 47.000000 0.500000 10000 5.04
i1 48.000000 0.500000 10000 5.09
i1 49.000000 0.500000 10000 5.09
i1 50.000000 0.500000 10000 5.09
i1 51.000000 0.500000 10000 5.04
i1 52.000000 0.500000 10000 5.09
i1 53.000000 0.500000 10000 5.09
i1 54.000000 0.500000 10000 5.09
i1 55.000000 0.500000 10000 5.04
i1 56.000000 0.500000 10000 5.09
i1 57.000000 0.500000 10000 5.09
i1 58.000000 0.500000 10000 5.09
i1 59.000000 0.500000 10000 5.04
i1 60.000000 0.500000 10000 5.09
i1 61.000000 0.500000 10000 5.09
i1 62.000000 0.500000 10000 5.09
i1 63.000000 0.500000 10000 5.04
i1 64.000000 0.500000 10000 5.09
i1 65.000000 0.500000 10000 5.09
i1 66.000000 0.500000 10000 5.09
i1 67.000000 0.500000 10000 5.04
i1 68.000000 0.500000 10000 5.09
i1 69.000000 0.500000 10000 5.09
i1 70.000000 0.500000 10000 5.09
i1 71.000000 0.500000 10000 5.04
i1 72.000000 0.500000 10000 5.09
i1 73.000000 0.500000 10000 5.09
i1 74.000000 0.500000 10000 5.09
i1 75.000000 0.500000 10000 5.04
i1 76.000000 0.500000 10000 5.09
i1 77.000000 0.500000 10000 5.09
i1 78.000000 0.500000 10000 5.09
i1 79.000000 0.500000 10000 5.04
i1 80.000000 0.500000 10000 5.09
i1 81.000000 0.500000 10000 5.09
i1 82.000000 0.500000 10000 5.09
i1 83.000000 0.500000 10000 5.04
i1 84.000000 0.500000 10000 5.09
i1 85.000000 0.500000 10000 5.09
i1 86.000000 0.500000 10000 5.09
i1 87.000000 0.500000 10000 5.04

Modified todo.org from [f88a59ddf7] to [d5cbe62893].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
* Features [2/9]
- [X] Top-down composition
- [ ] Coordinate the melody and rhythm
- [ ] Set maximum song length of movement
- [ ] Set minimum song length of movement
- [ ] Get all tracks to end at the same time
- [ ] Need to support all chord types
- [X] Doesn't handle rest notes
- [ ] Handle full ABC BNF (yeah, right...)
- [ ] Set instrument octave in score file

* Bugs [4/5]
- [X] TLD resets clock for each movement
- [X] TLD doesn't accept an ordering for the movements
- [X] Doesn't handle minor chords    
- [X] Calculated duration is absolute, not relative to BPM
- [ ] Chords don't respect octaves


* Structure [1/3]    
- [ ] Chords should be composed of Notes, not ordinary arrays
- [ ] Generate score with proper generation tools
- [X] Store csound score lines with instruments
|








|













1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
* Features [3/9]
- [X] Top-down composition
- [ ] Coordinate the melody and rhythm
- [ ] Set maximum song length of movement
- [ ] Set minimum song length of movement
- [ ] Get all tracks to end at the same time
- [ ] Need to support all chord types
- [X] Doesn't handle rest notes
- [ ] Handle full ABC BNF (yeah, right...)
- [X] Set instrument octave in score file

* Bugs [4/5]
- [X] TLD resets clock for each movement
- [X] TLD doesn't accept an ordering for the movements
- [X] Doesn't handle minor chords    
- [X] Calculated duration is absolute, not relative to BPM
- [ ] Chords don't respect octaves


* Structure [1/3]    
- [ ] Chords should be composed of Notes, not ordinary arrays
- [ ] Generate score with proper generation tools
- [X] Store csound score lines with instruments