Skip to content

Commit 74de48b

Browse files
committed
music block
1 parent 18c01f6 commit 74de48b

8 files changed

Lines changed: 552 additions & 0 deletions

File tree

docs/reference/blocks/music.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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+
```

docs/reference/blocks/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { add, gotoXY } from 'hikkaku/blocks'
3030
- [Data](/reference/blocks/data)
3131
- [Events](/reference/blocks/events)
3232
- [Looks](/reference/blocks/looks)
33+
- [Music](/reference/blocks/music)
3334
- [Motion](/reference/blocks/motion)
3435
- [Operator](/reference/blocks/operator)
3536
- [Procedures](/reference/blocks/procedures)

docs/reference/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Use this section when you need exact block helper signatures and behavior.
99
- [Data](/reference/blocks/data)
1010
- [Events](/reference/blocks/events)
1111
- [Looks](/reference/blocks/looks)
12+
- [Music](/reference/blocks/music)
1213
- [Motion](/reference/blocks/motion)
1314
- [Operators](/reference/blocks/operator)
1415
- [Pen](/reference/blocks/pen)

packages/hikkaku/src/blocks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from './data'
33
export * from './events'
44
export * from './looks'
55
export * from './motion'
6+
export * from './music'
67
export * from './operator'
78
export * from './pen'
89
export * from './procedures'

0 commit comments

Comments
 (0)