diff --git a/thereminus/samples.h b/thereminus/samples.h new file mode 100644 index 0000000..c55c63f --- /dev/null +++ b/thereminus/samples.h @@ -0,0 +1,4 @@ +// custom samples at 22KHz +const uint8_t kick[] PROGMEM = {161, 20, 0, 0, 128, 128, 128, 127, 129, 129, 129, 128, 128, 127, 128, 128, 129, 128, 128, 128, 129, 128, 128, 127, 128, 128, 127, 130, 130, 125, 122, 126, 129, 134, 135, 129, 123, 122, 140, 127, 118, 123, 115, 105, 130, 140, 148, 144, 128, 116, 122, 141, 134, 128, 130, 133, 134, 127, 113, 122, 128, 129, 116, 124, 141, 147, 139, 123, 124, 122, 110, 124, 127, 145, 135, 123, 114, 125, 123, 122, 122, 131, 114, 108, 115, 121, 129, 121, 137, 142, 123, 108, 117, 129, 136, 115, 113, 121, 149, 127, 124, 116, 150, 165, 157, 142, 122, 128, 141, 167, 168, 155, 144, 145, 154, 152, 157, 159, 155, 158, 149, 148, 138, 140, 140, 138, 146, 140, 135, 129, 131, 114, 105, 109, 93, 98, 90, 100, 82, 85, 80, 78, 82, 75, 79, 68, 75, 64, 74, 79, 72, 76, 78, 87, 78, 79, 86, 88, 84, 90, 103, 107, 106, 103, 115, 116, 119, 130, 142, 144, 144, 143, 152, 151, 162, 170, 182, 190, 192, 189, 186, 194, 197, 207, 205, 212, 208, 217, 212, 213, 220, 219, 214, 217, 208, 210, 207, 206, 209, 204, 203, 192, 190, 180, 180, 175, 170, 165, 165, 152, 146, 138, 134, 127, 121, 114, 111, 107, 97, 91, 87, 78, 72, 63, 60, 58, 52, 53, 40, 45, 39, 40, 33, 26, 28, 23, 30, 24, 30, 29, 29, 29, 28, 37, 30, 36, 32, 40, 42, 41, 49, 49, 58, 58, 64, 66, 67, 72, 81, 89, 90, 95, 102, 109, 112, 117, 124, 125, 130, 137, 142, 151, 151, 157, 163, 165, 173, 175, 183, 185, 187, 194, 196, 200, 204, 209, 207, 211, 214, 219, 221, 218, 224, 222, 226, 224, 223, 227, 225, 227, 223, 221, 221, 223, 221, 219, 217, 213, 211, 204, 207, 204, 203, 198, 193, 193, 188, 183, 178, 175, 169, 169, 164, 160, 152, 146, 146, 139, 137, 131, 128, 123, 116, 115, 110, 107, 100, 100, 96, 91, 83, 80, 78, 72, 72, 67, 65, 58, 53, 53, 48, 45, 44, 40, 39, 37, 36, 36, 31, 29, 30, 32, 31, 28, 28, 28, 29, 30, 33, 31, 33, 33, 35, 38, 36, 41, 42, 45, 48, 50, 53, 54, 58, 60, 65, 68, 73, 75, 77, 81, 86, 92, 94, 98, 102, 106, 110, 113, 118, 123, 126, 132, 136, 138, 143, 145, 150, 154, 158, 164, 167, 169, 171, 177, 181, 184, 187, 192, 196, 198, 202, 204, 207, 209, 213, 216, 218, 221, 222, 224, 226, 229, 230, 232, 232, 234, 235, 235, 236, 236, 238, 237, 238, 238, 237, 237, 235, 235, 234, 233, 231, 229, 227, 224, 223, 219, 216, 213, 210, 206, 202, 199, 194, 190, 186, 181, 176, 171, 167, 161, 156, 150, 145, 141, 135, 130, 125, 120, 114, 109, 104, 99, 95, 91, 86, 82, 78, 74, 69, 67, 63, 59, 54, 53, 50, 47, 43, 41, 38, 36, 33, 31, 29, 26, 24, 22, 20, 19, 18, 14, 15, 13, 13, 11, 10, 9, 9, 8, 8, 8, 8, 8, 10, 8, 11, 10, 12, 14, 16, 18, 18, 21, 23, 26, 27, 32, 33, 38, 41, 44, 49, 54, 58, 62, 66, 71, 76, 80, 86, 89, 95, 102, 106, 111, 116, 121, 127, 132, 137, 142, 148, 154, 159, 163, 168, 173, 177, 183, 184, 192, 193, 199, 200, 207, 212, 215, 216, 219, 224, 224, 231, 230, 232, 234, 236, 238, 238, 239, 238, 241, 242, 244, 244, 241, 244, 243, 244, 242, 244, 243, 243, 244, 243, 242, 240, 242, 239, 241, 240, 240, 237, 236, 235, 234, 233, 230, 229, 227, 226, 223, 222, 216, 215, 213, 209, 206, 204, 201, 196, 195, 190, 185, 182, 179, 175, 169, 165, 160, 159, 153, 147, 143, 139, 135, 129, 126, 120, 116, 113, 107, 104, 99, 94, 92, 88, 82, 78, 75, 72, 67, 63, 61, 57, 54, 50, 48, 44, 42, 40, 36, 34, 32, 29, 29, 26, 22, 23, 22, 20, 20, 18, 18, 15, 15, 17, 15, 16, 15, 17, 15, 15, 15, 16, 19, 17, 20, 17, 20, 20, 20, 22, 22, 24, 24, 26, 26, 29, 28, 28, 33, 31, 35, 35, 36, 38, 39, 41, 43, 45, 46, 48, 50, 55, 55, 58, 59, 64, 66, 68, 71, 75, 79, 81, 86, 89, 91, 95, 99, 104, 108, 110, 115, 119, 122, 127, 131, 135, 140, 144, 149, 152, 157, 162, 166, 170, 174, 178, 181, 185, 188, 194, 196, 196, 199, 205, 208, 210, 214, 214, 216, 216, 218, 222, 222, 224, 224, 226, 230, 231, 232, 232, 235, 234, 236, 236, 235, 237, 236, 238, 237, 237, 236, 235, 235, 232, 234, 232, 230, 230, 229, 231, 229, 228, 228, 228, 226, 226, 224, 222, 223, 220, 222, 220, 219, 217, 216, 216, 213, 213, 211, 210, 207, 205, 203, 202, 198, 197, 194, 191, 188, 184, 183, 180, 177, 174, 169, 167, 163, 160, 158, 152, 150, 146, 142, 138, 134, 131, 128, 123, 120, 115, 112, 107, 105, 100, 96, 93, 89, 85, 81, 78, 74, 72, 67, 65, 61, 58, 57, 53, 52, 47, 45, 44, 42, 39, 37, 37, 35, 34, 31, 30, 28, 28, 26, 26, 25, 23, 24, 21, 22, 22, 21, 22, 20, 20, 19, 21, 22, 21, 21, 21, 23, 23, 24, 24, 25, 26, 27, 29, 29, 30, 32, 33, 35, 35, 36, 36, 39, 40, 41, 44, 43, 45, 45, 50, 49, 50, 51, 52, 56, 58, 59, 59, 62, 65, 65, 70, 71, 73, 75, 77, 80, 84, 87, 87, 91, 93, 96, 98, 102, 105, 108, 110, 113, 118, 119, 123, 126, 129, 133, 135, 140, 141, 146, 149, 151, 155, 159, 163, 166, 169, 170, 175, 178, 181, 185, 187, 190, 193, 196, 198, 201, 203, 205, 208, 210, 212, 214, 214, 217, 218, 220, 220, 222, 223, 225, 226, 226, 229, 228, 229, 229, 231, 231, 232, 232, 232, 233, 233, 235, 233, 234, 233, 233, 233, 232, 232, 231, 231, 231, 228, 228, 227, 228, 226, 225, 222, 223, 220, 221, 219, 218, 217, 215, 214, 212, 211, 210, 208, 206, 205, 203, 202, 200, 198, 195, 194, 191, 189, 187, 186, 182, 181, 176, 174, 171, 170, 168, 164, 161, 158, 157, 153, 152, 148, 145, 143, 141, 139, 136, 132, 129, 127, 123, 121, 119, 115, 113, 109, 106, 105, 101, 98, 95, 91, 89, 87, 84, 81, 77, 75, 73, 69, 67, 65, 63, 60, 58, 55, 53, 52, 50, 48, 46, 45, 42, 41, 39, 38, 38, 36, 35, 33, 33, 32, 31, 31, 29, 28, 30, 27, 27, 27, 27, 26, 25, 25, 26, 25, 25, 26, 25, 26, 26, 28, 26, 29, 28, 29, 30, 30, 32, 32, 33, 33, 35, 36, 36, 37, 39, 39, 41, 41, 43, 45, 47, 48, 48, 50, 53, 54, 55, 58, 58, 61, 63, 64, 67, 69, 71, 73, 75, 79, 79, 83, 85, 87, 90, 91, 94, 97, 99, 101, 104, 106, 109, 111, 114, 117, 118, 121, 123, 126, 127, 131, 132, 135, 138, 141, 143, 145, 148, 151, 153, 155, 159, 160, 163, 165, 168, 170, 172, 175, 177, 179, 181, 184, 186, 187, 190, 193, 195, 196, 199, 200, 202, 204, 206, 207, 209, 211, 213, 213, 216, 217, 219, 219, 220, 221, 222, 223, 225, 225, 226, 226, 227, 228, 228, 229, 228, 229, 230, 230, 230, 230, 229, 230, 229, 229, 229, 229, 228, 228, 227, 227, 226, 226, 224, 224, 223, 222, 222, 220, 220, 217, 217, 216, 214, 213, 212, 211, 209, 207, 207, 206, 203, 202, 200, 198, 197, 194, 192, 190, 190, 187, 186, 183, 181, 179, 177, 175, 174, 171, 169, 167, 165, 163, 160, 158, 156, 154, 152, 150, 147, 145, 143, 142, 139, 137, 135, 132, 130, 128, 126, 124, 123, 119, 118, 115, 113, 111, 109, 107, 105, 103, 101, 98, 96, 95, 93, 90, 88, 86, 85, 83, 80, 79, 77, 76, 72, 72, 70, 68, 65, 65, 63, 61, 60, 58, 56, 55, 53, 52, 52, 50, 49, 48, 46, 44, 44, 42, 42, 41, 40, 39, 38, 38, 37, 36, 36, 35, 34, 34, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 35, 34, 34, 36, 37, 37, 38, 39, 39, 40, 41, 42, 43, 45, 45, 47, 48, 49, 50, 52, 53, 54, 56, 57, 59, 61, 62, 63, 66, 67, 68, 70, 71, 74, 75, 77, 79, 80, 83, 85, 87, 88, 90, 92, 94, 96, 98, 100, 102, 103, 106, 108, 109, 111, 113, 115, 118, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 144, 146, 148, 151, 152, 154, 156, 158, 160, 162, 164, 166, 167, 169, 172, 173, 174, 176, 178, 180, 181, 183, 185, 185, 187, 189, 191, 192, 194, 195, 197, 198, 199, 201, 203, 204, 205, 206, 207, 209, 209, 210, 211, 212, 214, 214, 216, 216, 217, 218, 218, 219, 219, 220, 221, 221, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 222, 222, 222, 221, 221, 221, 220, 220, 219, 219, 217, 217, 216, 215, 214, 214, 213, 212, 211, 210, 209, 208, 206, 205, 204, 202, 201, 200, 198, 197, 196, 193, 193, 191, 189, 188, 186, 184, 183, 181, 180, 178, 175, 174, 172, 170, 169, 166, 164, 162, 160, 159, 157, 155, 153, 151, 149, 147, 145, 143, 141, 139, 137, 136, 133, 131, 129, 127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, 105, 103, 101, 99, 96, 95, 93, 91, 90, 88, 85, 84, 82, 80, 77, 76, 74, 73, 71, 69, 67, 66, 64, 62, 61, 59, 58, 56, 55, 53, 52, 50, 49, 48, 47, 45, 45, 42, 42, 41, 40, 39, 38, 37, 36, 36, 34, 34, 33, 33, 32, 32, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 37, 39, 39, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 53, 53, 55, 57, 58, 60, 61, 63, 65, 66, 68, 69, 71, 73, 74, 77, 78, 80, 81, 83, 86, 87, 89, 91, 93, 94, 97, 99, 100, 102, 105, 106, 108, 110, 112, 114, 117, 118, 120, 122, 124, 126, 127, 130, 132, 134, 136, 138, 139, 142, 144, 146, 148, 150, 152, 154, 156, 158, 159, 162, 164, 165, 167, 169, 171, 172, 175, 176, 178, 180, 182, 184, 185, 187, 188, 190, 191, 193, 194, 196, 198, 198, 201, 202, 203, 204, 206, 207, 208, 209, 210, 212, 213, 214, 214, 215, 216, 217, 217, 218, 219, 219, 220, 221, 221, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 222, 222, 222, 221, 221, 220, 220, 219, 219, 218, 217, 217, 216, 215, 214, 214, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 200, 198, 197, 196, 194, 193, 192, 190, 189, 187, 185, 185, 183, 181, 180, 178, 176, 175, 173, 172, 170, 168, 166, 165, 163, 161, 160, 157, 156, 154, 153, 150, 149, 147, 145, 144, 141, 140, 138, 136, 135, 133, 131, 129, 127, 125, 124, 121, 120, 118, 116, 115, 113, 111, 110, 107, 106, 104, 102, 100, 98, 97, 95, 94, 92, 90, 89, 87, 85, 84, 82, 80, 79, 78, 76, 75, 73, 72, 71, 70, 68, 66, 65, 64, 63, 62, 60, 59, 58, 57, 56, 54, 53, 53, 52, 51, 50, 49, 49, 48, 47, 46, 45, 45, 44, 44, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 46, 46, 47, 48, 48, 49, 50, 51, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 71, 72, 73, 74, 76, 77, 78, 80, 82, 83, 84, 86, 87, 88, 90, 91, 93, 94, 96, 97, 99, 101, 103, 104, 105, 107, 108, 110, 112, 113, 115, 117, 117, 120, 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, 137, 139, 141, 142, 144, 145, 147, 149, 151, 151, 153, 155, 157, 158, 160, 161, 162, 164, 165, 167, 168, 170, 172, 173, 174, 176, 177, 178, 179, 181, 182, 184, 184, 186, 188, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199, 200, 201, 201, 202, 203, 204, 205, 205, 207, 207, 207, 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 214, 214, 214, 214, 214, 213, 213, 213, 212, 211, 211, 210, 210, 209, 209, 208, 207, 207, 205, 205, 205, 203, 202, 201, 201, 200, 199, 198, 197, 196, 195, 194, 192, 191, 190, 188, 187, 186, 185, 184, 183, 180, 180, 178, 176, 175, 174, 172, 171, 170, 168, 167, 164, 164, 162, 161, 159, 157, 155, 154, 153, 151, 150, 148, 146, 144, 143, 141, 140, 138, 136, 135, 133, 131, 130, 128, 127, 125, 123, 122, 120, 118, 117, 115, 114, 112, 110, 109, 107, 105, 104, 102, 100, 99, 97, 96, 94, 92, 90, 90, 88, 86, 85, 83, 82, 81, 79, 78, 77, 75, 73, 73, 71, 70, 68, 67, 66, 65, 64, 63, 62, 61, 60, 58, 57, 56, 55, 54, 53, 53, 52, 51, 50, 50, 48, 47, 47, 46, 46, 45, 45, 44, 44, 43, 43, 43, 42, 42, 41, 41, 41, 41, 41, 41, 41, 40, 41, 41, 41, 41, 41, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 48, 48, 50, 50, 50, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 76, 77, 78, 80, 81, 82, 83, 85, 86, 88, 89, 91, 93, 93, 96, 97, 98, 100, 101, 103, 104, 106, 107, 109, 111, 112, 114, 115, 117, 118, 120, 121, 123, 124, 126, 128, 129, 131, 132, 134, 135, 137, 138, 140, 141, 143, 145, 146, 148, 149, 151, 152, 154, 155, 157, 159, 159, 161, 163, 164, 165, 167, 168, 169, 170, 172, 173, 174, 175, 177, 179, 180, 181, 182, 183, 184, 185, 186, 187, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 197, 198, 200, 200, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207, 208, 208, 208, 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 209, 209, 209, 208, 208, 208, 207, 207, 207, 206, 206, 205, 204, 204, 203, 203, 202, 201, 201, 200, 199, 199, 198, 196, 196, 195, 194, 193, 192, 191, 190, 190, 189, 188, 186, 185, 184, 183, 182, 180, 179, 178, 177, 176, 175, 173, 173, 171, 169, 168, 167, 166, 164, 163, 162, 160, 158, 157, 156, 154, 153, 152, 150, 149, 148, 146, 144, 144, 142, 140, 139, 137, 136, 135, 134, 132, 131, 129, 127, 127, 125, 123, 122, 120, 119, 118, 116, 115, 113, 112, 110, 110, 108, 106, 105, 103, 102, 101, 100, 98, 97, 96, 94, 93, 91, 90, 89, 88, 87, 86, 84, 83, 82, 80, 79, 78, 77, 76, 75, 74, 73, 73, 72, 71, 69, 68, 67, 66, 66, 65, 64, 63, 63, 62, 61, 60, 60, 58, 58, 57, 57, 56, 55, 55, 54, 54, 53, 53, 52, 52, 51, 51, 51, 50, 50, 50, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, 50, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 57, 57, 59, 59, 60, 61, 61, 62, 63, 64, 65, 66, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 95, 97, 98, 99, 101, 102, 103, 104, 106, 107, 109, 111, 111, 113, 115, 116, 117, 119, 120, 121, 122, 124, 125, 127, 129, 130, 132, 133, 134, 136, 137, 138, 140, 141, 142, 144, 146, 147, 149, 150, 151, 152, 154, 155, 156, 158, 160, 161, 162, 163, 164, 166, 167, 168, 169, 170, 171, 173, 173, 175, 176, 177, 179, 180, 181, 182, 182, 183, 185, 185, 187, 188, 189, 189, 190, 191, 192, 193, 193, 195, 195, 195, 197, 197, 198, 199, 199, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 204, 205, 205, 205, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 206, 206, 206, 206, 206, 206, 205, 205, 205, 205, 204, 204, 203, 203, 202, 202, 201, 201, 200, 200, 199, 199, 198, 197, 197, 195, 195, 194, 193, 192, 192, 191, 190, 189, 187, 187, 187, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 174, 173, 172, 170, 169, 168, 167, 166, 165, 163, 161, 161, 159, 158, 157, 155, 154, 153, 152, 150, 149, 148, 147, 145, 143, 142, 141, 139, 138, 137, 135, 134, 133, 131, 130, 129, 127, 126, 125, 123, 122, 121, 119, 118, 116, 116, 114, 112, 111, 110, 109, 107, 106, 105, 104, 102, 100, 99, 98, 97, 96, 95, 94, 93, 91, 90, 89, 87, 86, 85, 84, 83, 82, 81, 80, 80, 79, 78, 76, 75, 74, 73, 73, 72, 71, 70, 70, 69, 68, 67, 67, 65, 65, 64, 64, 63, 62, 62, 61, 61, 60, 60, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55, 55, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 58, 58, 59, 60, 60, 61, 61, 62, 62, 63, 64, 64, 65, 65, 67, 68, 68, 69, 70, 71, 71, 72, 73, 74, 75, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, 114, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 129, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 142, 144, 146, 147, 148, 149, 150, 151, 153, 154, 155, 156, 157, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 171, 172, 173, 174, 175, 175, 176, 177, 178, 179, 181, 181, 181, 183, 184, 184, 185, 186, 186, 187, 188, 188, 190, 190, 191, 191, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 197, 198, 198, 198, 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, 201, 201, 200, 200, 200, 200, 200, 200, 200, 199, 199, 199, 199, 198, 198, 197, 197, 197, 196, 196, 195, 195, 194, 193, 193, 192, 192, 191, 191, 190, 189, 189, 187, 187, 187, 185, 184, 184, 183, 182, 181, 180, 179, 179, 178, 177, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 163, 162, 161, 160, 159, 158, 157, 156, 154, 153, 152, 151, 149, 148, 147, 145, 144, 143, 142, 141, 140, 139, 137, 135, 134, 133, 132, 131, 130, 128, 127, 126, 125, 123, 123, 121, 119, 118, 117, 116, 115, 114, 112, 111, 110, 109, 107, 106, 105, 104, 103, 102, 101, 99, 98, 97, 95, 95, 93, 93, 92, 91, 90, 89, 88, 87, 86, 85, 83, 83, 82, 81, 80, 79, 79, 78, 77, 76, 76, 74, 73, 73, 72, 71, 71, 70, 69, 69, 68, 68, 67, 66, 66, 65, 65, 64, 64, 63, 63, 63, 62, 62, 61, 61, 61, 60, 60, 60, 60, 60, 60, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 61, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 67, 68, 68, 69, 69, 70, 71, 71, 72, 73, 73, 75, 75, 76, 77, 78, 78, 79, 80, 81, 82, 82, 84, 85, 86, 87, 88, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 124, 125, 126, 127, 128, 129, 130, 131, 133, 133, 135, 136, 137, 138, 139, 140, 141, 143, 144, 146, 146, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 164, 165, 166, 167, 169, 169, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 177, 179, 180, 180, 181, 181, 182, 182, 183, 184, 184, 185, 186, 186, 187, 187, 188, 188, 188, 189, 189, 190, 190, 191, 191, 191, 191, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 193, 193, 193, 193, 193, 193, 193, 192, 192, 192, 192, 191, 191, 191, 190, 190, 190, 189, 189, 188, 188, 187, 187, 186, 186, 185, 185, 184, 184, 183, 182, 182, 181, 181, 179, 179, 178, 177, 177, 176, 175, 174, 174, 173, 171, 171, 170, 169, 168, 167, 166, 166, 165, 164, 163, 161, 160, 159, 159, 158, 157, 156, 155, 154, 153, 152, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 100, 100, 99, 98, 97, 96, 95, 94, 93, 93, 91, 91, 89, 89, 88, 87, 86, 86, 85, 84, 84, 82, 82, 82, 80, 80, 79, 78, 78, 77, 77, 76, 76, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 70, 69, 69, 68, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 66, 66, 66, 66, 66, 66, 65, 66, 65, 65, 66, 66, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 79, 79, 80, 80, 81, 82, 82, 84, 84, 84, 86, 86, 87, 88, 89, 89, 90, 91, 92, 93, 93, 95, 96, 97, 97, 98, 99, 100, 101, 102, 103, 103, 105, 106, 107, 108, 109, 110, 111, 111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 122, 123, 124, 125, 127, 128, 129, 130, 131, 132, 133, 134, 135, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 147, 149, 150, 151, 152, 153, 153, 154, 155, 156, 157, 157, 158, 160, 160, 161, 162, 163, 163, 164, 165, 165, 167, 167, 167, 169, 169, 170, 171, 171, 172, 172, 173, 174, 174, 175, 176, 176, 177, 177, 178, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 182, 183, 183, 183, 183, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 185, 185, 185, 185, 185, 185, 184, 184, 184, 184, 183, 183, 183, 182, 182, 182, 181, 181, 181, 180, 180, 179, 179, 178, 178, 177, 177, 176, 176, 175, 175, 174, 174, 173, 173, 171, 171, 170, 170, 169, 168, 168, 167, 166, 166, 164, 164, 163, 162, 162, 161, 160, 159, 159, 158, 156, 156, 156, 154, 153, 153, 152, 151, 150, 149, 148, 148, 146, 146, 144, 144, 143, 142, 141, 140, 139, 138, 138, 136, 136, 134, 133, 132, 132, 131, 130, 129, 128, 127, 126, 126, 124, 123, 122, 121, 120, 119, 119, 118, 117, 116, 115, 113, 113, 112, 111, 110, 109, 109, 108, 107, 105, 105, 105, 103, 102, 102, 101, 100, 99, 99, 98, 97, 96, 96, 94, 94, 93, 92, 92, 91, 91, 90, 89, 89, 88, 87, 87, 86, 85, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 80, 79, 79, 78, 78, 78, 78, 77, 77, 76, 76, 76, 76, 75, 75, 75, 75, 75, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 76, 76, 76, 76, 76, 77, 77, 77, 78, 78, 79, 79, 79, 80, 80, 81, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, 90, 90, 91, 91, 92, 93, 93, 94, 95, 95, 96, 97, 97, 99, 99, 100, 101, 101, 102, 103, 104, 104, 105, 107, 107, 108, 109, 110, 110, 111, 112, 113, 113, 114, 115, 117, 117, 118, 119, 120, 121, 121, 122, 123, 124, 124, 126, 126, 128, 128, 129, 130, 131, 132, 132, 133, 135, 135, 135, 137, 138, 139, 139, 140, 141, 142, 142, 143, 145, 145, 146, 147, 148, 148, 149, 150, 150, 151, 152, 152, 154, 154, 155, 156, 156, 157, 157, 158, 159, 159, 160, 160, 161, 162, 162, 163, 163, 164, 164, 165, 165, 166, 166, 167, 167, 168, 168, 169, 169, 169, 170, 170, 170, 171, 171, 172, 172, 172, 172, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 174, 174, 174, 174, 174, 174, 174, 173, 173, 173, 173, 173, 172, 172, 172, 171, 171, 171, 171, 170, 170, 170, 169, 169, 168, 168, 167, 167, 167, 166, 166, 165, 165, 165, 164, 164, 163, 163, 162, 161, 161, 160, 160, 159, 159, 158, 157, 157, 156, 156, 155, 155, 154, 153, 153, 152, 152, 151, 151, 149, 149, 148, 148, 147, 146, 146, 145, 145, 143, 143, 143, 141, 141, 140, 140, 139, 138, 138, 137, 137, 135, 135, 135, 133, 133, 132, 132, 131, 130, 130, 129, 129, 127, 127, 126, 126, 125, 124, 124, 123, 122, 122, 121, 121, 119, 119, 118, 118, 117, 117, 116, 115, 115, 114, 114, 113, 113, 112, 111, 111, 110, 110, 109, 109, 108, 107, 107, 106, 106, 106, 105, 105, 104, 104, 103, 103, 103, 102, 102, 101, 101, 101, 100, 100, 100, 99, 99, 99, 98, 98, 98, 97, 97, 97, 97, 97, 96, 96, 96, 96, 95, 95, 95, 95, 95, 95, 95, 95, 95, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 98, 98, 98, 98, 98, 99, 99, 99, 99, 100, 100, 101, 101, 101, 101, 102, 102, 102, 103, 103, 103, 104, 104, 105, 105, 105, 106, 106, 106, 107, 107, 107, 108, 108, 109, 109, 110, 110, 110, 111, 111, 112, 112, 112, 113, 113, 114, 114, 115, 115, 115, 116, 116, 117, 117, 117, 118, 118, 119, 119, 120, 120, 121, 121, 121, 122, 122, 123, 123, 124, 124, 124, 125, 125, 126, 126, 126, 127, 127, 128, 128, 129, 129, 129, 130, 130, 130, 131, 131, 131, 132, 132, 133, 133, 134, 134, 134, 135, 135, 135, 135, 136, 136, 137, 137, 137, 138, 138, 138, 138, 139, 139, 139, 139, 140, 140, 140, 141, 141, 141, 141, 142, 142, 142, 142, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 145, 145, 145, 145, 145, 145, 145, 145, 145, 144, 144, 144, 144, 144, 144, 144, 144, 143, 143, 143, 143, 143, 143, 142, 142, 142, 142, 142, 142, 142, 141, 141, 141, 141, 141, 140, 140, 140, 140, 140, 140, 139, 139, 139, 139, 139, 138, 138, 138, 138, 138, 137, 137, 137, 137, 137, 136, 136, 136, 136, 136, 136, 135, 135, 135, 135, 134, 134, 134, 134, 134, 134, 133, 133, 133, 133, 133, 132, 132, 132, 132, 132, 131, 131, 131, 131, 131, 130, 130, 130, 130, 130, 130, 130, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 127, 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, 125, 125, 125, 125, 125, 125, 125, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; +const uint8_t snare[] PROGMEM = {81, 24, 0, 0, 128, 130, 125, 120, 94, 82, 67, 57, 43, 33, 18, 23, 5, 9, 4, 13, 3, 20, 0, 93, 206, 108, 200, 225, 217, 245, 249, 245, 248, 243, 247, 242, 247, 245, 249, 244, 251, 246, 251, 246, 253, 246, 255, 228, 127, 169, 153, 38, 47, 30, 36, 27, 125, 18, 33, 186, 57, 155, 31, 13, 17, 10, 17, 9, 16, 35, 6, 24, 29, 3, 43, 22, 0, 71, 42, 11, 209, 145, 0, 95, 219, 183, 119, 26, 0, 31, 39, 0, 4, 5, 60, 16, 15, 33, 60, 16, 14, 109, 139, 175, 162, 161, 157, 176, 127, 216, 203, 157, 198, 188, 221, 228, 172, 178, 227, 242, 215, 188, 240, 250, 176, 171, 225, 246, 240, 254, 237, 252, 249, 226, 254, 252, 248, 244, 226, 193, 229, 253, 253, 215, 200, 212, 202, 211, 217, 224, 250, 250, 226, 192, 146, 149, 145, 53, 73, 176, 125, 79, 130, 130, 41, 0, 19, 19, 9, 28, 21, 1, 15, 12, 0, 11, 21, 11, 0, 6, 15, 18, 30, 14, 3, 18, 0, 24, 61, 18, 14, 88, 86, 89, 97, 131, 156, 106, 83, 96, 61, 79, 131, 119, 142, 155, 150, 164, 161, 182, 181, 138, 206, 255, 230, 246, 244, 215, 231, 247, 233, 239, 252, 253, 237, 244, 253, 251, 238, 224, 200, 196, 226, 217, 233, 211, 169, 144, 162, 139, 175, 215, 176, 150, 122, 99, 127, 193, 205, 142, 115, 130, 163, 214, 154, 107, 103, 103, 110, 147, 141, 93, 115, 83, 32, 6, 43, 31, 53, 104, 72, 26, 35, 48, 83, 95, 50, 47, 20, 40, 11, 17, 18, 8, 33, 76, 55, 3, 43, 77, 76, 27, 46, 90, 78, 106, 132, 142, 119, 112, 128, 146, 171, 161, 125, 141, 169, 168, 135, 123, 181, 205, 215, 225, 231, 202, 214, 203, 190, 191, 190, 204, 245, 191, 137, 151, 140, 123, 154, 167, 177, 202, 168, 220, 240, 179, 176, 241, 204, 191, 220, 196, 209, 232, 237, 198, 192, 173, 177, 159, 122, 137, 163, 166, 110, 94, 51, 69, 76, 108, 61, 48, 66, 82, 63, 62, 65, 74, 65, 38, 109, 100, 101, 75, 29, 41, 70, 61, 51, 31, 19, 22, 64, 39, 35, 55, 62, 54, 78, 109, 86, 133, 118, 110, 116, 155, 119, 109, 72, 64, 134, 102, 88, 65, 112, 118, 147, 191, 180, 133, 171, 180, 186, 173, 150, 146, 178, 198, 181, 191, 182, 173, 153, 173, 134, 133, 153, 159, 161, 141, 144, 185, 222, 173, 175, 220, 200, 211, 199, 187, 162, 159, 165, 155, 155, 120, 121, 172, 148, 190, 167, 120, 153, 125, 142, 146, 143, 116, 151, 136, 130, 173, 137, 121, 117, 73, 61, 119, 96, 94, 97, 51, 63, 63, 36, 54, 34, 31, 66, 24, 22, 49, 55, 54, 49, 69, 92, 113, 129, 103, 105, 113, 129, 125, 119, 146, 131, 95, 77, 69, 65, 47, 34, 43, 75, 91, 117, 115, 109, 138, 157, 176, 130, 119, 140, 166, 155, 205, 200, 138, 132, 154, 147, 175, 131, 160, 154, 125, 157, 117, 155, 172, 186, 161, 165, 217, 244, 157, 227, 216, 195, 250, 206, 187, 209, 206, 191, 187, 128, 131, 167, 119, 133, 172, 189, 157, 120, 137, 148, 169, 110, 64, 81, 87, 36, 72, 65, 55, 66, 76, 63, 89, 56, 83, 80, 55, 147, 110, 87, 123, 112, 83, 139, 147, 86, 116, 134, 160, 131, 116, 114, 91, 77, 67, 50, 58, 49, 59, 96, 52, 71, 82, 104, 73, 79, 98, 98, 78, 122, 117, 128, 111, 106, 181, 169, 146, 138, 161, 121, 122, 159, 153, 119, 134, 161, 136, 156, 156, 174, 207, 198, 175, 188, 213, 162, 139, 167, 171, 139, 155, 171, 119, 177, 185, 124, 161, 163, 137, 198, 144, 163, 172, 111, 142, 138, 179, 161, 105, 167, 192, 143, 153, 158, 167, 159, 117, 161, 178, 96, 148, 137, 127, 89, 99, 129, 50, 53, 134, 97, 87, 70, 71, 71, 67, 127, 107, 120, 121, 109, 78, 94, 69, 91, 113, 113, 99, 78, 126, 83, 82, 87, 62, 48, 37, 60, 54, 68, 78, 73, 52, 78, 98, 108, 102, 110, 129, 118, 121, 109, 115, 116, 133, 137, 161, 133, 177, 189, 151, 158, 199, 204, 195, 176, 228, 208, 174, 190, 184, 201, 153, 177, 165, 164, 143, 132, 126, 164, 160, 157, 145, 148, 147, 155, 118, 146, 148, 120, 116, 141, 181, 146, 129, 136, 155, 114, 167, 178, 144, 118, 139, 111, 119, 112, 112, 106, 86, 91, 115, 106, 116, 120, 122, 108, 110, 105, 109, 155, 147, 122, 110, 134, 92, 70, 80, 88, 134, 137, 83, 105, 79, 54, 21, 56, 54, 57, 110, 105, 122, 104, 116, 106, 114, 130, 80, 112, 143, 100, 129, 95, 99, 140, 126, 157, 133, 124, 160, 147, 87, 115, 141, 149, 157, 186, 174, 147, 187, 185, 157, 166, 165, 176, 149, 121, 152, 126, 119, 132, 161, 111, 133, 104, 115, 154, 125, 140, 123, 183, 179, 174, 179, 163, 194, 192, 172, 148, 182, 171, 170, 167, 115, 139, 163, 112, 120, 108, 130, 111, 110, 124, 81, 82, 128, 108, 65, 117, 139, 146, 100, 101, 100, 88, 83, 83, 54, 69, 87, 44, 101, 91, 117, 96, 100, 124, 113, 103, 141, 124, 98, 145, 129, 154, 117, 102, 159, 137, 110, 163, 103, 112, 113, 92, 92, 87, 108, 133, 72, 135, 170, 135, 139, 144, 168, 154, 149, 141, 173, 129, 135, 168, 154, 147, 131, 139, 143, 170, 160, 125, 166, 174, 109, 143, 145, 112, 128, 141, 134, 108, 130, 153, 128, 145, 176, 143, 145, 150, 184, 123, 132, 145, 136, 117, 112, 133, 103, 100, 96, 125, 125, 141, 124, 127, 131, 122, 147, 126, 111, 147, 123, 122, 120, 112, 130, 115, 99, 75, 116, 83, 112, 107, 78, 123, 131, 99, 117, 127, 125, 144, 132, 153, 141, 133, 133, 123, 125, 124, 118, 136, 113, 99, 105, 132, 116, 77, 93, 123, 99, 78, 117, 139, 137, 151, 150, 133, 151, 143, 140, 123, 130, 136, 145, 130, 92, 124, 119, 121, 98, 132, 119, 142, 145, 138, 142, 138, 144, 129, 144, 155, 157, 140, 147, 162, 178, 139, 167, 185, 144, 133, 136, 109, 135, 128, 121, 123, 126, 131, 144, 117, 119, 136, 124, 128, 143, 114, 106, 140, 143, 158, 137, 135, 129, 115, 115, 148, 96, 99, 104, 122, 94, 117, 125, 105, 125, 120, 126, 126, 147, 114, 117, 114, 125, 146, 137, 123, 122, 98, 114, 129, 121, 91, 142, 120, 116, 110, 88, 109, 108, 111, 140, 141, 137, 148, 140, 150, 111, 120, 113, 117, 127, 134, 149, 136, 114, 144, 178, 136, 125, 140, 135, 123, 139, 119, 134, 140, 154, 154, 151, 160, 139, 115, 120, 146, 129, 106, 114, 157, 98, 119, 137, 109, 126, 104, 108, 118, 122, 136, 115, 127, 152, 141, 143, 147, 126, 155, 157, 126, 134, 159, 97, 104, 174, 136, 102, 140, 151, 108, 138, 132, 104, 102, 101, 119, 117, 120, 123, 128, 122, 151, 148, 135, 155, 132, 112, 139, 132, 102, 118, 135, 135, 120, 140, 122, 91, 121, 120, 115, 118, 107, 127, 95, 128, 151, 125, 110, 164, 164, 130, 131, 132, 125, 110, 109, 122, 103, 104, 136, 105, 113, 133, 121, 107, 124, 104, 139, 122, 131, 149, 128, 113, 146, 147, 134, 146, 156, 148, 161, 136, 142, 156, 129, 131, 124, 134, 151, 123, 135, 147, 134, 140, 132, 150, 146, 132, 114, 143, 126, 135, 127, 122, 115, 138, 128, 117, 127, 121, 123, 131, 109, 134, 141, 123, 129, 116, 137, 123, 127, 138, 104, 124, 149, 116, 113, 117, 117, 111, 114, 124, 113, 87, 107, 111, 103, 116, 147, 109, 122, 164, 134, 108, 139, 144, 122, 122, 127, 146, 135, 133, 139, 154, 123, 132, 158, 139, 142, 137, 127, 111, 119, 113, 119, 133, 129, 131, 131, 141, 138, 136, 136, 149, 150, 157, 139, 146, 144, 135, 122, 125, 150, 130, 118, 137, 136, 124, 113, 107, 101, 103, 107, 106, 118, 126, 132, 122, 126, 144, 127, 124, 134, 121, 122, 125, 131, 119, 114, 126, 111, 122, 121, 118, 129, 117, 117, 135, 137, 140, 142, 133, 116, 144, 133, 123, 161, 125, 112, 144, 157, 148, 132, 154, 139, 135, 138, 122, 122, 111, 115, 110, 108, 124, 139, 116, 123, 153, 139, 137, 130, 123, 137, 127, 143, 135, 122, 145, 122, 119, 129, 105, 112, 129, 124, 118, 126, 139, 128, 113, 124, 126, 115, 123, 115, 125, 147, 114, 138, 134, 138, 137, 108, 109, 144, 124, 123, 140, 123, 127, 137, 145, 127, 124, 138, 117, 119, 144, 139, 148, 131, 145, 148, 124, 132, 132, 119, 126, 129, 112, 123, 142, 129, 117, 120, 130, 123, 122, 133, 137, 133, 119, 124, 150, 136, 133, 155, 149, 134, 125, 146, 120, 122, 136, 111, 111, 112, 130, 106, 110, 122, 108, 104, 110, 121, 120, 120, 124, 122, 124, 124, 110, 122, 141, 119, 135, 162, 147, 137, 143, 147, 133, 132, 127, 137, 139, 125, 122, 134, 127, 134, 140, 117, 122, 134, 134, 143, 140, 118, 134, 147, 132, 123, 131, 122, 126, 128, 135, 127, 115, 141, 134, 98, 120, 136, 118, 118, 123, 131, 136, 128, 137, 143, 122, 121, 148, 142, 135, 131, 112, 140, 145, 125, 120, 129, 114, 99, 100, 122, 119, 116, 108, 128, 129, 136, 141, 141, 140, 122, 134, 136, 115, 136, 153, 137, 127, 127, 131, 121, 132, 121, 119, 140, 126, 126, 132, 129, 138, 141, 131, 115, 133, 140, 137, 137, 142, 130, 142, 144, 142, 132, 125, 120, 118, 128, 116, 81, 125, 110, 122, 129, 112, 109, 126, 145, 115, 129, 125, 130, 115, 124, 119, 131, 125, 123, 122, 129, 122, 118, 122, 119, 123, 129, 114, 127, 130, 125, 124, 136, 154, 123, 129, 150, 146, 148, 164, 162, 168, 153, 129, 136, 140, 123, 138, 131, 127, 124, 126, 137, 121, 107, 120, 128, 130, 117, 127, 135, 125, 139, 138, 131, 129, 131, 129, 138, 125, 133, 139, 115, 120, 126, 128, 120, 118, 127, 104, 106, 116, 120, 123, 116, 113, 127, 133, 124, 119, 142, 126, 130, 124, 116, 134, 133, 113, 124, 125, 117, 130, 104, 116, 118, 127, 134, 138, 132, 139, 130, 136, 140, 139, 143, 131, 128, 141, 135, 135, 148, 131, 113, 128, 139, 118, 127, 117, 119, 117, 130, 132, 133, 148, 129, 133, 151, 141, 132, 127, 132, 142, 125, 115, 138, 127, 117, 135, 114, 115, 121, 118, 113, 122, 116, 116, 129, 119, 132, 130, 133, 135, 122, 143, 145, 127, 135, 146, 128, 128, 134, 130, 124, 124, 131, 126, 119, 125, 133, 124, 136, 135, 118, 137, 143, 147, 142, 145, 137, 134, 128, 137, 141, 139, 128, 127, 134, 124, 103, 126, 124, 97, 119, 104, 120, 111, 117, 133, 124, 114, 136, 115, 133, 144, 129, 134, 135, 120, 135, 122, 116, 130, 107, 126, 116, 114, 108, 114, 122, 138, 129, 123, 131, 127, 136, 140, 134, 131, 124, 122, 124, 133, 131, 127, 132, 122, 130, 134, 130, 136, 120, 129, 142, 143, 147, 136, 138, 147, 145, 140, 142, 150, 139, 138, 146, 129, 140, 141, 121, 125, 123, 127, 133, 118, 122, 116, 121, 127, 114, 115, 126, 121, 119, 132, 128, 138, 136, 125, 129, 137, 125, 115, 122, 131, 122, 108, 118, 108, 120, 107, 112, 123, 113, 127, 118, 115, 128, 121, 122, 139, 139, 144, 139, 137, 139, 140, 137, 137, 127, 125, 123, 125, 126, 120, 127, 133, 128, 130, 132, 130, 130, 133, 135, 141, 139, 143, 147, 130, 135, 130, 143, 132, 120, 130, 132, 121, 120, 117, 121, 118, 121, 126, 110, 129, 130, 124, 127, 133, 128, 141, 133, 129, 143, 139, 121, 131, 132, 118, 125, 127, 127, 114, 118, 130, 115, 119, 124, 116, 123, 134, 123, 122, 135, 132, 124, 126, 127, 134, 142, 127, 123, 137, 133, 126, 131, 131, 141, 126, 134, 144, 130, 141, 124, 126, 134, 136, 129, 129, 144, 124, 124, 136, 136, 128, 131, 140, 128, 120, 123, 112, 114, 116, 118, 119, 114, 124, 120, 125, 130, 117, 143, 123, 124, 147, 127, 133, 138, 123, 129, 131, 135, 125, 131, 137, 127, 127, 120, 125, 124, 121, 131, 117, 119, 117, 125, 131, 128, 130, 141, 136, 138, 138, 147, 138, 127, 141, 127, 135, 133, 137, 133, 125, 132, 127, 116, 128, 133, 124, 115, 136, 125, 119, 134, 135, 132, 123, 128, 133, 123, 130, 125, 119, 138, 128, 125, 124, 118, 127, 121, 112, 110, 122, 126, 121, 120, 127, 124, 126, 129, 134, 134, 131, 133, 131, 127, 129, 125, 122, 125, 128, 124, 125, 128, 130, 132, 123, 125, 123, 137, 128, 126, 132, 135, 140, 137, 131, 139, 136, 142, 146, 139, 138, 134, 136, 140, 134, 131, 135, 136, 140, 133, 123, 131, 130, 123, 126, 120, 128, 126, 122, 119, 124, 122, 122, 119, 133, 115, 116, 126, 118, 119, 127, 126, 114, 123, 120, 121, 121, 119, 129, 132, 122, 134, 129, 119, 124, 130, 129, 139, 126, 129, 132, 132, 133, 125, 127, 122, 130, 125, 129, 130, 125, 123, 130, 137, 143, 138, 139, 126, 131, 141, 136, 133, 135, 146, 135, 137, 145, 134, 121, 120, 137, 135, 124, 136, 129, 124, 127, 125, 123, 120, 130, 125, 123, 142, 122, 117, 133, 131, 113, 115, 130, 127, 119, 128, 131, 134, 126, 126, 124, 127, 125, 122, 122, 119, 128, 123, 123, 132, 129, 125, 126, 113, 138, 130, 129, 127, 130, 131, 136, 127, 128, 137, 129, 127, 129, 131, 126, 136, 139, 130, 134, 137, 134, 126, 135, 140, 130, 134, 127, 127, 138, 134, 132, 134, 127, 124, 130, 131, 118, 120, 125, 120, 105, 130, 119, 123, 122, 110, 122, 135, 127, 122, 131, 127, 132, 123, 128, 135, 129, 117, 126, 134, 130, 128, 134, 126, 125, 133, 134, 131, 127, 128, 129, 128, 133, 129, 133, 136, 127, 129, 138, 135, 135, 133, 129, 127, 131, 130, 130, 132, 126, 136, 135, 131, 139, 129, 127, 137, 124, 135, 130, 131, 128, 131, 135, 131, 132, 125, 126, 121, 126, 120, 116, 122, 126, 112, 118, 129, 114, 118, 123, 113, 112, 121, 126, 116, 119, 127, 128, 125, 132, 119, 130, 132, 126, 123, 136, 134, 126, 131, 130, 135, 127, 137, 131, 126, 129, 140, 128, 137, 142, 132, 130, 136, 136, 141, 132, 132, 137, 142, 134, 133, 141, 139, 129, 136, 133, 126, 139, 131, 121, 131, 134, 127, 128, 127, 125, 129, 131, 118, 121, 127, 135, 118, 128, 127, 126, 122, 122, 118, 114, 119, 114, 114, 124, 119, 125, 127, 120, 131, 131, 125, 130, 119, 115, 135, 128, 121, 132, 136, 122, 131, 133, 133, 130, 119, 121, 134, 131, 123, 132, 133, 132, 131, 130, 132, 127, 134, 135, 128, 124, 128, 135, 129, 131, 137, 136, 132, 136, 139, 132, 133, 133, 125, 125, 127, 125, 128, 124, 127, 133, 129, 128, 128, 127, 126, 131, 134, 123, 124, 128, 123, 126, 127, 120, 119, 124, 123, 124, 121, 124, 120, 122, 131, 126, 129, 135, 126, 132, 131, 129, 138, 131, 132, 136, 128, 131, 136, 126, 126, 143, 136, 131, 126, 125, 133, 127, 118, 132, 129, 125, 131, 124, 130, 130, 132, 127, 131, 136, 135, 130, 130, 135, 132, 124, 128, 128, 127, 136, 128, 121, 127, 123, 125, 128, 121, 116, 129, 120, 119, 132, 119, 112, 128, 135, 125, 125, 130, 122, 120, 133, 126, 125, 126, 125, 127, 126, 132, 125, 130, 123, 125, 137, 135, 128, 124, 131, 135, 135, 129, 138, 137, 126, 132, 137, 129, 129, 130, 127, 134, 126, 122, 139, 128, 124, 135, 132, 136, 133, 132, 136, 135, 126, 134, 141, 130, 129, 126, 129, 133, 121, 130, 124, 120, 118, 120, 126, 120, 125, 124, 121, 116, 125, 120, 124, 123, 121, 119, 127, 135, 123, 122, 132, 129, 129, 127, 128, 134, 124, 126, 132, 128, 124, 129, 126, 133, 135, 128, 134, 134, 143, 137, 135, 134, 132, 137, 133, 131, 136, 126, 124, 129, 127, 124, 124, 125, 126, 121, 125, 127, 127, 125, 124, 129, 130, 132, 133, 126, 134, 135, 127, 132, 127, 125, 126, 129, 124, 124, 127, 126, 122, 118, 120, 125, 118, 120, 127, 120, 126, 128, 128, 127, 127, 132, 132, 130, 128, 129, 126, 134, 134, 131, 127, 132, 127, 132, 128, 131, 132, 130, 131, 134, 133, 130, 132, 126, 141, 132, 134, 133, 137, 140, 127, 130, 133, 129, 130, 128, 132, 125, 127, 128, 129, 124, 132, 123, 126, 132, 130, 128, 124, 131, 126, 127, 126, 128, 132, 119, 119, 128, 123, 117, 122, 117, 112, 124, 116, 123, 119, 113, 122, 124, 122, 124, 129, 133, 127, 135, 134, 134, 135, 135, 130, 133, 131, 131, 130, 127, 126, 129, 136, 138, 134, 133, 135, 132, 132, 133, 134, 131, 136, 135, 133, 131, 136, 134, 132, 130, 126, 130, 127, 128, 127, 127, 131, 125, 123, 122, 128, 127, 125, 126, 126, 130, 129, 125, 128, 133, 125, 125, 128, 125, 123, 120, 125, 125, 128, 126, 123, 125, 121, 114, 126, 121, 119, 123, 124, 123, 130, 128, 123, 132, 140, 133, 127, 133, 138, 131, 129, 133, 130, 130, 130, 132, 132, 131, 133, 128, 124, 131, 136, 131, 128, 139, 131, 136, 134, 134, 130, 131, 133, 129, 128, 127, 129, 124, 128, 131, 122, 127, 128, 124, 124, 127, 127, 121, 127, 125, 125, 124, 128, 125, 126, 127, 125, 122, 123, 125, 126, 123, 126, 121, 123, 124, 123, 122, 126, 127, 124, 122, 126, 131, 127, 130, 131, 135, 139, 136, 134, 137, 137, 134, 133, 137, 132, 129, 130, 131, 131, 128, 133, 133, 129, 131, 131, 132, 127, 131, 128, 127, 129, 130, 132, 130, 132, 136, 130, 127, 129, 127, 129, 126, 119, 123, 126, 124, 124, 125, 123, 129, 124, 123, 126, 125, 128, 129, 126, 127, 123, 125, 123, 124, 126, 116, 123, 127, 119, 120, 131, 124, 126, 126, 124, 128, 131, 127, 127, 134, 134, 133, 136, 130, 135, 134, 133, 134, 133, 136, 135, 136, 127, 132, 136, 134, 132, 132, 128, 129, 128, 126, 132, 130, 132, 130, 127, 133, 131, 126, 128, 125, 125, 126, 128, 122, 127, 129, 123, 125, 122, 123, 128, 121, 120, 125, 123, 123, 125, 122, 123, 130, 126, 125, 125, 128, 126, 126, 127, 125, 123, 127, 128, 125, 128, 130, 126, 132, 131, 128, 130, 136, 133, 133, 133, 136, 133, 131, 134, 130, 132, 131, 130, 135, 138, 130, 128, 131, 137, 131, 128, 136, 132, 124, 127, 124, 126, 124, 123, 126, 127, 127, 127, 129, 127, 126, 129, 126, 124, 126, 124, 127, 125, 120, 127, 126, 123, 126, 124, 129, 125, 120, 125, 122, 122, 126, 124, 126, 126, 125, 123, 131, 128, 123, 125, 131, 131, 130, 133, 127, 129, 134, 134, 130, 134, 134, 130, 130, 133, 134, 131, 132, 135, 127, 130, 136, 131, 129, 136, 132, 130, 131, 133, 128, 131, 133, 125, 125, 129, 128, 128, 126, 127, 127, 123, 127, 125, 124, 126, 125, 123, 125, 122, 126, 127, 125, 124, 125, 123, 122, 124, 126, 125, 126, 124, 127, 126, 126, 129, 125, 122, 129, 129, 127, 131, 128, 129, 131, 126, 130, 127, 125, 134, 126, 125, 135, 134, 132, 135, 130, 135, 135, 129, 132, 137, 133, 131, 128, 135, 132, 130, 134, 133, 128, 130, 132, 127, 126, 127, 129, 128, 126, 125, 126, 126, 124, 122, 126, 124, 128, 126, 125, 126, 126, 124, 129, 122, 120, 126, 122, 123, 123, 124, 124, 130, 123, 124, 128, 126, 127, 128, 126, 124, 127, 128, 125, 126, 129, 127, 128, 130, 131, 131, 133, 134, 134, 134, 136, 134, 131, 133, 136, 134, 131, 135, 133, 131, 131, 132, 133, 130, 130, 129, 126, 128, 129, 126, 127, 126, 127, 123, 127, 128, 123, 125, 126, 127, 125, 123, 125, 125, 122, 126, 124, 122, 124, 121, 123, 124, 125, 124, 123, 126, 129, 122, 127, 129, 128, 127, 127, 127, 128, 129, 128, 130, 128, 131, 128, 127, 130, 128, 128, 136, 130, 128, 131, 135, 131, 125, 135, 134, 134, 136, 131, 135, 135, 133, 132, 130, 132, 133, 132, 131, 131, 128, 132, 131, 131, 129, 126, 127, 128, 124, 126, 125, 123, 127, 125, 126, 125, 126, 128, 127, 124, 126, 124, 125, 123, 123, 125, 125, 123, 122, 123, 123, 122, 123, 126, 126, 123, 122, 127, 126, 127, 128, 130, 126, 127, 128, 128, 130, 132, 128, 129, 131, 128, 130, 129, 132, 132, 132, 132, 133, 135, 133, 133, 133, 134, 131, 134, 134, 130, 132, 132, 130, 130, 134, 130, 127, 129, 129, 125, 127, 124, 127, 125, 127, 126, 125, 126, 125, 126, 127, 126, 124, 126, 126, 129, 125, 126, 126, 128, 125, 122, 126, 122, 122, 127, 126, 126, 122, 128, 129, 123, 128, 127, 125, 129, 130, 127, 130, 132, 129, 129, 133, 130, 130, 131, 130, 131, 134, 133, 128, 132, 134, 132, 131, 131, 133, 133, 130, 133, 133, 132, 134, 130, 130, 130, 130, 129, 128, 126, 128, 125, 121, 124, 125, 124, 124, 124, 126, 123, 124, 123, 122, 124, 125, 124, 127, 126, 124, 127, 124, 126, 125, 123, 125, 126, 124, 127, 124, 124, 126, 126, 127, 127, 129, 129, 130, 133, 133, 130, 132, 133, 133, 133, 134, 134, 132, 132, 133, 134, 131, 132, 132, 130, 132, 129, 127, 129, 130, 133, 130, 130, 131, 130, 131, 126, 129, 130, 125, 128, 129, 127, 126, 127, 126, 127, 125, 126, 124, 121, 124, 122, 122, 123, 124, 125, 127, 127, 126, 126, 125, 126, 127, 124, 125, 128, 126, 127, 128, 128, 126, 127, 127, 128, 127, 128, 129, 129, 125, 129, 129, 127, 131, 128, 130, 133, 130, 132, 134, 133, 131, 133, 134, 129, 131, 131, 133, 130, 129, 131, 132, 128, 132, 130, 129, 129, 130, 129, 129, 129, 129, 128, 128, 128, 129, 128, 123, 124, 122, 125, 124, 123, 123, 123, 123, 122, 123, 125, 123, 126, 125, 125, 125, 125, 128, 127, 128, 128, 129, 128, 126, 129, 126, 127, 126, 129, 130, 128, 129, 129, 130, 127, 128, 129, 129, 127, 134, 133, 132, 133, 133, 133, 136, 132, 129, 132, 132, 133, 130, 131, 130, 131, 128, 128, 127, 126, 128, 127, 128, 125, 128, 127, 127, 126, 127, 128, 126, 129, 128, 126, 126, 128, 125, 126, 128, 124, 124, 125, 123, 124, 124, 124, 127, 124, 127, 127, 127, 127, 126, 127, 126, 126, 127, 128, 129, 131, 128, 130, 130, 128, 131, 131, 127, 128, 127, 127, 130, 132, 129, 130, 131, 130, 133, 130, 131, 130, 133, 131, 130, 132, 129, 132, 131, 129, 131, 130, 128, 129, 128, 129, 126, 127, 128, 125, 127, 124, 127, 127, 128, 127, 125, 126, 128, 126, 126, 125, 124, 125, 123, 124, 126, 126, 125, 124, 127, 126, 125, 126, 123, 129, 128, 127, 128, 129, 128, 130, 128, 128, 129, 127, 128, 128, 129, 128, 129, 131, 129, 129, 131, 130, 131, 129, 132, 128, 129, 130, 131, 130, 132, 132, 129, 131, 132, 131, 129, 132, 128, 130, 128, 128, 128, 127, 127, 128, 128, 128, 127, 126, 127, 125, 126, 125, 125, 124, 125, 128, 123, 126, 126, 125, 126, 125, 126, 126, 126, 126, 127, 124, 125, 126, 125, 127, 127, 125, 127, 129, 126, 127, 129, 130, 130, 129, 128, 130, 132, 128, 129, 131, 130, 130, 131, 131, 129, 130, 130, 131, 131, 131, 130, 131, 132, 132, 131, 129, 130, 131, 130, 129, 129, 126, 130, 128, 126, 128, 129, 128, 126, 126, 127, 125, 126, 125, 125, 128, 126, 125, 126, 125, 124, 126, 125, 125, 127, 126, 124, 127, 127, 125, 127, 125, 125, 129, 129, 127, 127, 128, 129, 128, 131, 128, 128, 130, 129, 125, 128, 130, 128, 129, 131, 129, 130, 131, 129, 130, 130, 129, 131, 130, 130, 130, 129, 129, 131, 130, 128, 131, 129, 129, 128, 129, 130, 126, 128, 129, 127, 128, 128, 126, 128, 128, 126, 127, 127, 126, 126, 127, 126, 126, 122, 124, 126, 124, 124, 126, 127, 125, 126, 126, 127, 126, 128, 127, 126, 128, 127, 128, 127, 126, 127, 129, 130, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 130, 130, 131, 131, 131, 130, 129, 131, 131, 131, 131, 130, 131, 130, 130, 127, 129, 130, 129, 128, 127, 127, 127, 126, 127, 127, 127, 126, 126, 128, 126, 126, 127, 125, 125, 127, 125, 125, 127, 126, 125, 127, 127, 126, 126, 126, 125, 128, 128, 125, 128, 128, 128, 127, 128, 127, 126, 129, 128, 129, 129, 129, 129, 130, 128, 129, 128, 127, 129, 130, 128, 129, 130, 130, 130, 129, 129, 130, 131, 128, 130, 130, 130, 129, 130, 130, 130, 129, 133, 130, 127, 131, 128, 127, 129, 129, 126, 126, 127, 127, 124, 127, 127, 125, 126, 127, 127, 125, 126, 126, 127, 127, 127, 125, 125, 126, 126, 126, 126, 126, 126, 128, 127, 126, 127, 128, 127, 128, 127, 130, 128, 128, 131, 130, 129, 129, 131, 130, 130, 128, 128, 130, 129, 130, 130, 129, 129, 129, 129, 128, 129, 129, 129, 131, 130, 129, 130, 129, 129, 129, 131, 128, 128, 128, 128, 126, 126, 128, 126, 126, 126, 127, 127, 127, 124, 125, 125, 126, 126, 127, 127, 126, 128, 127, 126, 127, 128, 129, 128, 127, 128, 128, 128, 128, 127, 129, 128, 127, 128, 128, 129, 128, 127, 129, 131, 130, 129, 130, 130, 129, 129, 130, 129, 130, 131, 128, 130, 129, 128, 129, 128, 129, 128, 128, 128, 128, 129, 128, 128, 128, 129, 128, 129, 128, 127, 129, 129, 127, 127, 128, 127, 126, 125, 127, 125, 126, 127, 126, 125, 127, 127, 125, 125, 127, 127, 126, 126, 126, 126, 127, 128, 129, 127, 127, 130, 129, 129, 128, 128, 129, 128, 127, 128, 128, 128, 128, 129, 130, 129, 129, 130, 130, 129, 129, 130, 132, 130, 131, 130, 128, 130, 130, 129, 128, 128, 129, 129, 126, 127, 128, 127, 128, 127, 128, 127, 129, 128, 126, 127, 129, 127, 127, 127, 127, 127, 126, 125, 126, 126, 125, 126, 126, 125, 128, 126, 126, 126, 128, 127, 126, 128, 128, 128, 129, 128, 129, 129, 129, 130, 128, 129, 129, 129, 128, 129, 127, 128, 128, 128, 128, 128, 128, 129, 129, 128, 129, 129, 131, 129, 130, 130, 130, 131, 129, 128, 129, 128, 129, 128, 129, 128, 127, 128, 126, 126, 128, 128, 127, 129, 128, 127, 128, 126, 127, 129, 126, 127, 128, 126, 127, 125, 126, 127, 126, 125, 126, 126, 126, 127, 125, 126, 128, 125, 127, 128, 128, 128, 129, 129, 128, 130, 129, 128, 129, 130, 129, 130, 129, 129, 130, 130, 127, 128, 129, 129, 129, 128, 129, 130, 129, 129, 130, 128, 128, 130, 129, 129, 129, 130, 128, 128, 130, 128, 127, 128, 127, 126, 127, 126, 126, 126, 126, 128, 125, 127, 126, 127, 127, 127, 126, 127, 127, 127, 127, 127, 128, 127, 126, 127, 127, 126, 126, 125, 126, 126, 129, 127, 125, 128, 129, 130, 128, 128, 131, 130, 130, 130, 129, 129, 131, 129, 129, 129, 128, 129, 129, 128, 128, 129, 127, 128, 129, 129, 128, 129, 131, 128, 129, 130, 128, 129, 128, 129, 128, 128, 128, 128, 128, 127, 128, 126, 127, 127, 127, 125, 126, 126, 125, 126, 126, 126, 126, 127, 126, 126, 127, 127, 128, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 129, 128, 128, 129, 128, 129, 128, 128, 131, 131, 129, 130, 130, 130, 129, 130, 130, 129, 129, 129, 129, 128, 128, 127, 129, 128, 129, 128, 129, 129, 128, 129, 127, 128, 130, 128, 128, 129, 128, 128, 129, 127, 127, 127, 127, 127, 127, 127, 126, 126, 127, 126, 126, 127, 126, 126, 125, 127, 126, 126, 126, 127, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 127, 129, 129, 128, 128, 129, 129, 128, 130, 130, 129, 129, 129, 129, 129, 129, 130, 131, 129, 130, 129, 129, 129, 128, 128, 129, 129, 128, 129, 128, 129, 127, 126, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 127, 127, 127, 126, 126, 126, 127, 127, 125, 126, 127, 127, 127, 127, 127, 126, 126, 128, 127, 127, 127, 127, 127, 128, 128, 128, 128, 127, 129, 129, 128, 128, 129, 129, 129, 129, 129, 128, 129, 130, 129, 130, 130, 129, 129, 129, 129, 130, 128, 128, 129, 129, 129, 128, 128, 128, 129, 129, 128, 128, 128, 127, 128, 127, 127, 127, 128, 127, 129, 127, 128, 129, 127, 127, 128, 128, 127, 127, 126, 127, 126, 126, 126, 125, 126, 127, 127, 127, 127, 126, 127, 128, 127, 128, 127, 128, 128, 128, 129, 128, 128, 128, 129, 128, 128, 128, 129, 129, 128, 130, 130, 130, 130, 128, 130, 130, 128, 128, 131, 129, 128, 129, 129, 129, 129, 128, 129, 128, 127, 128, 128, 127, 127, 127, 127, 128, 128, 128, 127, 127, 127, 127, 127, 127, 127, 127, 126, 126, 127, 127, 126, 126, 127, 128, 127, 127, 127, 127, 128, 127, 127, 128, 127, 128, 128, 127, 128, 128, 129, 128, 129, 130, 129, 128, 129, 129, 128, 129, 129, 128, 129, 129, 128, 129, 128, 129, 129, 128, 129, 129, 129, 128, 128, 129, 129, 128, 128, 129, 128, 128, 128, 129, 128, 127, 128, 127, 127, 128, 127, 127, 127, 128, 128, 127, 128, 128, 127, 128, 128, 127, 127, 126, 128, 127, 127, 127, 126, 127, 128, 127, 127, 127, 127, 127, 127, 127, 128, 127, 128, 129, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, 129, 129, 128, 129, 128, 129, 127, 128, 129, 128, 128, 128, 128, 129, 129, 127, 128, 128, 128, 128, 128, 127, 127, 127, 128, 127, 127, 128, 127, 128, 127, 126, 127, 127, 127, 126, 127, 127, 127, 127, 127, 127, 128, 127, 127, 128, 128, 127, 128, 128, 128, 128, 128, 129, 128, 128, 129, 129, 128, 128, 129, 129, 128, 128, 128, 129, 129, 128, 129, 129, 129, 128, 129, 129, 129, 130, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 127, 127, 128, 127, 127, 128, 128, 127, 127, 128, 127, 127, 128, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 129, 128, 127, 128, 129, 128, 128, 128, 128, 129, 128, 128, 128, 129, 129, 128, 129, 129, 129, 129, 128, 129, 129, 128, 129, 129, 128, 128, 129, 129, 128, 128, 127, 128, 129, 127, 126, 128, 129, 127, 126, 127, 128, 127, 128, 127, 127, 128, 128, 127, 127, 127, 128, 128, 127, 127, 127, 127, 127, 128, 126, 127, 127, 127, 127, 128, 128, 128, 128, 128, 129, 129, 128, 127, 129, 128, 128, 128, 128, 128, 129, 129, 128, 128, 130, 128, 128, 129, 128, 128, 129, 129, 128, 129, 129, 129, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 127, 128, 127, 127, 128, 127, 127, 128, 128, 126, 128, 128, 127, 128, 128, 127, 128, 128, 127, 128, 127, 128, 128, 128, 127, 127, 128, 127, 127, 128, 128, 126, 128, 128, 128, 128, 129, 129, 129, 129, 129, 130, 128, 129, 130, 128, 129, 129, 128, 128, 129, 129, 128, 128, 128, 128, 129, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 127, 128, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 127, 127, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 127, 128, 127, 128, 128, 128, 128, 128, 129, 129, 129, 129, 128, 129, 129, 129, 128, 129, 129, 129, 129, 128, 129, 128, 128, 128, 127, 128, 129, 128, 128, 128, 128, 128, 128, 127, 128, 127, 127, 128, 128, 127, 127, 128, 127, 128, 127, 127, 127, 128, 127, 127, 127, 127, 127, 128, 128, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 129, 128, 129, 129, 129, 128, 129, 128, 129, 129, 128, 128, 129, 128, 128, 128, 128, 127, 128, 127, 127, 128, 128, 128, 127, 128, 128, 128, 128, 128, 129, 128, 128, 128, 127, 128, 128, 127, 128, 128, 127, 127, 127, 127, 127, 127, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 128, 129, 129, 129, 129, 128, 129, 129, 128, 128, 128, 128, 127, 127, 128, 127, 127, 127, 128, 128, 127, 128, 128, 127, 127, 128, 127, 128, 128, 128, 127, 128, 128, 128, 127, 127, 128, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 129, 128, 128, 129, 128, 128, 129, 129, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 129, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 128, 128, 127, 127, 128, 127, 127, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 128, 127, 127, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 129, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 127, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; +const uint8_t hihat[] PROGMEM = {245, 14, 0, 0, 129, 130, 129, 127, 131, 129, 126, 132, 126, 126, 131, 130, 126, 129, 126, 126, 129, 130, 124, 129, 127, 126, 127, 126, 127, 131, 151, 132, 121, 143, 139, 141, 118, 155, 113, 126, 165, 96, 150, 114, 128, 151, 88, 121, 106, 127, 150, 74, 135, 98, 114, 120, 102, 106, 96, 131, 135, 94, 101, 118, 91, 161, 105, 129, 99, 151, 155, 124, 147, 100, 170, 99, 137, 107, 161, 155, 109, 128, 112, 151, 138, 121, 127, 138, 129, 137, 111, 143, 148, 137, 143, 114, 135, 119, 136, 179, 136, 137, 102, 173, 145, 125, 154, 158, 144, 120, 166, 112, 127, 158, 131, 147, 118, 135, 153, 124, 128, 116, 135, 111, 129, 107, 118, 157, 80, 127, 120, 113, 91, 110, 127, 119, 109, 137, 94, 122, 113, 136, 130, 140, 118, 101, 143, 113, 128, 144, 147, 108, 137, 116, 140, 96, 154, 138, 98, 114, 130, 147, 125, 113, 148, 121, 113, 138, 121, 140, 135, 123, 118, 159, 130, 125, 115, 160, 158, 115, 116, 123, 140, 140, 136, 90, 162, 131, 135, 122, 130, 112, 134, 154, 123, 165, 74, 133, 146, 119, 160, 93, 128, 117, 120, 110, 130, 148, 129, 115, 119, 126, 116, 159, 105, 123, 127, 142, 120, 120, 144, 141, 128, 119, 147, 120, 147, 139, 120, 148, 112, 147, 130, 104, 131, 133, 120, 129, 129, 107, 154, 115, 149, 134, 123, 128, 155, 120, 103, 133, 129, 154, 106, 117, 141, 124, 137, 134, 113, 116, 120, 122, 118, 134, 113, 139, 90, 144, 131, 103, 138, 133, 126, 121, 134, 122, 144, 126, 118, 135, 93, 123, 122, 143, 136, 130, 118, 135, 133, 142, 148, 96, 132, 135, 153, 100, 117, 151, 157, 119, 119, 139, 116, 148, 145, 113, 135, 118, 132, 144, 131, 136, 119, 93, 160, 135, 123, 128, 115, 139, 119, 141, 128, 140, 112, 131, 126, 120, 127, 107, 155, 132, 89, 126, 118, 112, 158, 123, 124, 129, 109, 139, 118, 124, 124, 111, 130, 134, 122, 124, 115, 133, 135, 118, 127, 131, 123, 129, 135, 112, 144, 113, 139, 114, 112, 135, 117, 144, 123, 112, 162, 147, 101, 143, 144, 126, 120, 135, 133, 156, 133, 143, 128, 121, 128, 145, 136, 130, 135, 116, 158, 145, 126, 146, 137, 133, 130, 126, 120, 142, 143, 142, 127, 119, 146, 142, 135, 104, 135, 128, 129, 132, 99, 135, 125, 117, 120, 119, 122, 110, 109, 99, 141, 121, 110, 134, 120, 117, 123, 126, 117, 107, 120, 155, 122, 116, 122, 127, 136, 135, 113, 131, 126, 109, 137, 133, 126, 141, 140, 130, 126, 124, 132, 133, 132, 126, 134, 126, 136, 129, 143, 139, 131, 116, 128, 121, 136, 127, 133, 130, 139, 118, 133, 126, 103, 143, 116, 138, 130, 118, 113, 135, 124, 133, 128, 152, 113, 120, 147, 104, 148, 105, 132, 143, 112, 138, 142, 126, 120, 141, 135, 131, 118, 122, 155, 131, 111, 127, 115, 137, 123, 122, 155, 109, 127, 135, 148, 123, 114, 136, 145, 118, 113, 135, 126, 122, 119, 140, 130, 140, 125, 126, 131, 135, 125, 122, 140, 127, 117, 153, 124, 132, 134, 135, 122, 117, 138, 125, 135, 128, 117, 119, 137, 144, 125, 127, 113, 120, 127, 122, 140, 114, 127, 126, 129, 130, 112, 116, 149, 124, 102, 130, 144, 128, 109, 156, 110, 134, 115, 126, 126, 112, 140, 134, 125, 110, 126, 122, 141, 114, 127, 130, 124, 126, 128, 131, 114, 137, 131, 122, 116, 113, 145, 132, 128, 116, 129, 142, 125, 123, 125, 132, 136, 118, 138, 123, 131, 137, 121, 136, 125, 130, 133, 132, 129, 120, 136, 130, 128, 137, 125, 135, 131, 137, 123, 134, 136, 144, 115, 137, 124, 140, 148, 116, 137, 119, 138, 130, 136, 123, 125, 141, 122, 123, 128, 127, 129, 119, 141, 120, 129, 128, 136, 127, 110, 141, 114, 123, 143, 123, 129, 128, 116, 140, 115, 116, 135, 128, 128, 119, 129, 115, 123, 117, 127, 139, 122, 125, 110, 133, 136, 110, 135, 120, 133, 133, 124, 134, 131, 131, 121, 138, 125, 127, 130, 144, 139, 127, 120, 134, 122, 136, 123, 128, 127, 131, 135, 119, 127, 131, 136, 132, 127, 118, 123, 125, 139, 124, 134, 121, 131, 126, 134, 122, 131, 134, 124, 129, 129, 129, 120, 130, 125, 125, 119, 145, 127, 124, 139, 126, 131, 132, 128, 130, 139, 125, 119, 126, 133, 125, 137, 129, 134, 121, 129, 137, 119, 132, 111, 137, 133, 116, 123, 133, 129, 126, 122, 127, 123, 130, 133, 120, 131, 117, 127, 126, 122, 127, 123, 126, 127, 123, 123, 126, 126, 126, 130, 129, 121, 131, 121, 137, 120, 132, 132, 115, 135, 130, 132, 128, 133, 127, 131, 133, 132, 124, 133, 125, 133, 129, 124, 137, 133, 138, 125, 126, 132, 129, 139, 128, 130, 133, 129, 133, 129, 133, 125, 129, 125, 132, 132, 125, 130, 134, 131, 125, 129, 131, 140, 115, 127, 121, 125, 135, 127, 132, 119, 137, 121, 126, 130, 127, 128, 120, 127, 128, 123, 123, 127, 123, 126, 125, 129, 127, 128, 127, 131, 136, 122, 123, 122, 125, 126, 130, 129, 118, 126, 133, 123, 119, 131, 125, 121, 127, 128, 127, 125, 133, 122, 132, 120, 124, 136, 130, 136, 132, 122, 132, 136, 124, 133, 133, 132, 123, 131, 129, 126, 132, 127, 121, 134, 132, 125, 128, 126, 134, 127, 127, 138, 123, 130, 132, 126, 123, 122, 131, 135, 129, 128, 128, 130, 130, 127, 126, 128, 126, 128, 129, 130, 123, 128, 134, 128, 123, 131, 131, 122, 132, 134, 131, 124, 135, 131, 125, 130, 125, 125, 130, 121, 139, 129, 126, 134, 118, 135, 121, 125, 139, 127, 129, 129, 129, 127, 126, 124, 132, 124, 130, 129, 125, 134, 127, 125, 129, 132, 131, 134, 132, 122, 122, 133, 133, 127, 126, 126, 131, 124, 122, 130, 133, 124, 124, 138, 117, 126, 127, 122, 122, 129, 124, 124, 133, 121, 133, 119, 127, 130, 125, 129, 131, 130, 127, 120, 135, 130, 128, 125, 126, 133, 125, 132, 125, 134, 125, 130, 134, 124, 124, 130, 134, 126, 127, 133, 125, 128, 134, 123, 127, 126, 128, 132, 123, 129, 129, 135, 123, 127, 125, 125, 130, 129, 134, 124, 127, 131, 134, 130, 128, 126, 133, 127, 128, 129, 127, 129, 129, 129, 133, 127, 129, 130, 128, 126, 125, 126, 130, 130, 128, 131, 123, 125, 128, 131, 128, 132, 126, 132, 122, 127, 134, 124, 124, 126, 131, 122, 130, 124, 124, 126, 125, 127, 129, 128, 129, 129, 126, 125, 126, 131, 123, 131, 127, 128, 126, 126, 136, 131, 130, 128, 127, 134, 126, 133, 124, 127, 134, 127, 133, 129, 129, 128, 126, 125, 133, 131, 135, 126, 129, 128, 127, 124, 133, 125, 127, 130, 122, 128, 128, 130, 130, 125, 127, 130, 124, 131, 128, 129, 127, 132, 127, 127, 127, 129, 130, 125, 128, 127, 122, 132, 128, 129, 128, 122, 125, 124, 127, 127, 126, 132, 127, 122, 130, 126, 128, 132, 122, 126, 133, 126, 124, 127, 130, 127, 126, 127, 129, 128, 132, 127, 128, 124, 133, 136, 126, 127, 127, 123, 128, 129, 132, 131, 129, 130, 123, 131, 130, 126, 130, 123, 130, 134, 124, 130, 125, 130, 127, 125, 128, 130, 128, 130, 129, 129, 125, 129, 133, 128, 127, 128, 125, 123, 134, 131, 126, 126, 132, 129, 128, 131, 132, 130, 128, 131, 126, 125, 129, 131, 129, 129, 129, 123, 134, 129, 129, 128, 132, 130, 127, 134, 126, 130, 129, 126, 127, 133, 126, 126, 129, 130, 127, 127, 129, 129, 123, 130, 130, 121, 127, 125, 128, 126, 123, 125, 127, 124, 129, 127, 120, 128, 130, 127, 129, 127, 123, 129, 126, 125, 126, 128, 129, 124, 131, 126, 124, 128, 128, 128, 126, 128, 127, 129, 129, 125, 129, 129, 125, 127, 128, 129, 132, 128, 128, 130, 127, 133, 127, 129, 130, 127, 132, 129, 126, 131, 130, 130, 130, 127, 132, 130, 130, 131, 129, 129, 130, 124, 133, 130, 130, 128, 127, 132, 127, 130, 128, 128, 131, 126, 125, 131, 130, 126, 129, 129, 129, 126, 127, 128, 124, 127, 127, 126, 126, 131, 129, 128, 125, 125, 127, 128, 126, 127, 125, 127, 127, 129, 128, 130, 123, 127, 129, 125, 129, 129, 130, 123, 128, 126, 128, 129, 128, 127, 130, 126, 129, 130, 130, 128, 129, 128, 125, 130, 127, 129, 130, 128, 129, 128, 129, 128, 130, 130, 129, 127, 131, 128, 126, 132, 125, 130, 130, 127, 130, 126, 130, 129, 128, 129, 128, 128, 127, 130, 128, 129, 127, 127, 127, 129, 127, 126, 128, 126, 125, 130, 128, 125, 127, 127, 129, 126, 129, 126, 125, 131, 123, 128, 126, 129, 129, 126, 131, 126, 127, 125, 127, 128, 126, 128, 129, 124, 128, 127, 128, 125, 129, 132, 127, 130, 125, 129, 130, 129, 128, 129, 129, 126, 129, 131, 130, 128, 130, 129, 130, 130, 128, 129, 128, 128, 128, 129, 130, 129, 129, 127, 130, 128, 129, 129, 128, 129, 128, 131, 128, 130, 129, 127, 127, 128, 128, 130, 129, 127, 128, 127, 130, 128, 128, 128, 128, 127, 129, 128, 128, 128, 124, 129, 127, 125, 128, 126, 129, 126, 126, 127, 127, 127, 127, 127, 124, 128, 130, 130, 127, 126, 128, 126, 131, 127, 128, 130, 128, 128, 130, 128, 130, 128, 127, 131, 128, 128, 128, 130, 128, 127, 128, 131, 128, 129, 127, 127, 129, 127, 129, 128, 126, 127, 130, 127, 125, 126, 127, 124, 129, 126, 128, 128, 127, 128, 126, 129, 127, 128, 128, 127, 128, 127, 128, 130, 127, 126, 130, 128, 126, 128, 129, 127, 127, 129, 128, 128, 129, 129, 124, 130, 128, 130, 127, 128, 130, 128, 129, 128, 128, 127, 132, 127, 130, 128, 130, 129, 127, 130, 128, 130, 128, 128, 130, 128, 127, 130, 130, 129, 127, 126, 130, 128, 129, 129, 128, 129, 128, 127, 129, 127, 126, 128, 127, 128, 128, 128, 128, 127, 130, 128, 128, 127, 126, 131, 128, 126, 127, 129, 128, 128, 126, 127, 126, 128, 129, 128, 127, 128, 129, 127, 129, 126, 128, 128, 128, 128, 126, 129, 128, 127, 129, 127, 128, 127, 128, 127, 127, 129, 126, 128, 129, 126, 128, 129, 128, 125, 129, 128, 128, 129, 128, 128, 128, 129, 129, 127, 127, 128, 128, 129, 126, 130, 129, 127, 127, 128, 126, 129, 128, 128, 130, 129, 128, 127, 127, 130, 130, 129, 126, 127, 130, 130, 127, 128, 128, 128, 130, 126, 128, 129, 130, 128, 130, 128, 128, 131, 128, 131, 129, 128, 128, 128, 130, 130, 128, 128, 128, 128, 126, 128, 129, 128, 128, 127, 128, 127, 127, 128, 128, 127, 127, 127, 127, 128, 128, 127, 126, 128, 127, 128, 126, 127, 126, 127, 127, 127, 128, 127, 127, 127, 128, 127, 125, 128, 130, 127, 129, 126, 128, 130, 127, 127, 128, 128, 128, 128, 130, 128, 128, 127, 125, 130, 129, 129, 129, 128, 128, 130, 129, 128, 131, 130, 127, 129, 129, 128, 129, 129, 130, 129, 130, 130, 129, 130, 130, 128, 128, 130, 129, 129, 128, 128, 130, 127, 129, 130, 126, 129, 129, 127, 130, 128, 127, 128, 129, 127, 125, 129, 127, 127, 127, 126, 127, 128, 127, 127, 127, 126, 127, 128, 127, 127, 128, 126, 126, 127, 126, 126, 127, 128, 127, 128, 127, 125, 128, 128, 127, 128, 126, 128, 127, 127, 130, 127, 128, 127, 128, 127, 128, 129, 131, 129, 130, 127, 127, 128, 129, 129, 127, 128, 128, 131, 129, 128, 128, 129, 128, 130, 129, 127, 129, 130, 128, 128, 130, 128, 129, 129, 129, 128, 128, 130, 130, 128, 128, 129, 128, 128, 129, 127, 129, 128, 128, 128, 126, 130, 127, 126, 128, 128, 126, 128, 126, 128, 128, 127, 128, 128, 128, 127, 128, 127, 129, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 130, 127, 128, 128, 129, 128, 128, 128, 127, 126, 128, 128, 127, 129, 126, 128, 127, 128, 128, 128, 128, 128, 127, 127, 129, 130, 127, 128, 129, 128, 128, 127, 128, 129, 128, 127, 128, 128, 128, 129, 129, 127, 127, 129, 127, 128, 130, 127, 129, 127, 128, 127, 129, 129, 129, 128, 128, 129, 128, 128, 128, 128, 126, 129, 129, 127, 129, 130, 129, 128, 127, 128, 129, 128, 129, 128, 128, 129, 128, 130, 127, 129, 129, 128, 129, 129, 129, 128, 129, 127, 127, 130, 128, 129, 129, 126, 128, 128, 129, 127, 129, 128, 126, 128, 127, 127, 128, 127, 127, 127, 127, 128, 127, 128, 128, 126, 127, 128, 128, 128, 127, 127, 127, 127, 128, 127, 128, 128, 126, 128, 127, 129, 127, 127, 128, 126, 129, 129, 127, 128, 129, 126, 129, 128, 128, 127, 128, 129, 127, 129, 129, 128, 129, 129, 128, 129, 128, 130, 130, 129, 128, 128, 129, 128, 130, 127, 129, 130, 128, 128, 128, 130, 128, 128, 128, 128, 129, 127, 129, 130, 127, 128, 127, 128, 128, 128, 129, 127, 128, 127, 128, 128, 128, 128, 128, 128, 127, 128, 127, 127, 128, 129, 127, 127, 127, 127, 128, 129, 125, 127, 128, 128, 128, 127, 129, 127, 128, 127, 127, 127, 128, 129, 128, 126, 129, 130, 127, 128, 128, 128, 129, 127, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 128, 129, 127, 128, 129, 128, 128, 129, 129, 128, 128, 129, 129, 127, 129, 127, 127, 129, 128, 129, 127, 127, 130, 128, 128, 129, 128, 128, 129, 127, 127, 129, 128, 128, 128, 127, 127, 129, 129, 127, 127, 127, 128, 129, 129, 128, 129, 127, 128, 127, 127, 128, 129, 127, 128, 129, 128, 129, 129, 128, 127, 128, 129, 128, 128, 128, 128, 128, 128, 129, 127, 129, 129, 128, 128, 128, 129, 129, 128, 127, 129, 129, 128, 128, 127, 127, 129, 129, 128, 127, 128, 129, 128, 127, 128, 127, 128, 128, 128, 128, 128, 128, 128, 126, 129, 128, 128, 128, 126, 128, 129, 129, 128, 128, 127, 127, 128, 128, 128, 127, 129, 128, 127, 128, 127, 129, 129, 127, 127, 128, 129, 129, 129, 128, 128, 128, 128, 128, 128, 129, 128, 129, 128, 128, 129, 129, 128, 127, 128, 129, 129, 127, 128, 127, 128, 130, 128, 128, 128, 129, 128, 127, 128, 129, 128, 127, 127, 128, 128, 128, 128, 127, 127, 128, 129, 128, 129, 128, 126, 128, 128, 128, 127, 127, 128, 128, 127, 127, 128, 128, 128, 128, 127, 127, 128, 128, 128, 126, 128, 128, 127, 128, 127, 128, 129, 129, 129, 128, 127, 128, 129, 128, 128, 129, 128, 127, 128, 129, 129, 129, 128, 128, 129, 129, 129, 129, 129, 129, 128, 128, 129, 127, 129, 128, 128, 128, 127, 130, 128, 128, 129, 127, 128, 128, 129, 128, 127, 128, 129, 128, 128, 126, 128, 128, 127, 127, 128, 128, 128, 128, 127, 127, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 127, 128, 127, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 127, 129, 129, 129, 128, 128, 128, 129, 129, 127, 128, 128, 128, 129, 129, 129, 127, 129, 128, 127, 128, 129, 129, 127, 127, 128, 129, 129, 128, 127, 128, 129, 128, 128, 127, 128, 129, 127, 128, 127, 129, 128, 127, 127, 128, 129, 128, 129, 127, 127, 128, 128, 129, 128, 127, 128, 128, 128, 128, 129, 128, 128, 129, 128, 128, 129, 128, 128, 127, 128, 128, 129, 128, 127, 127, 128, 129, 129, 128, 127, 128, 129, 128, 128, 128, 129, 129, 127, 129, 128, 129, 129, 127, 128, 128, 129, 129, 128, 128, 127, 128, 128, 127, 128, 128, 128, 128, 127, 128, 128, 127, 127, 127, 127, 128, 128, 127, 127, 127, 127, 128, 128, 128, 127, 127, 128, 128, 128, 127, 129, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 129, 128, 128, 128, 128, 129, 128, 128, 128, 129, 128, 128, 128, 129, 129, 128, 128, 129, 128, 129, 129, 128, 128, 128, 129, 129, 128, 128, 128, 129, 129, 128, 128, 127, 128, 129, 128, 127, 128, 128, 127, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 127, 128, 127, 128, 128, 128, 127, 127, 127, 127, 127, 128, 128, 127, 127, 127, 128, 129, 128, 127, 127, 128, 129, 128, 128, 128, 127, 128, 129, 128, 128, 128, 128, 128, 127, 128, 128, 128, 129, 127, 128, 129, 129, 129, 127, 128, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 127, 130, 128, 128, 128, 128, 127, 128, 129, 128, 128, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 127, 127, 127, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 129, 129, 128, 127, 128, 129, 129, 128, 128, 128, 129, 128, 128, 127, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 128, 127, 127, 128, 128, 129, 128, 128, 129, 127, 128, 129, 127, 129, 127, 128, 128, 129, 129, 127, 127, 128, 128, 129, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 128, 128, 129, 129, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 129, 129, 129, 128, 128, 128, 129, 129, 128, 128, 128, 129, 128, 128, 128, 127, 128, 129, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 128, 127, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 129, 129, 128, 128, 128, 129, 129, 127, 128, 128, 128, 128, 129, 128, 128, 129, 128, 128, 128, 129, 128, 128, 128, 128, 130, 128, 128, 127, 127, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 129, 128, 127, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 128, 128, 129, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 129, 128, 127, 128, 128, 129, 128, 127, 128, 127, 129, 129, 128, 128, 127, 129, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 127, 128, 128, 128, 128, 127, 127, 128, 128, 127, 127, 128, 127, 127, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 127, 127, 128, 129, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 128, 129, 128, 127, 129, 129, 128, 128, 128, 128, 129, 128, 128, 129, 129, 128, 127, 128, 129, 130, 129, 128, 127, 128, 129, 129, 128, 127, 128, 128, 128, 128, 129, 128, 128, 127, 127, 128, 129, 128, 128, 127, 127, 129, 128, 127, 128, 127, 127, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 127, 127, 129, 129, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 128, 127, 128, 128, 129, 129, 127, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 127, 128, 128, 129, 129, 127, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 129, 128, 128, 127, 128, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 127, 128, 129, 128, 128, 127, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 129, 129, 128, 127, 128, 128, 129, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 129, 128, 129, 128, 128, 128, 128, 128, 129, 129, 128, 128, 127, 128, 128, 129, 128, 127, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 129, 128, 128, 128, 127, 128, 128, 129, 129, 128, 127, 128, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 127, 128, 129, 129, 128, 127, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 129, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 127, 127, 127, 128, 129, 128, 128, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 129, 128, 128, 128, 128, 129, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 127, 128, 128, 128, 128, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; diff --git a/thereminus/thereminus.ino b/thereminus/thereminus.ino index 9082ff8..ae94d08 100644 --- a/thereminus/thereminus.ino +++ b/thereminus/thereminus.ino @@ -1,12 +1,13 @@ -enum playingModes {CONTINUOUS, QUANTIZED}; -const byte INITIAL_PLAYING_MODE = CONTINUOUS; -byte playingMode = INITIAL_PLAYING_MODE; +#include +#include "samples.h" + +enum playingModes {CONTINUOUS, QUANTIZED, SAMPLES}; +playingModes playingMode = CONTINUOUS; enum scales {CHROMATIC, C_PENTATONIC, A_MAJOR}; -const byte INITIAL_QUANTIZED_MODE_SCALE = CHROMATIC; -byte quantizedModeScale = INITIAL_QUANTIZED_MODE_SCALE; +scales quantizedModeScale = CHROMATIC; -const byte INITIAL_NOTE_JUMP_DISTANCE = 2; +const byte INITIAL_NOTE_JUMP_DISTANCE = 3; byte noteJumpDistance = INITIAL_NOTE_JUMP_DISTANCE; const int PIN_BUTTON = 9; @@ -56,7 +57,7 @@ const int ROW3_PIN = 7; #define RowOn(N) digitalWrite(ROW ## N ## _PIN, LOW); #define RowOff(N) digitalWrite(ROW ## N ## _PIN, HIGH); #define ColumnsOff() ColumnOff(1);ColumnOff(2);ColumnOff(3);ColumnOff(4);ColumnOff(5);ColumnOff(6);ColumnOff(7);ColumnOff(8);ColumnOff(9); -int cubeled_state = 0; +#define LEN(a) (uint16_t)(sizeof a / sizeof *a) /** * from cdrfiuba/picopico @@ -81,20 +82,26 @@ const uint8_t amp[] = {0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, // Noise period counter (12 entries) const uint16_t noisePeriods[] = {1200, 1760, 2360, 2960, 3760, 4720, 7080, 9440, 14160, 18880, 37800, 65535}; -enum Waveform { PULSE, SAW, TRI, NOISE }; +enum Waveform { PULSE, SAW, TRI, NOISE, SAMPLE }; struct Voice { - // Player-related registers - uint8_t note; // Note (0-11) - uint8_t octave; // Octave (0-7) - uint8_t volume; // Volume (0-15) - - // Internal registers for sound generation - volatile Waveform waveform; - volatile int16_t acc; // Phase accumulator - volatile uint16_t freq; // Frequency delta - volatile uint8_t amp; // Amplitude - volatile int8_t pw; // Pulse width + // Player-related registers + uint8_t note; // Note (0-11) + uint8_t octave; // Octave (0-7) + uint8_t volume; // Volume (0-15) + + // Internal registers for sound generation + volatile Waveform waveform; + volatile int16_t acc; // Phase accumulator + volatile uint16_t freq; // Frequency delta + volatile uint8_t amp; // Amplitude + volatile int8_t pw; // Pulse width + volatile const void* sample; // pointer to sample + volatile uint16_t sample_size; // size of the sample array + volatile uint16_t sample_counter; // counter for the current index of the sample + volatile uint16_t sample_tick; // counter for correcting the sample rate + volatile bool sample_must_play; // flag for starting the playback of a sample + volatile bool sample_is_playing; // flag for playing back each byte of the sample }; // Note buffer @@ -114,81 +121,98 @@ ISR(TIMER0_COMPA_vect) { sound_generation(); } void sound_generation() { - // tick counter for time keeping - timer0_tick++; - if (timer0_tick > 111) { // 333 = 16.65ms, 111 = 5.55ms - timer0_tick = 0; - // if the tick counter fires before the last tick was completed, - // while still playing, toggle the led - //if (nextTick && playing) { - // digitalWrite(PIN_LED, abs(digitalRead(PIN_LED) - 1)); - //} - // ticks and big ticks (every 1 second) - nextTick = true; - ticks++; - if (ticks > 27) { // 5.55ms * 27 = 149.85ms - ticks = 0; - nextBigTick = true; - digitalWrite(PIN_LED, abs(digitalRead(PIN_LED) - 1)); - } + // tick counter for time keeping + timer0_tick++; + if (timer0_tick > 111) { // 333 = 16.66ms, 111 = 5.55ms + timer0_tick = 0; + // if the tick counter fires before the last tick was completed, + // while still playing, toggle the led + //if (nextTick && playing) { + // digitalWrite(PIN_LED, abs(digitalRead(PIN_LED) - 1)); + //} + // ticks and big ticks (every 1 second) + nextTick = true; + ticks++; + if (ticks > 90) { // 5.55ms * 180 = 1000ms + ticks = 0; + nextBigTick = true; + digitalWrite(PIN_LED, abs(digitalRead(PIN_LED) - 1)); } + } - unsigned char temp; - signed char stemp, mask, out = 0; - Voice* v; - - for (int i = 0; i < NUM_VOICES; i++) { - v = &voices[i]; - switch (v->waveform) { - case PULSE: - v->acc += v->freq; - temp = (v->acc >> 8) & v->pw; - out += (temp ? v->amp : 0) >> 2; - break; - case TRI: - v->acc += v->freq / 2; - stemp = v->acc >> 8; - mask = stemp >> 7; - if (v->amp != 0) { - if (v->volume > 12) { // 13 14 15 - out += (stemp ^ mask) >> 1; - } else if (v->volume > 8) { // 9 10 11 12 - out += (stemp ^ mask) >> 2; - } else if (v->volume > 4) { // 5 6 7 8 - out += (stemp ^ mask) >> 3; - } else if (v->volume > 0) { // 1 2 3 4 - out += (stemp ^ mask) >> 4; - } - } - break; - case SAW: - v->acc += v->freq; - temp = v->acc >> 8; - out += (temp ? v->amp : 0) >> 2; - break; - case NOISE: - v->acc += v->freq * 8; - stemp = (v->acc >> 8) & 0x80; - // if temp != oldTemp, trigger the LFSR to generate a new pseudorandom value - if (stemp != oldTemp) { - lfsrOut = (lfsr & 1) ^ ((lfsr & 2) >> 1); // output is bit 0 XOR bit 1 - lfsr = (lfsr >> 1) | (lfsrOut << 14); // shift and include output on bit 15 - oldTemp = stemp; - } - out += (lfsrOut ? v->amp : 0) >> 2; - break; + // inspired by http://www.technoblogy.com/show?2E6L + unsigned char temp; + signed char stemp, mask, out = 0; + Voice* v; + for (int i = 0; i < NUM_VOICES; i++) { + v = &voices[i]; + switch (v->waveform) { + case PULSE: + v->acc += v->freq; + temp = (v->acc >> 8) & v->pw; + out += (temp ? v->amp : 0) >> 2; + break; + case TRI: + v->acc += v->freq / 2; + stemp = v->acc >> 8; + mask = stemp >> 7; + if (v->amp != 0) { + if (v->volume > 12) { // 13 14 15 + out += (stemp ^ mask) >> 1; + } else if (v->volume > 8) { // 9 10 11 12 + out += (stemp ^ mask) >> 2; + } else if (v->volume > 4) { // 5 6 7 8 + out += (stemp ^ mask) >> 3; + } else if (v->volume > 0) { // 1 2 3 4 + out += (stemp ^ mask) >> 4; + } } - } + break; + case SAW: + v->acc += v->freq; + temp = v->acc >> 8; + out += (temp ? v->amp : 0) >> 2; + break; + case NOISE: + v->acc += v->freq * 8; + stemp = (v->acc >> 8) & 0x80; + // if temp != oldTemp, trigger the LFSR to generate a new pseudorandom value + if (stemp != oldTemp) { + lfsrOut = (lfsr & 1) ^ ((lfsr & 2) >> 1); // output is bit 0 XOR bit 1 + lfsr = (lfsr >> 1) | (lfsrOut << 14); // shift and include output on bit 15 + oldTemp = stemp; + } + out += (lfsrOut ? v->amp : 0) >> 2; + break; + case SAMPLE: + if (v->sample_must_play == true) { + v->sample_must_play = false; + v->sample_counter = 0; + v->sample_is_playing = true; + } + if (v->sample_is_playing) { + v->sample_counter++; + out += pgm_read_byte_near((char*)v->sample + v->sample_counter - 1); + if (v->sample_counter >= v->sample_size - 1) { + v->sample_is_playing = false; + v->sample_counter = 0; + } + } else { + out += 128; + } + break; + } + } - // notes on the noise channels: - // This noise generator is somewhat based on the mechanism found in the NES APU. - // The NES has a linear-feedback shift register for generating pseudorandom numbers. - // It starts with a register set to 1, and when the period counter reaches 0, it - // clocks the shift register. - // The LFSR performs an Exclusive OR between bit 0 and bit 1, then shifts to the - // right, and sets/resets bit 15 based on the exclusive OR result. + // notes on the noise channels: + // This noise generator is somewhat based on the mechanism found in the NES APU. + // The NES has a linear-feedback shift register for generating pseudorandom numbers. + // It starts with a register set to 1, and when the period counter reaches 0, it + // clocks the shift register. + // The LFSR performs an Exclusive OR between bit 0 and bit 1, then shifts to the + // right, and sets/resets bit 15 based on the exclusive OR result. - OCR1B = out; + OCR1B = out; } /** @@ -321,6 +345,56 @@ bool isButtonPressed (int pinButton, int buttonPressedValue = LOW, bool waitForR buttonPressed = false; return false; } +void ledsBy10Segments(int segment) { + RowOn(1); RowOn(2); RowOn(3); + ColumnsOff(); + switch (segment) { + case 1: ColumnOn(1) break; + case 2: ColumnOn(2) break; + case 3: ColumnOn(3) break; + case 4: ColumnOn(4) break; + case 5: ColumnOn(5) break; + case 6: ColumnOn(6) break; + case 7: ColumnOn(7) break; + case 8: ColumnOn(8) break; + case 9: ColumnOn(9) break; + } +} +void ledsBy27Segments(int segment) { + RowOff(1); RowOff(2); RowOff(3); + ColumnsOff(); + switch (segment) { + case 1: RowOn(1); ColumnOn(1); break; + case 2: RowOn(1); ColumnOn(2); break; + case 3: RowOn(1); ColumnOn(3); break; + case 4: RowOn(1); ColumnOn(4); break; + case 5: RowOn(1); ColumnOn(5); break; + case 6: RowOn(1); ColumnOn(6); break; + case 7: RowOn(1); ColumnOn(7); break; + case 8: RowOn(1); ColumnOn(8); break; + case 9: RowOn(1); ColumnOn(9); break; + + case 10: RowOn(2); ColumnOn(1); break; + case 11: RowOn(2); ColumnOn(2); break; + case 12: RowOn(2); ColumnOn(3); break; + case 13: RowOn(2); ColumnOn(4); break; + case 14: RowOn(2); ColumnOn(5); break; + case 15: RowOn(2); ColumnOn(6); break; + case 16: RowOn(2); ColumnOn(7); break; + case 17: RowOn(2); ColumnOn(8); break; + case 18: RowOn(2); ColumnOn(9); break; + + case 19: RowOn(3); ColumnOn(1); break; + case 20: RowOn(3); ColumnOn(2); break; + case 21: RowOn(3); ColumnOn(3); break; + case 22: RowOn(3); ColumnOn(4); break; + case 23: RowOn(3); ColumnOn(5); break; + case 24: RowOn(3); ColumnOn(6); break; + case 25: RowOn(3); ColumnOn(7); break; + case 26: RowOn(3); ColumnOn(8); break; + case 27: RowOn(3); ColumnOn(9); break; + } +} void setup() { Serial.begin(115200); @@ -383,16 +457,15 @@ void setup() { // voice initialization for (int i = 0; i < NUM_VOICES; i++) { - Voice* v = &voices[i]; - v->octave = DEFAULT_OCTAVE; - v->volume = DEFAULT_VOL; - v->pw = DEFAULT_PW; + voices[i].octave = DEFAULT_OCTAVE; + voices[i].volume = DEFAULT_VOL; + voices[i].pw = DEFAULT_PW; } // voices voices[0].waveform = PULSE; voices[1].waveform = PULSE; voices[2].waveform = PULSE; - + /* led cube config */ pinMode(COLUMN1_PIN, OUTPUT); pinMode(COLUMN2_PIN, OUTPUT); @@ -422,63 +495,35 @@ void loop() { // play sound according to distance, focusing on a small octave range, // but with a lot of precision, to emulate a true theremin for (int i = 0; i < NUM_SONARS; i++) { + voices[i].waveform = PULSE; + voices[i].amp = 0; RowOff(1); RowOff(2); RowOff(3); ColumnsOff(); - voices[i].amp = 0; if (sonar[i].distance < MIN_DISTANCE || sonar[i].distance > MAX_DISTANCE) continue; int mapped_distance = map(sonar[i].distance, MIN_DISTANCE, MAX_DISTANCE, 1, 27); - if (mapped_distance == 1) { RowOn(1); ColumnOn(1);} - if (mapped_distance == 2) { RowOn(1); ColumnOn(2);} - if (mapped_distance == 3) { RowOn(1); ColumnOn(3);} - if (mapped_distance == 4) { RowOn(1); ColumnOn(4);} - if (mapped_distance == 5) { RowOn(1); ColumnOn(5);} - if (mapped_distance == 6) { RowOn(1); ColumnOn(6);} - if (mapped_distance == 7) { RowOn(1); ColumnOn(7);} - if (mapped_distance == 8) { RowOn(1); ColumnOn(8);} - if (mapped_distance == 9) { RowOn(1); ColumnOn(9);} - - if (mapped_distance == 10) {RowOn(2); ColumnOn(1);} - if (mapped_distance == 11) {RowOn(2); ColumnOn(2);} - if (mapped_distance == 12) {RowOn(2); ColumnOn(3);} - if (mapped_distance == 13) {RowOn(2); ColumnOn(4);} - if (mapped_distance == 14) {RowOn(2); ColumnOn(5);} - if (mapped_distance == 15) {RowOn(2); ColumnOn(6);} - if (mapped_distance == 16) {RowOn(2); ColumnOn(7);} - if (mapped_distance == 17) {RowOn(2); ColumnOn(8);} - if (mapped_distance == 18) {RowOn(2); ColumnOn(9);} - - if (mapped_distance == 19) {RowOn(3); ColumnOn(1);} - if (mapped_distance == 20) {RowOn(3); ColumnOn(2);} - if (mapped_distance == 21) {RowOn(3); ColumnOn(3);} - if (mapped_distance == 22) {RowOn(3); ColumnOn(4);} - if (mapped_distance == 23) {RowOn(3); ColumnOn(5);} - if (mapped_distance == 24) {RowOn(3); ColumnOn(6);} - if (mapped_distance == 25) {RowOn(3); ColumnOn(7);} - if (mapped_distance == 26) {RowOn(3); ColumnOn(8);} - if (mapped_distance == 27) {RowOn(3); ColumnOn(9);} + ledsBy27Segments(mapped_distance); - Voice* v = &voices[i]; - - v->amp = amp[CONTINUOUS_MODE_VOLUME]; + voices[i].amp = amp[CONTINUOUS_MODE_VOLUME]; // multiplying the usable range (from 0 to 60, or from 0 to 100) by 16 // provides approximately one octave of continuous sound, going from // around 250Hz to 500Hz when setting the base freq to 800 int32_t freq = CONTINUOUS_MODE_MAX_FREQ - (sonar[i].distance) * 16; if (freq < 0) freq = 0; - v->freq = (uint16_t)freq; + voices[i].freq = (uint16_t)freq; // reduce volume if far int distanceFromMax = MAX_DISTANCE - sonar[i].distance; if (distanceFromMax < CONTINUOUS_MODE_VOLUME) { - v->amp = amp[distanceFromMax]; + voices[i].amp = amp[distanceFromMax]; } - serialDebug("%.4d %.2d\n", v->freq, sonar[i].distance); + serialDebug("%.4d %.3d\n",voices[i].freq, sonar[i].distance); } } if (playingMode == QUANTIZED) { // play sound according to distance for (int i = 0; i < NUM_SONARS; i++) { + voices[i].waveform = PULSE; // when outside the range, mute sound and proceed to next sonar if (sonar[i].distance < MIN_DISTANCE || sonar[i].distance > MAX_DISTANCE) { RowOff(1); RowOff(2); RowOff(3); @@ -505,17 +550,7 @@ void loop() { midiNote = segment + MIDI_BASE_NOTE; // leds - RowOn(1); RowOn(2); RowOn(3); - ColumnsOff(); - if (segment == 8) ColumnOn(1); - if (segment == 9) ColumnOn(2); - if (segment == 10) ColumnOn(3); - if (segment == 11) ColumnOn(4); - if (segment == 12) ColumnOn(5); - if (segment == 13) ColumnOn(6); - if (segment == 14) ColumnOn(7); - if (segment == 15) ColumnOn(8); - if (segment == 16) ColumnOn(9); + ledsBy10Segments(segment - 7); } if (quantizedModeScale == C_PENTATONIC) { num_notes = 10; @@ -525,34 +560,23 @@ void loop() { if (rangeUp == rangeDown || abs(segment - previousSegment) >= noteJumpDistance) { segment = rangeUp; } - previousSegment = rangeUp; + previousSegment = segment; const int NOTES[num_notes + 1] = { 57, 60, 62, 65, 67, 69, 72, 74, 77, 79, 81 }; midiNote = NOTES[segment]; - // leds - RowOn(1); RowOn(2); RowOn(3); - ColumnsOff(); - if (segment == 1) ColumnOn(1); - if (segment == 2) ColumnOn(2); - if (segment == 3) ColumnOn(3); - if (segment == 4) ColumnOn(4); - if (segment == 5) ColumnOn(5); - if (segment == 6) ColumnOn(6); - if (segment == 7) ColumnOn(7); - if (segment == 8) ColumnOn(8); - if (segment == 9) ColumnOn(9); + ledsBy10Segments(segment); } if (quantizedModeScale == A_MAJOR) { - int a_major_notes = 24; - rangeUp = ceil(sonar[i].distance * a_major_notes / MAX_DISTANCE); - rangeDown = ceil((sonar[i].distance + HYSTERESIS_IN_CM) * a_major_notes / MAX_DISTANCE); + num_notes = 24; + rangeUp = ceil(sonar[i].distance * num_notes / MAX_DISTANCE); + rangeDown = ceil((sonar[i].distance + HYSTERESIS_IN_CM) * num_notes / MAX_DISTANCE); if (rangeUp == rangeDown || abs(segment - previousSegment) >= noteJumpDistance) { segment = rangeUp; } - previousSegment = rangeUp; - const int NOTES[a_major_notes + 1] = { + previousSegment = segment; + const int NOTES[num_notes + 1] = { 42, 44, 45, 47, 49, 50, 52, 54, 56, 57, 59, 61, 62, 64, 66, 68, 69, 71, 73, 74, 76, @@ -561,28 +585,64 @@ void loop() { midiNote = NOTES[segment]; // leds - RowOn(1); RowOn(2); RowOn(3); - ColumnsOff(); - if (segment == 8) ColumnOn(1); - if (segment == 9) ColumnOn(2); - if (segment == 10) ColumnOn(3); - if (segment == 11) ColumnOn(4); - if (segment == 12) ColumnOn(5); - if (segment == 13) ColumnOn(6); - if (segment == 14) ColumnOn(7); - if (segment == 15) ColumnOn(8); - if (segment == 16) ColumnOn(9); + ledsBy27Segments(segment); } - serialDebug("%.2d %.2d %.2d %.2d\n", rangeUp, rangeDown, midiNote, sonar[i].distance); + serialDebug("%.2d %.2d %.2d %.3d\n", rangeUp, rangeDown, midiNote, sonar[i].distance); // voice/note configuration - Voice* v = &voices[i]; - v->octave = ((midiNote - midiNote % 12) / 12) - 1; - v->note = ((midiNote % 12) + 2) - 2; - v->volume = QUANTIZED_MODE_VELOCITY / 8; - if (v->volume > 15) v->volume = 15; - v->amp = amp[v->volume]; - v->freq = scale[v->note] >> (8 - (v->octave % 8)); + voices[i].octave = ((midiNote - midiNote % 12) / 12) - 1; + voices[i].note = ((midiNote % 12) + 2) - 2; + voices[i].volume = QUANTIZED_MODE_VELOCITY / 8; + if (voices[i].volume > 15) voices[i].volume = 15; + voices[i].amp = amp[voices[i].volume]; + voices[i].freq = scale[voices[i].note] >> (8 - (voices[i].octave % 8)); + } + } + if (playingMode == SAMPLES) { + for (int i = 0; i < NUM_SONARS; i++) { + if (sonar[i].distance < MIN_DISTANCE || sonar[i].distance > MAX_DISTANCE) { + RowOff(1); RowOff(2); RowOff(3); + ColumnsOff(); + previousSegment = 0; + continue; + } + + num_notes = 10; + rangeUp = ceil(sonar[i].distance * num_notes / MAX_DISTANCE); + rangeDown = ceil((sonar[i].distance + HYSTERESIS_IN_CM) * num_notes / MAX_DISTANCE); + if (rangeUp == rangeDown || abs(segment - previousSegment) >= noteJumpDistance) { + segment = rangeUp; + } + + voices[i].waveform = SAMPLE; + if (segment != previousSegment) { + if (segment == 2) { + serialDebug("kick\n"); + voices[i].sample = kick; + voices[i].sample_size = LEN(kick); + voices[i].sample_must_play = true; + } + if (segment == 3) { + serialDebug("hihat\n"); + voices[i].sample = hihat; + voices[i].sample_size = LEN(hihat); + voices[i].sample_must_play = true; + } + if (segment == 4) { + serialDebug("snare\n"); + voices[i].sample = snare; + voices[i].sample_size = LEN(snare); + voices[i].sample_must_play = true; + } + } + serialDebug("%.2d %.2d %.3d\n", segment, previousSegment, sonar[i].distance); + if (segment > 0) previousSegment = segment; + + // leds + ColumnsOff(); + if (segment >= 2 && segment <= 4) { + ledsBy10Segments(segment - 1); + } } } @@ -601,6 +661,9 @@ void loop() { quantizedModeScale = A_MAJOR; serialDebug("quantized - A major"); } else if (playingMode == QUANTIZED && quantizedModeScale == A_MAJOR) { + playingMode = SAMPLES; + serialDebug("samples"); + } else if (playingMode == SAMPLES) { playingMode = CONTINUOUS; serialDebug("continuous"); } @@ -621,44 +684,4 @@ void loop() { _delay_us(1); } - // cubeled debug, from cdrfiuba/pcbdesarrollo - /*if (nextBigTick) { - nextBigTick = false; - cubeled_state++; - if (cubeled_state == 1) { ColumnOn(1); - RowOff(2); RowOff(3); RowOn(1); - } else if (cubeled_state == 2) { ColumnOff(1); ColumnOn(2); - } else if (cubeled_state == 3) { ColumnOff(2); ColumnOn(3); - } else if (cubeled_state == 4) { ColumnOff(3); ColumnOn(6); - } else if (cubeled_state == 5) { ColumnOff(6); ColumnOn(5); - } else if (cubeled_state == 6) { ColumnOff(5); ColumnOn(4); - } else if (cubeled_state == 7) { ColumnOff(4); ColumnOn(7); - } else if (cubeled_state == 8) { ColumnOff(7); ColumnOn(8); - } else if (cubeled_state == 9) { ColumnOff(8); ColumnOn(9); - } else if (cubeled_state == 10) { RowOff(1); RowOn(2); - } else if (cubeled_state == 11) { ColumnOff(9); ColumnOn(8); - } else if (cubeled_state == 12) { ColumnOff(8); ColumnOn(7); - } else if (cubeled_state == 13) { ColumnOff(7); ColumnOn(4); - } else if (cubeled_state == 14) { ColumnOff(4); ColumnOn(5); - } else if (cubeled_state == 15) { ColumnOff(5); ColumnOn(6); - } else if (cubeled_state == 16) { ColumnOff(6); ColumnOn(3); - } else if (cubeled_state == 17) { ColumnOff(3); ColumnOn(2); - } else if (cubeled_state == 18) { ColumnOff(2); ColumnOn(1); - } else if (cubeled_state == 19) { RowOff(2); RowOn(3); - } else if (cubeled_state == 20) { ColumnOff(1); ColumnOn(2); - } else if (cubeled_state == 21) { ColumnOff(2); ColumnOn(3); - } else if (cubeled_state == 22) { ColumnOff(3); ColumnOn(6); - } else if (cubeled_state == 23) { ColumnOff(6); ColumnOn(5); - } else if (cubeled_state == 24) { ColumnOff(5); ColumnOn(4); - } else if (cubeled_state == 25) { ColumnOff(4); ColumnOn(7); - } else if (cubeled_state == 26) { ColumnOff(7); ColumnOn(8); - } else if (cubeled_state == 27) { ColumnOff(8); ColumnOn(9); - } else if (cubeled_state == 28) { RowOff(3); ColumnOff(9); - RowOn(2); ColumnOn(5); - } else if (cubeled_state == 29) { ColumnOff(5); - } else if (cubeled_state == 30) { - cubeled_state = 0; - } - }*/ - }