diff options
author | amartin <olpc@localhost.localdomain> | 2007-03-04 19:09:56 (GMT) |
---|---|---|
committer | amartin <olpc@localhost.localdomain> | 2007-03-04 19:09:56 (GMT) |
commit | 44ae765f4727196c4455148efc0849511e1e4aeb (patch) | |
tree | 4a31d69f7b5d4cda003d1df5936608c5bd3598f7 /Util/CSoundClient.py | |
parent | 39da26fa4a371868e21c6e3e0083161cf7b9efbe (diff) | |
parent | 90fd4e1f17ea44f5886c8714cc085f69ea068695 (diff) |
Merge branch 'master' of git+ssh://amartin@dev.laptop.org/git/projects/tamtam
Diffstat (limited to 'Util/CSoundClient.py')
-rw-r--r-- | Util/CSoundClient.py | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index d50235a..8a99e1b 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -157,6 +157,7 @@ class _CSoundClientPlugin: def loopPlay(self, dbnote, active): qid = (dbnote.page << 16) + dbnote.id sc_loop_addScoreEvent( qid, 1, active, 'i', self.csnote_to_array(dbnote.cs)) + def play(self, csnote, secs_per_tick): a = self.csnote_to_array(csnote) a[self.DURATION] = a[self.DURATION] * secs_per_tick @@ -179,8 +180,8 @@ class _CSoundClientPlugin: csnote.filterType, csnote.filterCutoff, csnote.tied, - csnote.overlap, - csnote.instrumentId) + csnote.instrumentId, + csnote.mode) INSTR_TRACK=0 ONSET=1 @@ -202,8 +203,8 @@ class _CSoundClientPlugin: filterType = 0, filterCutoff = 1000, tied = False, - overlap = False, - instrumentId = Config.INSTRUMENTS["flute"].instrumentId ): + instrumentId = Config.INSTRUMENTS["flute"].instrumentId, + mode = 'edit' ): instrument = Config.INSTRUMENTSID[instrumentId] if instrument.kit != None: @@ -212,25 +213,21 @@ class _CSoundClientPlugin: time_in_ticks = 0 else: pitch = GenerationConstants.TRANSPOSE[ pitch - 24 ] - - # condition for tied notes - if instrument.csoundInstrumentId == 101 and tied and fullDuration: - duration= -1.0 - # condition for overlaped notes - if instrument.csoundInstrumentId == 102 and overlap: - duration += 1.0 time_in_ticks = 1 + instrument_offset = 0 # condition for tied notes - if instrument.csoundInstrumentId == Config.INST_TIED and tied and fullDuration: + if instrument.csoundInstrumentId == Config.INST_TIED and tied and mode == 'mini': duration = -1 - # condition for overlaped notes - if instrument.csoundInstrumentId == Config.INST_PERC and overlap: - duration = duration + 1.0 + instrument_offset = 0 + elif instrument.csoundInstrumentId == Config.INST_TIED and not tied and mode == 'mini': + instrument_offset = 0 + elif instrument.csoundInstrumentId == Config.INST_TIED and mode == 'edit': + instrument_offset = 100 a = array.array('f') a.extend( [ - (instrument.csoundInstrumentId + trackId) + trackId * 0.01, + (instrument.csoundInstrumentId + trackId + instrument_offset) + trackId * 0.01, onset, duration, pitch, |