Browse Source

p_ac.py, p_ac.yml : Added use of VelTablePlayer,NoteTester,PolyNoteTester,ChordTester

among other changes.
master
kevin 3 years ago
parent
commit
55695164b5
2 changed files with 399 additions and 131 deletions
  1. 138
    33
      p_ac.py
  2. 261
    98
      p_ac.yml

+ 138
- 33
p_ac.py View File

@@ -19,6 +19,10 @@ from keyboard         import Keyboard
19 19
 from calibrate        import Calibrate
20 20
 from rms_analysis import rms_analyze_one_rt_note_wrap
21 21
 from MidiFilePlayer import MidiFilePlayer
22
+from VelTablePlayer import VelTablePlayer
23
+from NoteTester     import NoteTester
24
+from PolyNoteTester import PolyNoteTester
25
+from ChordTester    import ChordTester
22 26
 
23 27
 class AttackPulseSeq:
24 28
     """ Sequence a fixed pitch over a list of attack pulse lengths."""
@@ -33,7 +37,7 @@ class AttackPulseSeq:
33 37
         self.noteDurMs   = noteDurMs      # duration of each chord in milliseconds
34 38
         self.pauseDurMs  = pauseDurMs     # duration between end of previous note and start of next
35 39
         self.holdDutyPctL= None           # hold voltage duty cycle table [ (minPulseSeqUsec,dutyCyclePct) ]
36
-        self.holdDutyPctD= None          # { us:dutyPct } for each us in self.pulseUsL
40
+        self.holdDutyPctD= None           # { us:dutyPct } for each us in self.pulseUsL
37 41
         self.silentNoteN = None 
38 42
         self.pulse_idx            = 0     # Index of next pulse 
39 43
         self.state                = None  # 'note_on','note_off'
@@ -45,25 +49,28 @@ class AttackPulseSeq:
45 49
         self.rtAnalyzer           = RT_Analyzer()
46 50
 
47 51
     def start( self, ms, outDir, pitch, pulseUsL, holdDutyPctL, holdDutyPctD, playOnlyFl=False ):
48
-        self.outDir     = outDir         # directory to write audio file and results
49
-        self.pitch     = pitch           # note to play
50
-        self.pulseUsL   = pulseUsL       # one onset pulse length in microseconds per sequence element
51
-        self.holdDutyPctL = holdDutyPctL
52
-        self.holdDutyPctD = holdDutyPctD
53
-        self.silentNoteN = 0 
54
-        self.pulse_idx  = 0
55
-        self.state      = 'note_on'
52
+        self.outDir          = outDir         # directory to write audio file and results
53
+        self.pitch           = pitch          # note to play
54
+        self.pulseUsL        = pulseUsL       # one onset pulse length in microseconds per sequence element
55
+        self.holdDutyPctL    = holdDutyPctL
56
+        self.holdDutyPctD    = holdDutyPctD
57
+        self.silentNoteN     = 0 
58
+        self.pulse_idx       = 0
59
+        self.state           = 'note_on'
56 60
         self.prevHoldDutyPct = None
57
-        self.next_ms    = ms + 500       # wait for 500ms to play the first note (this will guarantee that there is some empty space in the audio file before the first note)
58
-        self.eventTimeL = [[0,0]  for _ in range(len(pulseUsL))] # initialize the event time         
59
-        self.beginMs    = ms
60
-        self.playOnlyFl = playOnlyFl
61
+        self.next_ms         = ms + 500       # wait for 500ms to play the first note (this will guarantee that there is some empty space in the audio file before the first note)
62
+        self.eventTimeL      = [[0,0]  for _ in range(len(pulseUsL))] # initialize the event time         
63
+        self.beginMs         = ms
64
+        self.playOnlyFl      = playOnlyFl
61 65
                     
62 66
         # kpl if not playOnlyFl:
63 67
         self.audio.record_enable(True)   # start recording audio
64 68
 
65
-        print("Hold Delay from end of attack:",cfg.defaultHoldDelayUsecs)                    
66
-        self.api.set_hold_delay(pitch,cfg.defaultHoldDelayUsecs)
69
+        #print("Hold Delay from end of attack:",cfg.defaultHoldDelayUsecs)                    
70
+        # self.api.set_hold_delay(pitch,cfg.defaultHoldDelayUsecs)
71
+
72
+        self.api.set_hold_duty(pitch,35)
73
+        print("Hold Duty Cycle=35.")
67 74
         
68 75
         self.tick(ms)                    # play the first note
69 76
         
@@ -128,15 +135,36 @@ class AttackPulseSeq:
128 135
             
129 136
     def _set_duty_cycle( self, pitch, pulseUsec ):
130 137
 
131
-        
132
-        dutyPct = self._get_duty_cycle( pulseUsec )
138
+        if False:
139
+            dutyPct = self._get_duty_cycle( pulseUsec )
133 140
 
134
-        if dutyPct != self.prevHoldDutyPct:
135
-            self.api.set_pwm_duty( pitch, dutyPct )
136
-            print("Hold Duty:",dutyPct)
137
-            
138
-        self.prevHoldDutyPct = dutyPct
139
-    
141
+            if dutyPct != self.prevHoldDutyPct:
142
+                # self.api.set_pwm_duty( pitch, dutyPct )
143
+                # print("Hold Duty:",dutyPct)
144
+                pass
145
+
146
+            self.prevHoldDutyPct = dutyPct
147
+
148
+        if False:
149
+            maxLevel   =  64 # 225  # 64
150
+            minLevel   =  24 #  89 #  24
151
+            maxUsec    = 10000
152
+            minUsec    =  2500
153
+            decayLevel = maxLevel
154
+
155
+            if pulseUsec < maxUsec and pulseUsec >= minUsec:
156
+                decayLevel = minLevel + ((pulseUsec-minUsec)/(maxUsec-minUsec)) * (maxLevel-minLevel)
157
+            else:
158
+                if pulseUsec < minUsec:
159
+                    decayLevel = minLevel
160
+
161
+            decayLevel = int(decayLevel)
162
+
163
+            decayLevel = self.api.calc_decay_level( pulseUsec )
164
+            self.api.set_decay_level( pitch, decayLevel )
165
+            print("Decay Level:", decayLevel)
166
+
167
+        
140 168
     def _note_on( self, ms ):
141 169
 
142 170
         self.eventTimeL[ self.pulse_idx ][0] = self.audio.buffer_sample_ms().value
@@ -144,9 +172,13 @@ class AttackPulseSeq:
144 172
         self.state = 'note_off'
145 173
 
146 174
         pulse_usec = int(self.pulseUsL[ self.pulse_idx ])
147
-        self._set_duty_cycle( self.pitch, pulse_usec )
175
+        
176
+        # decay_level = self.api.calc_decay_level( pulse_usec )
177
+
178
+        #self._set_duty_cycle( self.pitch, pulse_usec )
179
+        
148 180
         self.api.note_on_us( self.pitch, pulse_usec )
149
-        print("note-on:",self.pitch, self.pulse_idx, pulse_usec)
181
+        print("note-on:",self.pitch, self.pulse_idx, pulse_usec, "dcy:", decay_level)
150 182
 
151 183
     def _note_off( self, ms ):
152 184
         self.eventTimeL[ self.pulse_idx ][1] = self.audio.buffer_sample_ms().value
@@ -209,7 +241,7 @@ class CalibrateKeys:
209 241
             self.pulseUsL  = pulseUsL
210 242
             self.pitchL   = pitchL
211 243
             self.pitch_idx = -1
212
-            self._start_next_note( ms, playOnlyFl )
244
+            self._start_next_seq( ms, playOnlyFl )
213 245
         
214 246
         
215 247
     def stop( self, ms ):
@@ -225,11 +257,11 @@ class CalibrateKeys:
225 257
 
226 258
             # if the sequencer is done playing 
227 259
             if not self.seq.is_enabled():
228
-                self._start_next_note( ms, self.seq.playOnlyFl ) # ... else start the next sequence
260
+                self._start_next_seq( ms, self.seq.playOnlyFl ) # ... else start the next sequence
229 261
 
230 262
         return None
231 263
 
232
-    def _start_next_note( self, ms, playOnlyFl ):
264
+    def _start_next_seq( self, ms, playOnlyFl ):
233 265
         
234 266
         self.pitch_idx += 1
235 267
 
@@ -253,8 +285,6 @@ class CalibrateKeys:
253 285
             # get the next available output directory id
254 286
             outDir_id = self._calc_next_out_dir_id( outDir )
255 287
 
256
-            print(outDir_id,outDir)
257
-            
258 288
             # if this is not the first time this note has been sampled then get the resample locations
259 289
             if (outDir_id == 0) or self.cfg.useFullPulseListFl:
260 290
                 self.pulseUsL = self.cfg.full_pulseL
@@ -265,9 +295,10 @@ class CalibrateKeys:
265 295
 
266 296
             holdDutyPctL = self.cfg.calibrateArgs['holdDutyPctD'][pitch]
267 297
             
268
-            
298
+            # if playback of the current calibration was requested
269 299
             if playOnlyFl:
270 300
 
301
+                # form the calibrated pulse list 
271 302
                 self.pulseUsL,_,holdDutyPctL = form_final_pulse_list( baseDir,  pitch,  self.cfg.analysisArgs, take_id=None )
272 303
 
273 304
                 noteN = cfg.analysisArgs['auditionNoteN']
@@ -318,6 +349,10 @@ class App:
318 349
         self.keyboard       = None
319 350
         self.calibrate      = None
320 351
         self.midiFilePlayer = None
352
+        self.velTablePlayer = None
353
+        self.noteTester     = None
354
+        self.polyNoteTester = None
355
+        self.chordTester    = None
321 356
         
322 357
     def setup( self, cfg ):
323 358
         self.cfg = cfg
@@ -369,6 +404,15 @@ class App:
369 404
 
370 405
                 self.midiFilePlayer = MidiFilePlayer( cfg, self.api, self.midiDev, cfg.midiFileFn )
371 406
 
407
+                self.velTablePlayer = VelTablePlayer( cfg, self.api, self.audioDev, self.cfg.calibrateArgs['holdDutyPctD'], "velMapD.json")
408
+
409
+                self.noteTester = NoteTester(cfg,self.api)
410
+
411
+                self.polyNoteTester = PolyNoteTester(cfg,self.api)
412
+
413
+                self.chordTester    = ChordTester(cfg,self.api)
414
+
415
+
372 416
         return res
373 417
 
374 418
     def tick( self, ms ):
@@ -388,13 +432,30 @@ class App:
388 432
         if self.midiFilePlayer:
389 433
             self.midiFilePlayer.tick(ms)
390 434
 
435
+        if self.midiDev:
436
+            msgL = self.midiDev.get_input()
437
+            for msg in msgL:
438
+                print(msg['value']);
439
+
440
+        if self.velTablePlayer:
441
+            self.velTablePlayer.tick(ms)
442
+
443
+        if self.noteTester:
444
+            self.noteTester.tick(ms)
445
+
446
+        if self.polyNoteTester:
447
+            self.polyNoteTester.tick(ms)
448
+                
449
+        if self.chordTester:
450
+            self.chordTester.tick(ms)
451
+            
391 452
     def audio_dev_list( self, ms ):
392 453
 
393 454
         if self.audioDev is not None:
394 455
             portL = self.audioDev.get_port_list( True )
395 456
         
396 457
             for port in portL:
397
-                print("chs:%4i label:%s" % (port['chN'],port['label']))
458
+                print("chs:%4i label:'%s'" % (port['chN'],port['label']))
398 459
         
399 460
     def midi_dev_list( self, ms ):
400 461
         d = self.midiDev.get_port_list( True )
@@ -447,6 +508,33 @@ class App:
447 508
     def midi_file_player_stop( self, ms ):
448 509
         self.midiFilePlayer.stop(ms)
449 510
 
511
+    def vel_table_updown( self, ms, argL):
512
+        self.velTablePlayer.start(argL[0],argL[1],"updown")
513
+
514
+    def vel_table_across( self, ms, argL ):
515
+        self.velTablePlayer.start(argL[0],argL[1],"across")
516
+
517
+    def vel_table_stop( self, ms ):
518
+        self.velTablePlayer.stop()
519
+
520
+    def note_tester_start( self, ms ):
521
+        self.noteTester.start();
522
+
523
+    def note_tester_stop( self, ms ):
524
+        self.noteTester.stop();
525
+
526
+    def poly_note_tester_start( self, ms ):
527
+        self.polyNoteTester.start();
528
+
529
+    def poly_note_tester_stop( self, ms ):
530
+        self.polyNoteTester.stop();
531
+
532
+    def chord_tester_start( self, ms ):
533
+        self.chordTester.start()
534
+
535
+    def chord_tester_stop( self, ms ):
536
+        self.chordTester.stop()
537
+        
450 538
     def pedal_down( self, ms ):
451 539
         print("pedal_down")
452 540
         self.midiDev.send_controller(64, 100 )
@@ -454,6 +542,12 @@ class App:
454 542
     def pedal_up( self, ms ):
455 543
         print("pedal_up");
456 544
         self.midiDev.send_controller(64, 0 )
545
+
546
+    def all_notes_off(self, ms):
547
+        self.api.all_notes_off();
548
+
549
+    def check_for_errors(self,ms):
550
+        self.api.check_for_serial_errors()
457 551
         
458 552
     def quit( self, ms ):
459 553
         if self.api:
@@ -587,8 +681,19 @@ class Shell:
587 681
             'R':{ "func":"keyboard_repeat_target_db", "minN":1,  "maxN":1, "help":"Repeat db across keyboard with new pulse_idx"},
588 682
             'F':{ "func":"midi_file_player_start",    "minN":0,  "maxN":0, "help":"Play the MIDI file."},
589 683
             'f':{ "func":"midi_file_player_stop",     "minN":0,  "maxN":0, "help":"Stop the MIDI file."},
684
+            'V':{ "func":"vel_table_updown",          "minN":2,  "maxN":2, "help":"Play Velocity Table up/down - across."},
685
+            'A':{ "func":"vel_table_across",          "minN":2,  "maxN":2, "help":"Play Velocity Table across - up/down."},
686
+            'v':{ "func":"vel_table_stop",            "minN":0,  "maxN":0, "help":"Stop the velocity table playback."},
687
+            'N':{ "func":"note_tester_start",         "minN":0,  "maxN":0, "help":"Play a note using NoteTester."},
688
+            'n':{ "func":"note_tester_stop",          "minN":0,  "maxN":0, "help":"Stop NoteTester."},
689
+            'T':{ "func":"poly_note_tester_start",    "minN":0,  "maxN":0, "help":"Play random notes using PolyNoteTester."},
690
+            't':{ "func":"poly_note_tester_stop",     "minN":0,  "maxN":0, "help":"Stop NoteTester."},
691
+            'H':{ "func":"chord_tester_start",        "minN":0,  "maxN":0, "help":"Chord tester start."},
692
+            'h':{ "func":"chord_tester_stop",         "minN":0,  "maxN":0, "help":"Chord tester stop."},
590 693
             'P':{ "func":"pedal_down",                "minN":0,  "maxN":0, "help":"Pedal down."},
591
-            'U':{ "func":"pedal_up",                  "minN":0,  "maxN":0, "help":"Pedal up."},
694
+            'p':{ "func":"pedal_up",                  "minN":0,  "maxN":0, "help":"Pedal up."},
695
+            'O':{ "func":"all_notes_off",             "minN":0,  "maxN":0, "help":"All notes off."},
696
+            'E':{ "func":"check_for_errors",          "minN":0,  "maxN":0, "help":"Check for errors."}
592 697
             }
593 698
 
594 699
     def _help( self, _=None ):

+ 261
- 98
p_ac.yml View File

@@ -5,6 +5,7 @@
5 5
     # Audio device setup
6 6
     audio: {
7 7
       inPortLabel: "8 USB Audio CODEC:", #"HDA Intel PCH: CS4208", # "5 USB Audio CODEC:", #"5 USB Sound Device",
8
+      #inPortLabel: "8 Scarlett 18i20 USB: Audio",
8 9
       outPortLabel: ,
9 10
     },
10 11
 
@@ -12,10 +13,60 @@
12 13
         inMonitorFl: False,
13 14
         outMonitorFl: False,
14 15
         throughFl: False,
15
-        inPortLabel: "Fastlane:Fastlane MIDI A",
16
-        outPortLabel: "Fastlane:Fastlane MIDI A"
16
+        #inPortLabel: "MIDI9/QRS PNOScan:MIDI9/QRS PNOScan MIDI 1",
17
+        #outPortLabel: "MIDI9/QRS PNOScan:MIDI9/QRS PNOScan MIDI 1"
18
+        #inPortLabel: "Fastlane:Fastlane MIDI A",
19
+        #outPortLabel: "Fastlane:Fastlane MIDI A",
17 20
         #inPortLabel: "picadae:picadae MIDI 1",
18
-        #outPortLabel: "picadae:picadae MIDI 1"
21
+        #outPortLabel: "picadae:picadae MIDI 1"        
22
+    },
23
+
24
+    NoteTester:
25
+    {
26
+      noteCount: 200,
27
+      minNoteDurMs: 100,
28
+      maxNoteDurMs: 1000,
29
+      minPauseDurMs: 5,
30
+      maxPauseDurMs: 500,
31
+      pitch: 60,
32
+      minAttackUsec: 4000,
33
+      maxAttackUsec: 20000,
34
+      filename: "note_tester.json"
35
+    },
36
+
37
+    PolyNoteTester:
38
+    {
39
+      mode: "simple",
40
+      noteCount: 11,
41
+      minPitch: 21,
42
+      maxPitch: 31,
43
+      skipPitchL: [22,68,102],
44
+      minNoteDurMs: 1000,
45
+      maxNoteDurMs: 2000,
46
+      minInterOnsetMs: 100,
47
+      maxInterOnsetMs: 1000,
48
+      minAttackUsec: 4000,
49
+      maxAttackUsec: 20000,
50
+      holdDutyPct: 35,
51
+      
52
+    },
53
+
54
+    ChordTester:
55
+    {
56
+       useVelTableFl: False,
57
+       #pitchL: [24,36,48,60,72,84,96],
58
+       #pitchL: [24,96,48,72,36,84,60],
59
+       #pitchL: [ 36,40,43,47, 48, 52, 55, 59],
60
+       #pitchL:  [ 36,39,41,33 ],
61
+       pitchL:   [ 21,23,24,25,26,27,28,29,30,31],
62
+       #pitchL:  [ 36,33,35,34,37,40,43,42,38,39,41],
63
+       #pitchL:   [ 43,44,45,46,47,48,49,50,51,52,53],
64
+       #pitchL:  [ 54,55,56,57,58,59,60,61,62,63,64 ],
65
+       repeatCnt: 3,
66
+       atkUsec: 10000,
67
+       durMs: 1000,
68
+       pauseMs: 1000,
69
+       holdDuty: 35,
19 70
     },
20 71
     
21 72
     # Picadae API args
@@ -28,11 +79,11 @@
28 79
     
29 80
 
30 81
     # MeasureSeq args
31
-    outDir: "~/temp/p_ac_3_of",
82
+    outDir: "~/temp/p_ac_3_ok",
32 83
     noteDurMs: 500,
33 84
     pauseDurMs: 500,
34 85
     reversePulseListFl: True,
35
-    useFullPulseListFl: True,
86
+    useFullPulseListFl: True,     # don't select a new set of resample points based on the previous samples from this pitch
36 87
     maxSilentNoteCount: 4,
37 88
     silentNoteMaxPulseUs: 15000,
38 89
     silentNoteMinDurMs: 180, #250,
@@ -40,7 +91,7 @@
40 91
     defaultHoldDelayUsecs: 1000,
41 92
 
42 93
     # Midi file player
43
-    midiFileFn: "/home/kevin/media/audio/midi/txt/round4.txt",
94
+    midiFileFn: "/home/kevin/media/audio/midi/txt/988-v25.txt",
44 95
     
45 96
     
46 97
 
@@ -94,7 +145,26 @@
94 145
     full_pulse22L: [  3500, 3750, 4000, 4250, 4500, 4750, 5000, 5250, 5500, 5750, 6000, 6250, 6500, 6750, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000 ],
95 146
 
96 147
     # 60,72,84    
97
-    full_pulseL: [  2000, 2250, 2500,2750, 3000, 3250, 3500, 3750, 4000, 4250, 4500, 4750, 5000, 5250, 5500, 5750, 6000, 6250, 6500, 6750, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000, 22000  ],
148
+    full_pulse23L: [  2000, 2250, 2500,2750, 3000, 3250, 3500, 3750, 4000, 4250, 4500, 4750, 5000, 5250, 5500, 5750, 6000, 6250, 6500, 6750, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000, 22000  ],
149
+
150
+    full_pulseL24: [  5000, 5125, 5250, 5375, 5500, 5625, 5750, 5875, 6000, 6125, 6250, 6500, 6750, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000, 22000  ],
151
+
152
+    # 23-40
153
+    full_pulseL25: [  3500, 3625, 3750, 3875, 4000, 4125, 4250, 4375, 4500, 4625, 4750, 4875, 5000, 5125, 5250, 5375, 5500, 5625, 5750, 5875, 6000, 6125, 6250, 6375, 6500, 6625, 6750, 6875, 7000, 7250, 7500, 7750, 8000, 8250, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000  ],
154
+
155
+    full_pulse25aL: [  2000, 2050, 2100, 2150, 2200, 2250, 2300, 2350, 2400, 2450, 2500, 2550, 2600, 2650, 2700, 2750, 2800, 2850, 2900, 2950, 3000, 3050, 3100, 3150, 3200, 3250, 3300, 3350, 3400, 3450, 3500, 3550, 3600, 3650, 3700, 3750, 3800, 3850, 3900, 3950, 4000, 4050, 4100, 4150, 4200, 4250, 4300, 4350, 4400, 4450, 4500, 4550, 4600, 4650, 4700, 4750, 4800, 4850, 4900, 4950, 5000, 5050, 5100, 5150, 5200, 5250, 5300, 5350, 5400, 5450, 5500, 5550, 5600, 5650, 5700, 5750, 5800, 5850, 5900, 5950, 6000, 6125, 6250, 6375, 6500, 6625, 6750, 6875, 7000, 7250, 7500, 7750, 8000, 8250, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000  ],
156
+
157
+    # 21-    
158
+    full_pulse26L: [  1500, 1625, 1750, 1875, 2000, 2125, 2250, 2375, 2500, 2625, 2750, 2875, 3000, 3125, 3250, 3375,3500, 3625, 3750, 3875, 4000, 4125, 4250, 4375, 4500, 4625, 4750, 4875, 5000, 5125, 5250, 5375, 5500, 5625, 5750, 5875, 6000, 6125, 6250, 6375, 6500, 6625, 6750, 6875, 7000, 7250, 7500, 7750, 8000, 8250, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000, 22000  ],
159
+
160
+    full_pulseL: [  1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400, 3500, 3625, 3750, 3875, 4000, 4125, 4250, 4375, 4500, 4625, 4750, 4875, 5000, 5125, 5250, 5375, 5500, 5625, 5750, 5875, 6000, 6125, 6250, 6375, 6500, 6625, 6750, 6875, 7000, 7250, 7500, 7750, 8000, 8250, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000, 22000  ],
161
+    
162
+    # 92
163
+    full_pulse27L: [  1500, 1625, 1750, 1875, 2000, 2125, 2250, 2375, 2500, 2625, 2750, 2875, 3000, 3125, 3250, 3375, 3500, 3625, 3750, 3875, 4000, 4125, 4250, 4375, 4500, 4625, 4750, 4875, 5000, 5125, 5250, 5375, 5500, 5625, 5750, 5875, 6000, 6125, 6250, 6375, 6500, 6625, 6750, 6875, 7000, 7250, 7500, 7750, 8000, 8250, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 14000, 15000, 16000, 17000, 18000, 19000  ],
164
+
165
+    full_pulse28L: [ 4000, 8000, 12000, 16000 ],
166
+
167
+    full_pulse29L: [ 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500, 10000, 10500, 11000, 11500, 12000, 12500, 13000, 13500, 14000, 14500, 15000, 15500, 16000, 16500, 17000, 17500, 18000, 18500, 19000, 19500, 20000 ],
98 168
 
99 169
     # RMS analysis args
100 170
     analysisArgs: {
@@ -112,28 +182,113 @@
112 182
       resampleMinDurMs: 150,         # notes's whose duration is less than this will be skipped
113 183
 
114 184
       useLastTakeOnlyFl: True,
115
-      minAttkDb: -5.0,   # threshold of silence level 
116
-      maxDbOffset: 0.25, # travel down the from the max. note level by at most this amount to locate the max. peak
117
-      maxDeltaDb: 1.5,  # maximum db change between volume samples (changes greater than this will trigger resampling)
118
-      samplesPerDb: 4,   # count of samples per dB to resample ranges whose range is less than maxDeltaDb
119
-      minSampleDistUs: 50, # minimum distance between sample points in microseconds
185
+      minAttkDb: -5.0,      # threshold of silence level 
186
+      maxDbOffset: 0.25,    # travel down the from the max. note level by at most this amount to locate the max. peak
187
+      maxDeltaDb: 1.5,      # maximum db change between volume samples (changes greater than this will trigger resampling)
188
+      samplesPerDb: 4,      # count of samples per dB to resample ranges whose range is less than maxDeltaDb
189
+      minSampleDistUs: 50,  # minimum distance between sample points in microseconds
120 190
       auditionNoteN: 19,    # count of notes to play for audition
121 191
 
122 192
       finalPulseListCacheFn: "/home/kevin/temp/final_pulse_list_cache.pickle",
123 193
       rmsAnalysisCacheFn: "/home/kevin/temp/rms_analysis_cache.pickle"
124 194
       },
125 195
 
196
+      # used by plot_seq_1.gen_vel_map()
197
+      velTableDbL: [ 2, 7, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 27, 29  ],
198
+
126 199
       manualMinD: {
127
-        36: [2, 10],
128
-        48: [2, 10],
129
-        60: [2, 10],
130
-        72: [2, 10],
131
-        84: [2, 10]
132
-        },
200
+      21:[-1,6], 
201
+      23:[-1,1], # 10
202
+      24:[-1,11], # 11 
203
+      25:[-1,8], 
204
+      26:[-1,9], # 13 
205
+      27:[-1,11], 
206
+      28:[-1,2], 
207
+      29:[-1,16], 
208
+      30:[-1,4], 
209
+      31:[-1,8], 
210
+      32:[-1,9], 
211
+      33:[-1,10], 
212
+      34:[-1,9], # 15 
213
+      35:[-1,9], 
214
+      36:[-1,4], 
215
+      37:[-1,7], 
216
+      38:[-1,5], 
217
+      39:[-1,5], 
218
+      40:[-1,6],  # 2  lwr
219
+      41:[-1,10],  # 24 lwr
220
+      42:[-1,2], 
221
+      43:[-1,4], 
222
+      44:[-1,5], 
223
+      45:[-1,10], 
224
+      46:[-1,4], 
225
+      47:[-1,7], 
226
+      48:[-1,9], 
227
+      49:[-1,2],
228
+      50:[-1,5],
229
+      51:[-1,4], 
230
+      52:[-1,8], 
231
+      53:[-1,0], # 16
232
+      54:[-1,8], 
233
+      55:[-1,14], 
234
+      56:[-1,8], 
235
+      57:[-1,9], 
236
+      58:[-1,10], 
237
+      59:[-1,7], 
238
+      60:[-1,7], # 14
239
+      61:[-1,10], # 14
240
+      62:[-1,1], # 7
241
+      63:[-1,5], 
242
+      64:[-1,2], 
243
+      65:[-1,8], 
244
+      66:[-1,3], 
245
+      67:[-1,3], # 17 lwr
246
+      68:[-1,3], 
247
+      69:[-1,9], 
248
+      70:[-1,15], # 15 lwr 
249
+      71:[-1,0], # 7 lwr
250
+      72:[-1,3],# 12 lwr
251
+      73:[-1,0],# 21 lwr
252
+      74:[-1,0],# 24 lwr
253
+      75:[-1,0],# 18 lwr
254
+      76:[-1,0],# 13 lwr
255
+      77:[-1,0],# 22 lwr
256
+      78:[-1,0],# 14 lwr
257
+      79:[-1,8], 
258
+      80:[-1,3], 
259
+      81:[-1,2],  # 14 lwr 
260
+      82:[-1,5],  # 11
261
+      83:[-1,7], 
262
+      84:[-1,3], # 13
263
+      85:[-1,5], 
264
+      86:[-1,4], 
265
+      87:[-1,7], 
266
+      88:[-1,5], # 22
267
+      89:[-1,19], 
268
+      90:[-1,2], # 10
269
+      91:[-1,10], 
270
+      92:[-1,8], 
271
+      93:[-1,7], 
272
+      94:[-1,5], # 10
273
+      95:[-1,9], 
274
+      96:[-1,13], 
275
+      97:[-1,12], 
276
+      98:[-1,14], 
277
+      99:[-1,14], 
278
+      100:[-1,18], 
279
+      101:[-1,18], 
280
+      103:[-1,25], 
281
+      104:[-1,26], 
282
+      105:[-1,18], 
283
+      106:[-1,26], 
284
+      107:[-1,29], 
285
+      108:[-1,28], 
286
+      },
133 287
 
134
-      manualAnchorPitchMinDbL: [ 36,48,72,84 ],
135
-      manualAnchorPitchMaxDbL: [ 36,48,60,72,84 ],
136
-        
288
+      manualAnchorPitchMinDbL: [ 24, 36,48,60,72,84,96 ],
289
+      manualAnchorPitchMaxDbL: [ 24, 36,48,60,72,84,96 ],
290
+
291
+      manualLastFl: true,
137 292
         
138 293
       manualMinD_0: {
139 294
         23: [2, 24],
@@ -256,85 +411,93 @@
256 411
           dbSrcLabel: 'hm',              # source of the db measurement 'td' (time-domain) or 'hm' (harmonic)
257 412
 
258 413
           holdDutyPctD:  {
259
-          23: [[0, 40]],
260
-          24: [[0, 40]],
261
-          25: [[0, 40]],
262
-          26: [[0, 40]],
263
-          27: [[0, 40]],
264
-          28: [[0, 40]],
265
-          29: [[0, 40]],
266
-          30: [[0, 40]],
267
-          31: [[0, 40]],
268
-          32: [[0, 40]],
269
-          33: [[0, 40]],
270
-          34: [[0, 40]],
271
-          35: [[0, 40]],
272
-          36: [[0, 40]],
273
-          37: [[0, 40]],
274
-          38: [[0, 40]],
275
-          39: [[0, 40]],
276
-          40: [[0, 40]],
277
-          41: [[0, 40]],
278
-          42: [[0, 40]],
279
-          43: [[0, 40]],
280
-          44: [[0, 40]],
281
-          45: [[0, 40]],
282
-          46: [[0, 40]],
283
-          47: [[0, 40]],
284
-          48: [[0, 40]],
285
-          49: [[0, 40]],
286
-          50: [[0, 40]],
287
-          51: [[0, 40]],
288
-          52: [[0, 40]],
289
-          53: [[0, 40]],
290
-          54: [[0, 40]],
291
-          55: [[0, 40]],
292
-          56: [[0, 40]],
293
-          57: [[0, 40]],
294
-          58: [[0, 40]],
295
-          59: [[0, 45]],
296
-          60: [[0, 40],[10000,50]],
297
-          61: [[0, 40],[10000,50]],
298
-          62: [[0, 40],[10000,50]],
299
-          63: [[0, 40],[10000,50]],
300
-          64: [[0, 40],[10000,50]],
301
-          65: [[0, 99]],              
302
-          66: [[0, 40]],
303
-          67: [[0, 40],[14000, 45],[15000,50],[16000,55],[17000,60],[18000,65],[19000,55]],
304
-          68: [[0, 40],[14000, 45],[15000,50],[16000,55],[17000,60],[18000,65],[19000,55]],
305
-          69: [[0, 40],[14000, 45],[15000,50],[16000,55],[17000,60],[18000,65],[19000,55]],
306
-          70: [[0, 40],[14000, 45],[15000,50],[16000,55],[17000,60],[18000,65],[19000,55]],
307
-          71: [[0, 40],[14000, 45],[15000,50],[16000,55],[17000,60],[18000,65],[19000,55]],
308
-          72: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
309
-          73: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
310
-          74: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
311
-          75: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
312
-          76: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
313
-          77: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
314
-          78: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
315
-          79: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
316
-          80: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
317
-          81: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
318
-          82: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
319
-          83: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
320
-          84: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
321
-          85: [[0, 42],[8000,44],[9000,46],[10000, 48],[11000,50],[12000,52],[13000,54],[14000,56],[15000,58],[16000,60],[17000,60],[18000,60],[19000,60],[20000,60] ],
322
-          86: [[0, 40]],
323
-          87: [[0, 40]],
324
-          88: [[0, 40]],
325
-          89: [[0, 40]],
326
-          91: [[0, 40]],
327
-          92: [[0, 40]],
328
-          93: [[0, 40]],
329
-          94: [[0, 40]],
330
-          95: [[0, 40]],
331
-          96: [[0, 40]],
414
+          21: [[0, 50]],
415
+          23: [[0, 50]],
416
+          24: [[0, 50]],
417
+          25: [[0, 50]],
418
+          26: [[0, 50]],
419
+          27: [[0, 50]],
420
+          28: [[0, 50]],
421
+          29: [[0, 50]],
422
+          30: [[0, 50]],
423
+          31: [[0, 50]],
424
+          32: [[0, 50]],
425
+          33: [[0, 50]],
426
+          34: [[0, 50]],
427
+          35: [[0, 50]],
428
+          36: [[0, 50]],
429
+          37: [[0, 50]],
430
+          38: [[0, 50]],
431
+          39: [[0, 50]],
432
+          40: [[0, 50]],
433
+          41: [[0, 45]],
434
+          42: [[0, 45]],
435
+          43: [[0, 45]],
436
+          44: [[0, 45]],
437
+          45: [[0, 45]],
438
+          46: [[0, 40],[10000,45]],
439
+          47: [[0, 40],[10000,45]],
440
+          48: [[0, 40],[10000,45]],
441
+          49: [[0, 40],[10000,45]],
442
+          50: [[0, 40],[10000,45]],
443
+          51: [[0, 40],[10000,45]],
444
+          52: [[0, 40],[10000,45]],
445
+          53: [[0, 40],[10000,45]],
446
+          54: [[0, 40],[10000,45]],
447
+          55: [[0, 40],[10000,45]],
448
+          56: [[0, 40],[10000,45]],
449
+          57: [[0, 40],[10000,45]],
450
+          58: [[0, 40],[10000,45]],
451
+          59: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],       
452
+          60: [[0, 40],[10000,43],[11000,45],[12000,45], [13000,50],[14000,55],[15000,60],[16000,65]],
453
+          61: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
454
+          62: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
455
+          63: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
456
+          64: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
457
+          65: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],              
458
+          66: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
459
+          67: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
460
+          68: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
461
+          69: [[0, 32],[5000,64] ],
462
+          70: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
463
+          71: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
464
+          72: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
465
+          73: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
466
+          74: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
467
+          75: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
468
+          76: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
469
+          77: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55],[15000,60]],
470
+          78: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
471
+          79: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
472
+          80: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
473
+          81: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
474
+          82: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
475
+          83: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
476
+          84: [[0, 35],[8000,40],[10000,45],[12000,48],[13000,50],[14000,55]],
477
+          85: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
478
+          86: [[0, 40],[10000,45],[12000,48],[13000,50],[14000,55]],
479
+          87: [[0, 40],[10000,45],[12000,48],[13000,50]],
480
+          88: [[0, 40],[10000,45],[12000,48],[13000,50]],
481
+          89: [[0, 40],[10000,45],[12000,48],[13000,50]],
482
+          90: [[0, 40],[10000,45],[12000,48],[13000,50]],
483
+          91: [[0, 40],[10000,45],[12000,48],[13000,50]],
484
+          92: [[0, 37]],
485
+          93: [[0, 37]],
486
+          94: [[0, 37]],
487
+          95: [[0, 37]],
488
+          96: [[0, 37]],
332 489
           97: [[0, 40]],
333 490
           98: [[0, 40]],
334
-          99: [[0, 40]],
335
-          100: [[0, 40]],
336
-          101: [[0, 40]],
337
-          106: [[0, 40]]
491
+          99: [[0, 37]],
492
+          100: [[0, 37]],
493
+          101: [[0, 37]],
494
+          102: [[0, 37]],
495
+          103: [[0, 40],[10000,45],[15000,50]],
496
+          104: [[0, 40],[7500,45],[15000,50]],
497
+          105: [[0, 40],[10000,45],[15000,50]],
498
+          106: [[0, 37]],
499
+          107: [[0, 37]],
500
+          108: [[0, 37]],
338 501
           },
339 502
 
340 503
           # Final for Matt's piano

Loading…
Cancel
Save