-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmidi3.ino
729 lines (585 loc) · 19.3 KB
/
midi3.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
#include <Arduino.h>
#include <SPI.h>
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2017 Lexigraph, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software,
// electronic circuit designs and schematics, hardware designs, images and associated documentation
// files (the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so, subject to the
// following conditions: The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// common1.cpp
//
// Created: 08/12/2017
// Original code adapted from: https://github.com/jgeisler0303/QTouchADCArduino
// Author : trk - Converted to Atmel Studio and added support for 328P and 32u4
// BLE: http://www.raytac.com/products.php?subid=57
//
// trk - 09/03/2017 - Cleaned output output to supply full power, added this comment.
//
// trk - 09/09/2017 - Added support for Arduino IDE. Reparamaterized for multi-platform build.
// Added support for multiple 32u4 parts.
// Reorganized adc support for initialization.
// Added temporary max limit on power output.
//
// defines the 32u4 in AVR: __AVR_ATmega32U4__
// Select the part/configuration you need below
//
#if 0
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ARDUINO MICRO PRO
// Micro Pro is defined by SparkFun
// https://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/Pro-Micro-v10.pdf
//
#define ARDUINO_MICRO_PRO (1)
#define PLATFORM (ARDUINO_MICRO_PRO)
#endif // 0
#if 1
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ARDUINO MICRO
// Arduino Micro is a discontinued standard Arduino part
// https://www.arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
//
#define ARDUINO_MICRO (1)
#define PLATFORM (ARDUINO_MICRO)
#define ATMEL_STUDIO (1)
#endif // 1
////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define F_CPU 16000000L // Specify oscillator frequency
#if defined(ATMEL_STUDIO)
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdbool.h>
#include <util/delay.h>
#else
// Atmel conveniences
//
#define _BV(x) (0x1 << (x))
#endif // defined(ATMEL_STUDIO)
#if defined(PLATFORM) && defined(ARDUINO_MICRO_PRO)
// Arduino Micro Pro Pin #9 on circuit board which is Atmel PB#5
#define PWM_PIN (5)
#define PWM_DDR DDRB
#define PWM_PORT PORTB
l
#define SLIDER_PIN (4)
#define SLIDER_DDR DDRF
#define SLIDER_PORT PORTF
#define TOUCH_DDR DDRF
#define TOUCH_PORT PORTF
#define TOUCH_PIN1 (6) // Pin # connected to touch in TOUCH_DDR/PORT
#define TOUCH_PIN2 (7) // this is currently only used as a supply of Vcc to charge the s&h cap
#elif defined(PLATFORM) && defined(ARDUINO_MICRO)
// Arduino Micro Pin #9 on circuit board which is Atmel PB#5
#define PWM_PIN (5)
#define PWM_DDR DDRB
#define PWM_PORT PORTB
#define SLIDER_PIN (7)
#define SLIDER_DDR DDRF
#define SLIDER_PORT PORTF
#define TOUCH_DDR DDRF
#define TOUCH_PORT PORTF
#define TOUCH_PIN1 (0) // Pin # connected to touch in TOUCH_DDR/PORT
#define TOUCH_PIN2 (1) // this is currently only used as a supply of Vcc to charge the s&h cap
#else
#error "No PWM_PIN defined because no PLATFORM is defiend...."
#endif // defined(PLATFORM)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define PWM_OFF_TRISTATE (1)
#define PWM_ENABLED (0)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ADC constants
#define ADMUX_MASK 0xF // mask the mux bits in the ADMUX register
#define MUX_GND 0xF // mux value for connecting the ADC unit internally to GND
#define MUX_REF_VCC 0x40 // value to set the ADC reference to Vcc
#define CHARGE_DELAY (5) // time it takes for the capacitor to get charged/discharged in microseconds
#define TRANSFER_DELAY (5) // time it takes for the capacitors to exchange charge
#define TOUCH_VALUE_BASELINE (-165) // this is the value my setup measures when the probe is not touched.
// For your setup this might be different.
#define TOUCH_VALUE_SCALE (5) // Limit touch range to 0..31
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void pwmSetState(uint8_t tristate)
{
TCCR1A = _BV(COM1A1) | _BV(WGM10);
if (tristate)
{
PWM_DDR &= ~_BV(PWM_PIN); // set mode input
PWM_PORT &= ~_BV(PWM_PIN); // disable pullups - effectively now in tri-state
TCCR1B = _BV(WGM12); // 0 from CS10..CS12 which disables timer.
OCR1A = 0;
// Tri-state mode relies on the 15K ohm resistor on MOSFET gate
// to completely shut off the MOSFET. Better than having the
// processor be the only means to shut it off.
}
else
{
PWM_DDR |= _BV(PWM_PIN);
PWM_PORT |= _BV(PWM_PIN); // enable pullups
// There are quite a number of PWM modes available but for the
// sake of simplicity we'll just use the 8-bit Fast PWM mode.
// This is done by setting the WGM10 and WGM12 bits. We
// Setting COM1A1 tells the microcontroller to set the
// output of the OCR1A pin low when the timer's counter reaches
// a compare value (which will be explained below).
//
// TCCR1B using _BV(CS10+CS12) defines the frequency of the PWM
// CS10, CS11, CS12 define three bits used to set a value from 0 => OFF,
// to 0x5 maximum clock division (slowest PWM output frequence). 0x1 =>
// least amount of division hence the fastest PWM
//
// NOTE: Using |= and &= here work on Atmel Studio but not Arduino IDE.
// Probably the AVR runtime is somewhat different in terms of reseting.
//
TCCR1B = _BV(WGM12) | _BV(CS10+CS12) ;
}
}
void pwmOut(int8_t pwmv)
{
// Fire OCRA with a value 0..255
//
OCR1A = pwmv;
}
// Generic adc reader. Not used for touch.
//
uint16_t adcRead(uint8_t adcx)
{
// adcx is the analog pin we want to use. ADMUX's first few bits are
// the binary representations of the numbers of the pins so we can
// just 'OR' the pin's number with ADMUX to select that pin.
// We first zero the four bits by setting ADMUX equal to its higher
// four bits.
//
ADMUX = (ADMUX & 0xf8) | (adcx & 0x7);
// This starts the conversion.
//
ADCSRA |= _BV(ADSC);
// This is an idle loop that just wait around until the conversion
// is finished. It constantly checks ADCSRA's ADSC bit, which we just
// set above, to see if it is still set. This bit is automatically
// reset (zeroed) when the conversion is ready so if we do this in
// a loop the loop will just go until the conversion is ready.
//
while ( (ADCSRA & _BV(ADSC)) );
// Finally, we return the converted value to the calling function.
//
return ADC;
}
// Common setup for both touch and regular adc.
//
// Note - set all pins on SLIDER_DDR so that this must be called first.
// Otherwise subsequent calls touching SLIDER_DDR/PORT will get lost.
//
void adcSetup(uint8_t adcx)
{
// from: http://www.elecrom.com/avr-tutorial-2-avr-input-output/
//
SLIDER_DDR = ~_BV(adcx); // Setup to input
SLIDER_PORT = ~_BV(adcx); // Go into tri-state mode
// from: http://maxembedded.com/2011/06/the-adc-of-the-avr/
// AREF = AVcc
ADMUX = _BV(REFS0);
// ADC Enable and prescaler of 128
// 16000000/16 = 250K
//
// NOTE: Need to decide if the scaler here is the best choice.
//
ADCSRA = _BV(ADEN) | _BV(ADPS2) | _BV(ADPS1) ;
ADCSRB = 0x0 ;
}
// Return a touch value from the adc. Used to discriminate between
// capacitor differences when a touch is present.
//
uint16_t touchProbe(uint8_t pin, uint8_t partner, bool dir)
{
uint8_t mask;
mask = _BV(pin) | _BV(partner);
// config pins as push-pull output
//
TOUCH_DDR |= mask;
if (dir)
{
// set partner high to charge the s&h cap and pin low to discharge touch probe cap
//
TOUCH_PORT = (TOUCH_PORT & ~_BV(pin)) | _BV(partner);
}
else
{
// set pin high to charge the touch probe and pin low to discharge s&h cap cap
//
TOUCH_PORT = (PORTF & ~_BV(partner)) | _BV(pin);
}
// charge/discharge s&h cap by connecting it to partner
//
ADMUX = MUX_REF_VCC | partner; // select partner as input to the ADC unit
_delay_ms(CHARGE_DELAY); // wait for the touch probe and the s&h cap to be fully charged/dsicharged
TOUCH_DDR &= ~mask; // config pins as input
TOUCH_PORT &= ~mask; // disable the internal pullup to make the ports high Z
// connect touch probe cap to s&h cap to transfer the charge
//
ADMUX = MUX_REF_VCC | pin; // select pin as ADC input
_delay_ms(TRANSFER_DELAY); // wait for charge to be transfered
ADCSRA |= _BV(ADSC); // start measurement
while ( (ADCSRA & _BV(ADSC)) ); // wait for measurement to complete
return ADC; // return conversion result
}
uint16_t adc1, adc2; // store the average of the charge resp. discharge measurement
int touchProbeVal; // store the resulting touch measurement
// Sample current touch. Return 0..31. The higher the value the more "certain" there is a touch.
//
uint8_t probeTouch(void)
{
int i;
int16_t idx;
// 4 measurements are taken and averaged to improve noise immunity
//
for (i = 0; i < 4; i++)
{
// first measurement: charge touch probe, discharge ADC s&h cap, connect the two, measure the voltage
//
adc1 += touchProbe(TOUCH_PIN1, TOUCH_PIN2, false); // accumulate the results for the averaging
// second measurement: discharge touch probe, charge ADC s&h cap, connect the two, measure the voltage
//
adc2 += touchProbe(TOUCH_PIN1, TOUCH_PIN2, true); // accumulate the results for the averaging
}
adc1 >>= 2; // divide the accumulated measurements by 16
adc2 >>= 2;
// the value of adc1 (probe charged) gets higher when the probe its touched, the value of adc2
// (s&h charged) gets lower when the probe is touched, so, it has to be be subtracted to amplify
// the detection accuracy
//
touchProbeVal = adc1 - adc2;
// normalize to a range of 0..31
//
idx = (touchProbeVal - TOUCH_VALUE_BASELINE); // offset probe_val by value of untouched probe
if (idx < 0)
{
idx= 0; // limit the index!!!
}
idx /= TOUCH_VALUE_SCALE; // scale the index
if (idx > 31)
{
idx= 31; // limit the index!!!
}
adc1 = 0; // clear the averaging variables for the next run
adc2 = 0;
return idx; // 0..31
}
uint8_t outputEnabled; // Holds state of MOSFET control.
// You may or may not need to include this depending on your platform
// Include this for the 32u4, exclude it for the M0 for example
//#include <SoftwareSerial.h>
#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"
#include "Adafruit_BluefruitLE_UART.h"
#include "Adafruit_BLEMIDI.h"
#include "BluefruitConfig.h"
//#define SERIALDBG (1)
#define FACTORYRESET_ENABLE 1
#define MINIMUM_FIRMWARE_VERSION "0.7.0"
// This app was tested on iOS with the following apps:
//
// https://itunes.apple.com/us/app/midimittr/id925495245?mt=8
// https://itunes.apple.com/us/app/igrand-piano-free-for-ipad/id562914032?mt=8
//
// To test:
// - Run this sketch and open the Serial Monitor
// - Open the iGrand Piano Free app
// - Open the midimittr app on your phone and under Clients select "Adafruit Bluefruit LE"
// - When you see the 'Connected' label switch to the Routing panel
// - Set the Destination to 'iGrand Piano'
// - Switch to the iGrand Piano Free app and you should see notes playing one by one
// Create the bluefruit object, either software serial...uncomment these lines
/*
SoftwareSerial bluefruitSS = SoftwareSerial(BLUEFRUIT_SWUART_TXD_PIN, BLUEFRUIT_SWUART_RXD_PIN);
Adafruit_BluefruitLE_UART ble(bluefruitSS, BLUEFRUIT_UART_MODE_PIN,
BLUEFRUIT_UART_CTS_PIN, BLUEFRUIT_UART_RTS_PIN);
*/
/* ...or hardware serial, which does not need the RTS/CTS pins. Uncomment this line */
// Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);
/* ...hardware SPI, using SCK/MOSI/MISO hardware SPI pins and then user selected CS/IRQ/RST */
Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
/* ...software SPI, using SCK/MOSI/MISO user-defined SPI pins and then user selected CS/IRQ/RST */
//Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_SCK, BLUEFRUIT_SPI_MISO,
// BLUEFRUIT_SPI_MOSI, BLUEFRUIT_SPI_CS,
// BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
Adafruit_BLEMIDI midi(ble);
bool isConnected = false;
int current_note = 60;
// A small helper
void error(const __FlashStringHelper*err) {
#if defined(SERIALDBG)
Serial.println(err);
#endif
while (1);
}
// callback
void connected(void)
{
isConnected = true;
#if defined(SERIALDBG)
Serial.println(F(" CONNECTED!"));
#endif
delay(100);
}
void disconnected(void)
{
#if defined(SERIALDBG)
Serial.println("disconnected");
#endif
isConnected = false;
}
bool cmdMode = false;
int cmdState = 0;
void BleMidiRX(uint16_t timestamp, uint8_t status, uint8_t byte1, uint8_t byte2)
{
#if defined(SERIALDBG)
Serial.print("[MIDI ");
Serial.print(timestamp);
Serial.print(" ] ");
Serial.print(status, HEX); Serial.print(" ");
Serial.print(byte1 , HEX); Serial.print(" ");
Serial.print(byte2 , HEX); Serial.print(" ");
Serial.print(cmdState , HEX); Serial.print(" ");
Serial.print(cmdMode? 1: 0 , HEX); Serial.print(" ");
Serial.println();
#endif
if (status != 0x90) // chan 1
return;
switch (cmdState)
{
case 0:
if (byte1 == 0x4F)
{
if (byte2 == 0) cmdState++;
}
else
{
cmdState = 0;
cmdMode = false;
}
break;
case 1:
if (byte1 == 0x51)
{
if (byte2 == 0) cmdState++;
}
else
{
cmdState = 0;
cmdMode = false;
}
break;
case 2:
if (byte1 == 0x4D)
{
if (byte2 == 0) cmdState++;
}
else
{
cmdState = 0;
cmdMode = false;
}
break;
case 3:
if (byte1 == 0x41)
{
if (byte2 == 0) cmdState++;
}
else
{
cmdState = 0;
cmdMode = false;
}
break;
case 4:
if (byte1 == 0x48)
{
if (byte2 == 0)
{
cmdMode = !cmdMode;
cmdState = 0;
}
}
else
{
cmdState = 0;
cmdMode = false;
}
break;
default:
cmdState = 0;
cmdMode = false;
break;
}
#if defined(SERIALDBG)
Serial.print(cmdState , HEX); Serial.print(" ");
Serial.print(cmdMode? 1: 0 , HEX); Serial.print(" ");
Serial.println();
#endif
digitalWrite(LED_BUILTIN, cmdMode? (byte2 != 0? LOW : HIGH) : (byte2 != 0? HIGH : LOW));
}
void PWMsetup()
{
outputEnabled = 0;
adc1 = 0;
adc2 = 0;
// Call first... Setup is for both just adc reads in general and for touch.
//
adcSetup(SLIDER_PIN);
adcRead(SLIDER_PIN);
pwmSetState(PWM_OFF_TRISTATE);
}
void setup(void)
{
pinMode(LED_BUILTIN, OUTPUT);
PWMsetup();
#if defined(SERIALDBG)
while (!Serial); // required for Flora & Micro
delay(500);
Serial.begin(115200);
Serial.println(F("Adafruit Bluefruit MIDI Example"));
Serial.println(F("---------------------------------------"));
/* Initialise the module */
Serial.print(F("Initialising the Bluefruit LE module: "));
#endif
if ( !ble.begin(VERBOSE_MODE) )
{
error(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
}
#if defined(SERIALDBG)
Serial.println( F("OK!") );
#endif
if ( FACTORYRESET_ENABLE )
{
/* Perform a factory reset to make sure everything is in a known state */
#if defined(SERIALDBG)
Serial.println(F("Performing a factory reset: "));
#endif
if ( ! ble.factoryReset() ) {
error(F("Couldn't factory reset"));
}
}
//ble.sendCommandCheckOK(F("AT+uartflow=off"));
ble.echo(false);
#if defined(SERIALDBG)
Serial.println("Requesting Bluefruit info:");
/* Print Bluefruit information */
ble.info();
#endif
/* Set BLE callbacks */
ble.setConnectCallback(connected);
ble.setDisconnectCallback(disconnected);
// Set MIDI RX callback
midi.setRxCallback(BleMidiRX);
#if defined(SERIALDBG)
Serial.println(F("Enable MIDI: "));
#endif
if ( ! midi.begin(true) )
{
error(F("Could not enable MIDI"));
}
ble.verbose(false);
#if defined(SERIALDBG)
Serial.print(F("Waiting for a connection..."));
#endif
}
void PWMloop()
{
uint16_t adcv;
// Wait until touch says we have something more than noise.
//
if (probeTouch() > 25)
{
adcv = 0;
// Two samples and average...
//
adcv += adcRead(SLIDER_PIN) & 0x3FF;
adcv += adcRead(SLIDER_PIN) & 0x3FF;
adcv = adcv / 2;
// Squash down to 0..255 and clamp
//
adcv = 0xFF & (adcv >> 2);
// Check that we have at least some significant bits.
// Fire if we do...
//
if ((adcv & 0xF8) > 0)
{
if (!outputEnabled)
{
pwmSetState(PWM_ENABLED);
outputEnabled = 1;
}
adcv = 0xFF & adcv;
// Limit to 300W at max power at .12 ohms for now...
//
if (adcv > 190)
{
adcv = 190;
}
pwmOut(adcv);
}
else
{
// Drop into tri-state and disable PWM.
// In tri-state the 15K resistor will shut down the MOSFET.
//
if (outputEnabled)
{
pwmSetState(PWM_OFF_TRISTATE);
outputEnabled = 0;
}
}
}
else
{
// No touch, shutdown as above.
//
if (outputEnabled)
{
pwmSetState(PWM_OFF_TRISTATE);
outputEnabled = 0;
}
}
_delay_ms(50); // take 20 measurements per second
}
void loop(void)
{
// interval for each scanning ~ 500ms (non blocking)
ble.update(100);
// bail if not connected
//if (! isConnected)
// return;
if (!cmdMode)
{
PWMloop();
}
/*
Serial.print("Sending pitch ");
Serial.println(current_note, HEX);
// send note on
midi.send(0x90, current_note, 0x64);
delay(500);
// send note off
midi.send(0x80, current_note, 0x64);
delay(500);
// increment note pitch
current_note++;
// only do one octave
if(current_note > 72)
current_note = 60;
*/
}