spiffyscore

Check-in [ec61af8387]
Login

Check-in [ec61af8387]

Overview
Comment:WIP on tld: 4b95fed Added support for rest notes
Timelines: family | ancestors | stash
Files: files | file ages | folders
SHA1: ec61af8387630ac120865f5e7a342c37a62f3f0c
User & Date: spiffytech@gmail.com on 2010-11-17 07:34:19
Other Links: branch diff | manifest | tags
Context
2010-11-17
07:34
WIP on tld: 4b95fed Added support for rest notes Leaf check-in: ec61af8387 user: spiffytech@gmail.com tags: stash
07:34
index on tld: 4b95fed Added support for rest notes check-in: ef35a8e9e0 user: spiffytech@gmail.com tags: stash
07:30
Added support for rest notes Closed-Leaf check-in: aa88358397 user: spiffytech@gmail.com tags: tld
Changes

Modified cfg.py from [08a2f25157] to [91366ef5db].

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
42
43
44
45
46
47
48

49
50
51
52
53
54
55







-







        "b": {
            "melody": {  # Instrument 'melody'
                "csound_parameters": {
                    "instrument": 1,
                },
                "grammars": {  # Notes for this instrument to use in this piece
                    "u": ["I V I I/2 IV/2 u u", "I2 IV u u", "I IV IV VI V u u" , "e"],
#                    "u": ["I IV I V u u u", "e"],
                    "e": [""],
                },
                "score": "u u u",
            },
            "rhythm": {
                "csound_parameters": {
                    "instrument": 1,
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
71
72
73
74
75
76
77

78

79

80
81
82
83
84
85
86







-

-

-







            generated_score = generate_score(instr["score"], instr["grammars"])  # Fill in the scores by generating them based on the grammars
            score = parse.parse(generated_score)  # Return Node/Chord objects

            # Generate timestamps for the notes 
            t = instr_start_time
            for note in range(len(score)):
                score[note].time = t
#                print "Original duration:", score[note].duration
                score[note].duration *= tempo
#                print "New duration:", score[note].duration
                t += score[note].duration
#                print "t:", t
                max_t = t if t > max_t else max_t
            composition[comp_name][instr_name]["score"] = score

    # Must be done after all note times keyed in, else you can't coordinate melodies with the rhythm chords
    for comp_name in progression.split():
        for instr_name, instr in composition[comp_name].iteritems():
            composition[comp_name][instr_name]["score"] = transliterate_score(composition[comp_name][instr_name]["score"], key)

Modified todo.org from [109f37c970] to [8a5fa1e81b].

1

2
3

4
5
6
7

8
9
10
11
12
13
14

1
2

3
4
5
6

7
8
9
10
11
12
13
14
-
+

-
+



-
+







* Features [1/7]
* Features [2/7]
- [X] Top-down composition
- [ ] Transition the melody between chords appropriately
- [ ] Coordinate the melody and rhythm
- [ ] Set maximum song length of movement
- [ ] Set minimum song length of movement
- [ ] Need to support all chord types
- [ ] Doesn't handle rest notes
- [X] Doesn't handle rest notes
- [ ] Handle full ABC BNF (yeah, right...)

* 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