Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util/CSoundNote.py
diff options
context:
space:
mode:
authorJames <olpc@localhost.localdomain>2007-01-29 11:14:17 (GMT)
committer James <olpc@localhost.localdomain>2007-01-29 11:14:17 (GMT)
commit37d5b1c8b1248eb86db2dc8d0550569cd08b8535 (patch)
treedee858c8c92be50f742b4c85d30cbee0a24c4c35 /Util/CSoundNote.py
parent9b3d8e0a679913b29390fab8f2da7c68acc9bd1c (diff)
merged new notelooper into edit
Diffstat (limited to 'Util/CSoundNote.py')
-rw-r--r--Util/CSoundNote.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Util/CSoundNote.py b/Util/CSoundNote.py
index bf215ca..77ea459 100644
--- a/Util/CSoundNote.py
+++ b/Util/CSoundNote.py
@@ -47,6 +47,7 @@ def CSound_playNote( loopMode, secs_per_tick,
if instr == 'drum3kit':
instr = Config.DRUM3INSTRUMENTS[ key ]
pitch = 1
+ time_in_ticks = 0
else:
pitch = GenerationConstants.TRANSPOSE[ pitch - 24 ]
@@ -56,6 +57,7 @@ def CSound_playNote( loopMode, secs_per_tick,
# condition for overlaped notes
if Config.INSTRUMENTS[ instr ].csoundInstrumentId == 102 and overlap:
duration += 1.0
+ time_in_ticks = 1
# condition for tied notes
if Config.INSTRUMENTS[ instr].csoundInstrumentId == Config.INST_TIED and tied and fullDuration:
@@ -64,7 +66,7 @@ def CSound_playNote( loopMode, secs_per_tick,
if Config.INSTRUMENTS[ instr ].csoundInstrumentId == Config.INST_PERC and overlap:
duration = duration + 1.0
if loopMode :
- sc_loop_addScoreEvent15( 'i',
+ sc_loop_addScoreEvent15( time_in_ticks, 'i',
Config.INSTRUMENTS[ instr ].csoundInstrumentId + trackId * 0.01,
onset,
duration,
@@ -73,15 +75,15 @@ def CSound_playNote( loopMode, secs_per_tick,
amplitude,
pan,
Config.INSTRUMENT_TABLE_OFFSET + Config.INSTRUMENTS[instr].instrumentId,
- max(attack*duration, 0.002),
- max(decay *duration, 0.002),
+ attack,
+ decay,
filterType,
filterCutoff,
Config.INSTRUMENTS[ instr ].loopStart,
Config.INSTRUMENTS[ instr ].loopEnd,
Config.INSTRUMENTS[ instr ].crossDur )
else:
- sc_scoreEvent15( 'i',
+ sc_scoreEvent15( 0, 'i',
Config.INSTRUMENTS[ instr ].csoundInstrumentId + trackId * 0.01,
onset * secs_per_tick,
duration,
@@ -99,6 +101,7 @@ def CSound_playNote( loopMode, secs_per_tick,
Config.INSTRUMENTS[ instr ].crossDur )
class CSoundNote :
+ NOTE_ID_COUNTER = 0
#-----------------------------------
# initialization
#-----------------------------------
@@ -140,6 +143,8 @@ class CSoundNote :
else:
self.instrumentFlag = self.instrument
self.nchanges = 0
+ self.noteId = self.NOTE_ID_COUNTER
+ self.NOTE_ID_COUNTER += 1
def __getstate__(self):
return {'onset': self.onset,