From 61effea756c6bca0bef5b8593108413cc6b5b768 Mon Sep 17 00:00:00 2001
From: cancel <cancel@cancel.fm>
Date: Wed, 9 Jan 2019 23:10:21 +0900
Subject: [PATCH] Fix '=' bugs, flip param order, increase limit to 16

---
 bank.h |  2 +-
 sim.c  | 11 ++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/bank.h b/bank.h
index 5812801..7fa7821 100644
--- a/bank.h
+++ b/bank.h
@@ -19,7 +19,7 @@ typedef struct {
   U8 bar_divisor;
 } Oevent_midi;
 
-enum { Oevent_osc_int_count = 4 };
+enum { Oevent_osc_int_count = 16 };
 
 typedef struct {
   U8 oevent_type;
diff --git a/sim.c b/sim.c
index 3b014e9..a93484e 100644
--- a/sim.c
+++ b/sim.c
@@ -370,20 +370,17 @@ BEGIN_OPERATOR(midi)
 END_OPERATOR
 
 BEGIN_OPERATOR(osc)
-  PORT(0, 2, IN | PARAM);
   PORT(0, 1, IN | PARAM);
-  Usz len = index_of(PEEK(0, 1)) + 1;
+  PORT(0, 2, IN | PARAM);
+  Usz len = index_of(PEEK(0, 2)) + 1;
   if (len > Oevent_osc_int_count)
     len = Oevent_osc_int_count;
   for (Usz i = 0; i < len; ++i) {
-    PORT(0, (Isz)i + 1, IN);
+    PORT(0, (Isz)i + 3, IN);
   }
   STOP_IF_NOT_BANGED;
-  Glyph g = PEEK(0, 2);
+  Glyph g = PEEK(0, 1);
   if (g != '.') {
-    Usz len = index_of(PEEK(0, 1)) + 1;
-    if (len > Oevent_osc_int_count)
-      len = Oevent_osc_int_count;
     U8 buff[Oevent_osc_int_count];
     for (Usz i = 0; i < len; ++i) {
       buff[i] = (U8)index_of(PEEK(0, (Isz)i + 3));