play_note determines which pad was 'hit' and send the play request to fluidsynth
(note)
| 86 | |
| 87 | |
| 88 | def play_note(note): |
| 89 | """play_note determines which pad was 'hit' and send the |
| 90 | play request to fluidsynth""" |
| 91 | |
| 92 | index = None |
| 93 | if note == Note("B", 2): |
| 94 | index = 0 |
| 95 | elif note == Note("A", 2): |
| 96 | index = 1 |
| 97 | elif note == Note("G", 2): |
| 98 | index = 2 |
| 99 | elif note == Note("E", 2): |
| 100 | index = 3 |
| 101 | elif note == Note("C", 2): |
| 102 | index = 4 |
| 103 | elif note == Note("A", 3): |
| 104 | index = 5 |
| 105 | elif note == Note("B", 3): |
| 106 | index = 6 |
| 107 | elif note == Note("A#", 2): |
| 108 | index = 7 |
| 109 | elif note == Note("G#", 2): |
| 110 | index = 8 |
| 111 | if index != None and status == "record": |
| 112 | playing.append([index, tick]) |
| 113 | recorded.append([index, tick, note]) |
| 114 | recorded_buffer.append([index, tick]) |
| 115 | fluidsynth.play_Note(note, 9, 100) |
| 116 | |
| 117 | |
| 118 | tick = 0.0 |
no test coverage detected