diff options
author | Oli <olivier.belanger@umontreal.ca> | 2007-08-17 19:20:48 (GMT) |
---|---|---|
committer | Oli <olivier.belanger@umontreal.ca> | 2007-08-17 19:20:48 (GMT) |
commit | ac428f50a0cbcd05c5b76163ec095544888988fc (patch) | |
tree | 33d7564d421abf084fe0bd793dfe4a1f149680c2 /Util | |
parent | f84efd464ad797f5f03aeb18105fc5378706495f (diff) |
second inst uses good loop points, remove second inst works
Diffstat (limited to 'Util')
-rw-r--r-- | Util/CSoundClient.py | 11 | ||||
-rw-r--r-- | Util/NoteDB.py | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/Util/CSoundClient.py b/Util/CSoundClient.py index 8cc9ec2..0555929 100644 --- a/Util/CSoundClient.py +++ b/Util/CSoundClient.py @@ -292,8 +292,14 @@ class _CSoundClientPlugin: instrument2 = Config.INSTRUMENTSID[instrumentId2] csInstrumentId2 = (instrument2.csoundInstrumentId + 100) * 0.0001 secondInstrument = Config.INSTRUMENT_TABLE_OFFSET + instrumentId2 + csInstrumentId2 + loopStart2 = instrument2.loopStart + loopEnd2 = instrument2.loopEnd + crossDur2 = instrument2.crossDur else: secondInstrument = -1 + loopStart2 = 0 + loopEnd2 = 0 + crossDur2 = 0 a = array.array('f') a.extend( [ @@ -312,7 +318,10 @@ class _CSoundClientPlugin: instrument.loopStart, instrument.loopEnd, instrument.crossDur, - secondInstrument ]) + secondInstrument, + loopStart2, + loopEnd2, + crossDur2]) return a diff --git a/Util/NoteDB.py b/Util/NoteDB.py index d334670..2cdf9c9 100644 --- a/Util/NoteDB.py +++ b/Util/NoteDB.py @@ -323,6 +323,19 @@ class NoteDB: if len(stream): self.updateNotes( stream + [-1] ) + def setInstrument2( self, pages, track, instrumentId ): + stream = [] + for page in pages: + #self.pages[page].instruments[track] = instrumentId + notes = self.getNotesByTrack( page, track ) + sub = [] + for note in notes: + sub.append( note.id ) + sub.append( instrumentId ) + if len(sub): + stream += [ page, track, PARAMETER.INSTRUMENT2, len(sub)//2 ] + sub + if len(stream): + self.updateNotes( stream + [-1] ) #======================================================= # Note Functions |