Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /trunk/synth/riffdisp.srp [r78] .. [r79] Maximize Restore

  Switch to side-by-side view

--- a/trunk/synth/riffdisp.srp
+++ b/trunk/synth/riffdisp.srp
@@ -14,6 +14,23 @@
 
 // ---------- riffs as backgrounds ---------
 // type, time, dur, pitch
+riff0v1 = [['n', 0, 61, 1],
+           ['n', 1, 63, 1],
+           ['n', 2, 66, 1],
+           ['n', 4, 61, 1],
+           ['n', 5, 63, 1],
+           ['n', 6, 68, 1],
+           ['n', 7, 66, 1],
+           ['n', 8, 61, 1],
+           ['n', 9, 63, 1],
+           ['n', 10, 66, 1]]
+riff0v2 = [['n', 2, 66, 1],
+           ['n', 3, 68, 1],
+           ['n', 6, 72, 1],
+           ['n', 7, 70, 1],
+           ['n', 10, 66, 1],
+           ['n', 11, 68, 1],
+           ['n', 13, 70, 2]]
 riff1v1 = [['n', 0, 63, 0.5],
            ['n', 1.5, 66, 0.5],
            ['n', 2, 68, 0.5],
@@ -42,7 +59,7 @@
            ['n', 14,   75, 0.5],
            ['n', 14.5, 73, 0.5],
            ['n', 15,   75, 0.5]]
-all_riffs = [[riff1v1, riff1v2]]
+all_riffs = [[riff0v1, riff0v2], [riff1v1, riff1v2]]
 
 
 # For testing:
@@ -268,6 +285,7 @@
         // [timestamp, voice, pitch, vel]+, so msg len == 4 + 7N
         if (len(msg) - 4) % 7 != 0:
             display "handle_note_event - bad message", len(msg)
+            return
         var i = 4
         vtsched.start_use()
         while i < len(msg):
@@ -385,7 +403,14 @@
         // need to round down, but int() rounds toward zero
         var old = curbeat
         curbeat = (int(b + EPSILON) if b >= 0 else int(b + EPSILON - 1))
-        if curbeat % 16 == 0 and old != curbeat: // DOWNBEAT
+
+        if old != curbeat: // a new beat
+            # display "beat calls synth_set_some_state"
+            synth_set_some_state(2, 61, 100)
+            // turn the drum off in 1/2 beat
+            vtsched.cause(DRUM_BEAT_PERIOD / 2, nil, 'synth_set_some_state', 2, 61, 0)
+
+        if curbeat % 16 == 0 and old != curbeat: // DOWNBEAT OF 4-BAR CYCLE
             display "**** Downbeat", curbeat, state, the_sched.time
             if state == 'solo_next'
                 state = 'solo'