pxt-midi/tests.ts

13 строки
401 B
TypeScript
Исходник Постоянная ссылка Обычный вид История

2017-04-22 09:19:58 +03:00
// tests go here; this will not be compiled when this package is used as a library
2017-04-23 15:27:48 +03:00
midi.playTone(400, 500);
2017-04-23 06:13:43 +03:00
for (let i = 0; i < 127; ++i)
2017-04-23 15:27:48 +03:00
midi.playDrum(i)
2017-04-24 08:40:45 +03:00
let i = midi.channel(1);
2017-04-23 15:27:48 +03:00
i.setInstrument(MidiInstrument.Banjo);
2017-04-24 08:40:45 +03:00
let piano = midi.channel(0);
let trumpet = midi.channel(1);
2017-04-23 15:27:48 +03:00
piano.setInstrument(MidiInstrument.Trumpet);
2018-10-02 23:34:22 +03:00
serial.writeLine('B ' + Note.B + ' -> ' + midi.frequencyToKey(Note.B))