spiffyscore

Check-in [eb81d5f9fd]
Login
Overview
SHA1:eb81d5f9fd6c7cbcdf4db007520f37b4ad668303
Date: 2011-11-01 18:52:19
User: brian
Comment:Added a sampled double bass, modified the program to respond to an instrument's specified octave
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:54
[072fa6ad30] Imported the todo list from MUS306 (user: brian, tags: develop)
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)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified cfg.orc from [8f705f0ccb] to [e60884eb39].

     1      1   sr=44100
     2      2   ksmps=20
     3      3   nchnls=1
            4  +
            5  +gifn ftgen 105, 0, 524288, -1,  "samples/bass/1.05.wav", 0, 0, 1 ; Middle C
            6  +gifn ftgen 106, 0, 524288, -1,  "samples/bass/1.06.wav", 0, 0, 1 ; Middle C
            7  +gifn ftgen 107, 0, 524288, -1,  "samples/bass/1.07.wav", 0, 0, 1 ; Middle C
            8  +gifn ftgen 108, 0, 524288, -1,  "samples/bass/1.08.wav", 0, 0, 1 ; Middle C
            9  +gifn ftgen 109, 0, 524288, -1,  "samples/bass/1.09.wav", 0, 0, 1 ; Middle C
           10  +gifn ftgen 110, 0, 524288, -1,  "samples/bass/1.10.wav", 0, 0, 1 ; Middle C
           11  +gifn ftgen 111, 0, 524288, -1,  "samples/bass/1.11.wav", 0, 0, 1 ; Middle C
           12  +gifn ftgen 200, 0, 524288, -1,  "samples/bass/2.01.wav", 0, 0, 1 ; Middle C
           13  +gifn ftgen 201, 0, 524288, -1,  "samples/bass/2.02.wav", 0, 0, 1 ; Middle C
           14  +gifn ftgen 202, 0, 524288, -1,  "samples/bass/2.03.wav", 0, 0, 1 ; Middle C
           15  +gifn ftgen 203, 0, 524288, -1,  "samples/bass/2.04.wav", 0, 0, 1 ; Middle C
           16  +gifn ftgen 204, 0, 524288, -1,  "samples/bass/2.05.wav", 0, 0, 1 ; Middle C
           17  +gifn ftgen 206, 0, 524288, -1,  "samples/bass/2.06.wav", 0, 0, 1 ; Middle C
           18  +gifn ftgen 207, 0, 524288, -1,  "samples/bass/2.07.wav", 0, 0, 1 ; Middle C
           19  +gifn ftgen 208, 0, 524288, -1,  "samples/bass/2.08.wav", 0, 0, 1 ; Middle C
           20  +gifn ftgen 209, 0, 524288, -1,  "samples/bass/2.09.wav", 0, 0, 1 ; Middle C
           21  +gifn ftgen 210, 0, 524288, -1,  "samples/bass/2.10.wav", 0, 0, 1 ; Middle C
           22  +gifn ftgen 211, 0, 524288, -1,  "samples/bass/2.11.wav", 0, 0, 1 ; Middle C
           23  +gifn ftgen 300, 0, 524288, -1,  "samples/bass/3.00.wav", 0, 0, 1 ; Middle C
           24  +gifn ftgen 301, 0, 524288, -1,  "samples/bass/3.01.wav", 0, 0, 1 ; Middle C
           25  +gifn ftgen 302, 0, 524288, -1,  "samples/bass/3.02.wav", 0, 0, 1 ; Middle C
           26  +gifn ftgen 303, 0, 524288, -1,  "samples/bass/3.03.wav", 0, 0, 1 ; Middle C
           27  +gifn ftgen 304, 0, 524288, -1,  "samples/bass/3.04.wav", 0, 0, 1 ; Middle C
           28  +gifn ftgen 305, 0, 524288, -1,  "samples/bass/3.05.wav", 0, 0, 1 ; Middle C
           29  +gifn ftgen 306, 0, 524288, -1,  "samples/bass/3.06.wav", 0, 0, 1 ; Middle C
           30  +gifn ftgen 307, 0, 524288, -1,  "samples/bass/3.07.wav", 0, 0, 1 ; Middle C
           31  +gifn ftgen 308, 0, 524288, -1,  "samples/bass/3.08.wav", 0, 0, 1 ; Middle C
           32  +gifn ftgen 309, 0, 524288, -1,  "samples/bass/3.09.wav", 0, 0, 1 ; Middle C
           33  +gifn ftgen 310, 0, 524288, -1,  "samples/bass/3.10.wav", 0, 0, 1 ; Middle C
           34  +gifn ftgen 311, 0, 524288, -1,  "samples/bass/3.11.wav", 0, 0, 1 ; Middle C
           35  +
           36  +instr 3
           37  +    inum = p5*100
           38  +    asig loscil 1, 1, inum, 1 
           39  +    outs asig
           40  +endin
     4     41   
     5     42   instr 1
     6     43       asound pluck   p4, cpspch(p5), cpspch(p6), p7, p8 p9 p10
     7     44       out asound
     8     45   endin
     9     46   
    10     47   instr 2
    11     48       kenv linen p4, .1, p3, .2; envelope
    12     49       asound oscili kenv, cpspch(p5), p6; oscillator
    13     50       out asound
    14     51   endin
    15     52   
    16         -instr 3
    17         -    asound foscili p4, cpspch(p5), 5, 2, 3, p9
    18         -    out asound
    19         -endin
    20         -
    21     53   instr 4
    22     54       aFMinst foscili p4, cpspch(p5), p6, p7, p8, p9
    23     55   endin

Added samples/bass/1.05.wav version [e6f01c2d0c].

cannot compute difference between binary files

Added samples/bass/1.06.wav version [589b4c9c16].

cannot compute difference between binary files

Added samples/bass/1.07.wav version [b5bd0e0b28].

cannot compute difference between binary files

Added samples/bass/1.08.wav version [4e22c8e289].

cannot compute difference between binary files

Added samples/bass/1.09.wav version [8eafba8350].

cannot compute difference between binary files

Added samples/bass/1.10.wav version [6c9d557273].

cannot compute difference between binary files

Added samples/bass/1.11.wav version [d210644e57].

cannot compute difference between binary files

Added samples/bass/2.00.wav version [df0ad67bd3].

cannot compute difference between binary files

Added samples/bass/2.01.wav version [5e4bdb6301].

cannot compute difference between binary files

Added samples/bass/2.02.wav version [2787d975d6].

cannot compute difference between binary files

Added samples/bass/2.03.wav version [6ce7982e46].

cannot compute difference between binary files

Added samples/bass/2.04.wav version [3c3feb5b24].

cannot compute difference between binary files

Added samples/bass/2.05.wav version [569b7181fc].

cannot compute difference between binary files

Added samples/bass/2.06.wav version [297d4f860f].

cannot compute difference between binary files

Added samples/bass/2.07.wav version [1ac14e3cd2].

cannot compute difference between binary files

Added samples/bass/2.08.wav version [b92037909c].

cannot compute difference between binary files

Added samples/bass/2.09.wav version [760599b161].

cannot compute difference between binary files

Added samples/bass/2.10.wav version [3b900ab89f].

cannot compute difference between binary files

Added samples/bass/2.11.wav version [bcaf91186d].

cannot compute difference between binary files

Added samples/bass/3.00.wav version [5d028b32a1].

cannot compute difference between binary files

Added samples/bass/3.01.wav version [9d6dded4d3].

cannot compute difference between binary files

Added samples/bass/3.02.wav version [78dab72fb7].

cannot compute difference between binary files

Added samples/bass/3.03.wav version [9476ff14fb].

cannot compute difference between binary files

Added samples/bass/3.04.wav version [0822a77edf].

cannot compute difference between binary files

Added samples/bass/3.05.wav version [dc233966b5].

cannot compute difference between binary files

Added samples/bass/3.06.wav version [c254ae3482].

cannot compute difference between binary files

Added samples/bass/3.07-old1.wav version [7e77a9e339].

cannot compute difference between binary files

Added samples/bass/3.07.wav version [23ec2fdb73].

cannot compute difference between binary files

Added samples/bass/3.08.wav version [c799d64faf].

cannot compute difference between binary files

Added samples/bass/3.09.wav version [cedce4e5ea].

cannot compute difference between binary files

Added samples/bass/3.10.wav version [bbc1ef4a09].

cannot compute difference between binary files

Added samples/bass/3.11.wav version [f679f5a61b].

cannot compute difference between binary files

Added samples/bass/Bass.arco.mf.sulE.C2B2.aiff version [b705aee00e].

cannot compute difference between binary files

Added samples/bass/Bass.arco.mf.sulE.C3D3.aiff version [17eacace3a].

cannot compute difference between binary files

Added samples/bass/Bass.arco.mf.sulG.C3B3.aiff version [8b429011eb].

cannot compute difference between binary files

Added samples/bass/Bass.arco.mf.sulG.G2B2.aiff version [8c3a1d88c6].

cannot compute difference between binary files

Added samples/bass/test.orc version [2795c8cc70].

            1  +sr=44100
            2  +ksmps=20
            3  +nchnls=2
            4  +
            5  +gifn ftgen 105, 0, 524288, -1,  "8.05.wav", 0, 0, 1 ; Middle C
            6  +gifn ftgen 106, 0, 524288, -1,  "8.06.wav", 0, 0, 1 ; Middle C
            7  +gifn ftgen 107, 0, 524288, -1,  "8.07.wav", 0, 0, 1 ; Middle C
            8  +gifn ftgen 108, 0, 524288, -1,  "8.08.wav", 0, 0, 1 ; Middle C
            9  +gifn ftgen 109, 0, 524288, -1,  "8.09.wav", 0, 0, 1 ; Middle C
           10  +gifn ftgen 110, 0, 524288, -1,  "8.10.wav", 0, 0, 1 ; Middle C
           11  +gifn ftgen 111, 0, 524288, -1,  "8.18.wav", 0, 0, 1 ; Middle C
           12  +
           13  +instr 1
           14  +;    if p5=8.05 then
           15  +;        asig diskin "8.05.wav"
           16  +;    elseif p5=8.06 then
           17  +;        asig diskin "8.06.wav"
           18  +;    elseif p5=8.07 then
           19  +;        asig diskin "8.07.wav"
           20  +;    elseif p5=8.08 then
           21  +;        asig diskin "8.08.wav"
           22  +;    elseif p5=8.09 then
           23  +;        asig diskin "8.09.wav"
           24  +;    elseif p5=8.11 then
           25  +;        asig diskin "8.10.wav"
           26  +;    elseif p5=8.11 then
           27  +;        asig diskin "8.18.wav"
           28  +;    endif
           29  +    inum = p5*100
           30  +    asig loscil 1, 1, inum, 1 
           31  +    outs asig, asig
           32  +endin

Added samples/bass/test.sco version [f5f91e8863].

            1  +f1 0 512 10 1
            2  +f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
            3  +f3 0 1025 10 1
            4  +t 0 100
            5  +    
            6  +i1 0.000000 0.50000 7000 1.05
            7  +i1 0.500000 1.0000 7000 1.11

Added samples/bass/test.wav version [550291acb7].

cannot compute difference between binary files

Modified spiffyscore.py from [3a0a8776ca] to [791db3d131].

   106    106           "sync_test": {
   107    107               "body": {
   108    108                   "lead_instr": {  # Instrument 'melody'
   109    109                       "score_line": "i1 %(time)f %(duration)f 7000 %(octave)d.%(note)s %(octave)d.%(note)s 0 6",
   110    110                       "octave": 8,
   111    111                       "duration": 30,
   112    112                       "grammars": {  # Notes for this instrument to use in this piece
   113         -                        "u": ["D/4 D/4 D/4 D/4 (v)"],
   114         -                        "v": ["C/4 C/4 C/4 C/4 (u)"],
          113  +                        "u": ["A/4, B/4, C/4 D/4 (u)", "D/4' D/4' D/4' D/4' (v)"],
          114  +                        "v": ["C/4 C/4 C/4 C/4 (w)"],
          115  +                        "w": ["E/4 F/4 E/4 F/4 (u)"],
   115    116                       },
   116    117                   },
   117    118                   "follow_instr": {  # Instrument 'melody'
   118         -                    "score_line": "i2 %(time)f %(duration)f 7000 %(octave)d.%(note)s 1",
   119         -                    "sync": "lead_instr",
   120         -                    "octave": 8,
          119  +                    "score_line": "i3 %(time)f %(duration)f 7000 %(octave)d.%(note)s",
          120  +#                    "sync": "lead_instr",
          121  +                    "octave": 2,
   121    122                       "duration": 30,
   122    123                       "grammars": {  # Notes for this instrument to use in this piece
   123         -                        "u": ["D/4 D/4 D/4 D/4 (u)"],
   124         -                        "v": ["C/4 C/4 C/4 C/4 (v)"],
          124  +                        "u": ["E F G E (u)"],
          125  +                        "v": ["G A A A (e)"],
          126  +                        "e": ["B' A' G' A' (v)"],
   125    127                       },
   126    128                   },
   127    129               },
   128    130           },
   129    131       }
   130    132       print '''f1 0 512 10 1
   131    133   f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
................................................................................
   169    171               except KeyError:
   170    172                   pass
   171    173   
   172    174   
   173    175   def render_instr(instr, syncs, max_time):
   174    176       for g in instr["grammars"]:
   175    177           for i in range(len(instr["grammars"][g])):
   176         -            instr["grammars"][g][i] = parse.parse(instr["grammars"][g][i])
          178  +            instr["grammars"][g][i] = parse.parse(instr["grammars"][g][i], default_octave=instr["octave"])
   177    179   
   178    180       score= []
   179    181       try:
   180    182           score, syncs = choose_phrase(instr, syncs, 0, max_time, None)
   181    183   
   182    184           while True:
   183    185               score_index_to_replace = None

Deleted test.sco version [e27e42951e].

     1         -f1 0 512 10 1
     2         -f2 0 8192 10 .24 .64 .88 .76 .06 .5 .34 .08
     3         -f3 0 1025 10 1
     4         -t 0 100
     5         -    
     6         -; Section fm_test
     7         -; Subsection intro
     8         -;Instrument melody
     9         -i2 0.000000 1.000000 7000 8.04 2 6 5 1
    10         -i2 1.000000 1.000000 7000 8.04 2 6 5 1
    11         -i2 2.000000 1.000000 7000 8.05 2 6 5 1
    12         -i2 3.000000 1.000000 7000 8.05 2 6 5 1
    13         -i2 4.000000 0.500000 7000 8.07 2 6 5 1
    14         -i2 4.500000 0.500000 7000 8.07 2 6 5 1
    15         -i2 5.000000 3.000000 7000 8.07 2 6 5 1
    16         -; Subsection body
    17         -; Subsection outro

Deleted todo.org version [510751b73f].

     1         -* Features [4/10]
     2         -- [X] Top-down composition
     3         -- [ ] Coordinate the melody and rhythm
     4         -- [X] Set maximum song length of movement per instrument
     5         -- [ ] Set minimum song length of movement per instrument
     6         -- [ ] Need to support all chord types
     7         -- [X] Doesn't handle rest notes
     8         -- [ ] Handle full ABC BNF (yeah, right, that's gonna happen...)
     9         -- [X] Set instrument octave in score file
    10         -- [ ] Output score to separate file
    11         -- [ ] Support parallel voices - ensure e.g. a certain chord progression is always
    12         -  accompanied by a certain melody
    13         -- [ ] Syncopation
    14         -- [ ] Sustain option for notes (give score notation a sustain symbol, and use it to set how long after the notes's duration to keep holding. With sustain, the next note's start time isn't done by when the current note ends. 
    15         -
    16         -* Bugs [5/6]
    17         -- [X] TLD resets clock for each movement
    18         -- [X] TLD doesn't accept an ordering for the movements
    19         -- [X] Doesn't handle minor chords    
    20         -- [X] Calculated duration is absolute, not relative to BPM
    21         -- [X] Chords don't respect octaves
    22         -- [ ] Whole notes not held for proper duration
    23         -
    24         -* Structure [1/7]    
    25         -- [ ] Chords should be composed of Notes, not ordinary arrays
    26         -- [ ] There should be a Musical_Phrase object that holds phrases (and sets of
    27         -  phrases), and allows them to nest
    28         -- [ ] Does each instrument need a score parameter if the grammars are non-terminating?
    29         -- [ ] Duration should be in beats, not seconds. This ensures movements don't
    30         -  end in the middle of a phrase.
    31         -- [ ] Generate score with proper generation tools, not this string-replace nonsense
    32         -- [X] Store csound score lines with instruments
    33         -- [ ] Upgrade from simple string substitution for the score to something
    34         -  list-based (maybe). Idea is to keep musical phrases intact in the event of a
    35         -  truncation of the score. Also, if done right, no need for retroactive length
    36         -  parsing- a measure is has a specific length, which is known at
    37         -  generation-time, thus solving the length limit problem.