spiffyscore

Check-in [2ae36c6e68]
Login
Overview
SHA1:2ae36c6e683319943f0b14e889bb5aa74f7f7dc0
Date: 2011-10-20 20:01:33
User: brian
Edited Comment: Program no longer cuts out a note from the score each time it adds a new phrase to the score
Original Comment: Program no longer cuts out an note from the score each time it adds a new phrase in.
Timelines: family | ancestors | descendants | both | develop
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2011-11-01
18:52
[eb81d5f9fd] Added a sampled double bass, modified the program to respond to an instrument's specified octave (user: brian, tags: develop)
2011-10-20
20:01
[2ae36c6e68] Program no longer cuts out a note from the score each time it adds a new phrase to the score (user: brian, tags: develop)
19:56
[a9e60898b7] Program now chooses consistent nodes based on what's specified in the grammar. A couple other bugs are still present. (user: brian, tags: develop)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified cfg.py from [9313c52f09] to [3a0a8776ca].

185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
                if isinstance(score[item], tree.Tree):  # Also, make this use the find_next_node() function (or whatever I called it)
                    score_index_to_replace = item
            if score_index_to_replace is None:
                raise ValueError("No more nodes to fill in")

            time_remaining = max_time - score_len(score)
            new_phrase, syncs = choose_phrase(instr, syncs, score_len(score), time_remaining, score)
            score = score[:score_index_to_replace-1] + new_phrase + score[score_index_to_replace+1:]

    except ValueError:
        return (score, syncs)


def choose_phrase(instr, syncs, current_time, time_remaining, score):
    '''Filters grammars for ones that match the sync option, and phrases that fit the time remaining in the score'''







|







185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
                if isinstance(score[item], tree.Tree):  # Also, make this use the find_next_node() function (or whatever I called it)
                    score_index_to_replace = item
            if score_index_to_replace is None:
                raise ValueError("No more nodes to fill in")

            time_remaining = max_time - score_len(score)
            new_phrase, syncs = choose_phrase(instr, syncs, score_len(score), time_remaining, score)
            score = score[:score_index_to_replace] + new_phrase + score[score_index_to_replace+1:]

    except ValueError:
        return (score, syncs)


def choose_phrase(instr, syncs, current_time, time_remaining, score):
    '''Filters grammars for ones that match the sync option, and phrases that fit the time remaining in the score'''