|
| 1 | +--- |
| 2 | +title: Blocks - Music |
| 3 | +impact: HIGH |
| 4 | +--- |
| 5 | + |
| 6 | +<!-- AUTO-GENERATED FILE. Do not edit manually. |
| 7 | +Edit packages/hikkaku/src/blocks and packages/skill/scripts/build-blocks.ts instead. --> |
| 8 | + |
| 9 | +# Music |
| 10 | + |
| 11 | +## playDrumForBeats(drum, beats) |
| 12 | + |
| 13 | +Plays drum for beats. |
| 14 | + |
| 15 | +Input: `drum`, `beats`. |
| 16 | + |
| 17 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 18 | + |
| 19 | +* `drum: See function signature for accepted input values` |
| 20 | +* `beats: See function signature for accepted input values` |
| 21 | + |
| 22 | +Example: |
| 23 | +```ts |
| 24 | +import { playDrumForBeats } from 'hikkaku/blocks' |
| 25 | + |
| 26 | +playDrumForBeats(1, 0.25) |
| 27 | +``` |
| 28 | + |
| 29 | +## midiPlayDrumForBeats(drum, beats) |
| 30 | + |
| 31 | +Plays drum for beats with MIDI drum mapping. |
| 32 | + |
| 33 | +Input: `drum`, `beats`. |
| 34 | + |
| 35 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 36 | + |
| 37 | +* `drum: See function signature for accepted input values` |
| 38 | +* `beats: See function signature for accepted input values` |
| 39 | + |
| 40 | +Example: |
| 41 | +```ts |
| 42 | +import { midiPlayDrumForBeats } from 'hikkaku/blocks' |
| 43 | + |
| 44 | +midiPlayDrumForBeats(36, 0.25) |
| 45 | +``` |
| 46 | + |
| 47 | +## restForBeats(beats) |
| 48 | + |
| 49 | +Rests for beats. |
| 50 | + |
| 51 | +Input: `beats`. |
| 52 | + |
| 53 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 54 | + |
| 55 | +* `beats: See function signature for accepted input values` |
| 56 | + |
| 57 | +Example: |
| 58 | +```ts |
| 59 | +import { restForBeats } from 'hikkaku/blocks' |
| 60 | + |
| 61 | +restForBeats(0.25) |
| 62 | +``` |
| 63 | + |
| 64 | +## playNoteForBeats(note, beats) |
| 65 | + |
| 66 | +Plays note for beats. |
| 67 | + |
| 68 | +Input: `note`, `beats`. |
| 69 | + |
| 70 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 71 | + |
| 72 | +* `note: See function signature for accepted input values` |
| 73 | +* `beats: See function signature for accepted input values` |
| 74 | + |
| 75 | +Example: |
| 76 | +```ts |
| 77 | +import { playNoteForBeats } from 'hikkaku/blocks' |
| 78 | + |
| 79 | +playNoteForBeats(60, 0.25) |
| 80 | +``` |
| 81 | + |
| 82 | +## setInstrument(instrument) |
| 83 | + |
| 84 | +Sets instrument. |
| 85 | + |
| 86 | +Input: `instrument`. |
| 87 | + |
| 88 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 89 | + |
| 90 | +* `instrument: See function signature for accepted input values` |
| 91 | + |
| 92 | +Example: |
| 93 | +```ts |
| 94 | +import { setInstrument } from 'hikkaku/blocks' |
| 95 | + |
| 96 | +setInstrument(1) |
| 97 | +``` |
| 98 | + |
| 99 | +## midiSetInstrument(instrument) |
| 100 | + |
| 101 | +Sets instrument with MIDI instrument mapping. |
| 102 | + |
| 103 | +Input: `instrument`. |
| 104 | + |
| 105 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 106 | + |
| 107 | +* `instrument: See function signature for accepted input values` |
| 108 | + |
| 109 | +Example: |
| 110 | +```ts |
| 111 | +import { midiSetInstrument } from 'hikkaku/blocks' |
| 112 | + |
| 113 | +midiSetInstrument(1) |
| 114 | +``` |
| 115 | + |
| 116 | +## setTempo(tempo) |
| 117 | + |
| 118 | +Sets tempo. |
| 119 | + |
| 120 | +Input: `tempo`. |
| 121 | + |
| 122 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 123 | + |
| 124 | +* `tempo: See function signature for accepted input values` |
| 125 | + |
| 126 | +Example: |
| 127 | +```ts |
| 128 | +import { setTempo } from 'hikkaku/blocks' |
| 129 | + |
| 130 | +setTempo(60) |
| 131 | +``` |
| 132 | + |
| 133 | +## changeTempo(tempo) |
| 134 | + |
| 135 | +Changes tempo. |
| 136 | + |
| 137 | +Input: `tempo`. |
| 138 | + |
| 139 | +Output: Scratch statement block definition that is appended to the current script stack. |
| 140 | + |
| 141 | +* `tempo: See function signature for accepted input values` |
| 142 | + |
| 143 | +Example: |
| 144 | +```ts |
| 145 | +import { changeTempo } from 'hikkaku/blocks' |
| 146 | + |
| 147 | +changeTempo(20) |
| 148 | +``` |
| 149 | + |
| 150 | +## getTempo() |
| 151 | + |
| 152 | +Returns tempo. |
| 153 | + |
| 154 | +Input: none. |
| 155 | + |
| 156 | +Output: Scratch reporter block definition that can be used as an input value in other blocks. |
| 157 | + |
| 158 | +Example: |
| 159 | +```ts |
| 160 | +import { getTempo } from 'hikkaku/blocks' |
| 161 | + |
| 162 | +getTempo() |
| 163 | +``` |
0 commit comments