Skip to content

Commit 237d479

Browse files
committed
Update readme
1 parent 4b9bf0e commit 237d479

1 file changed

Lines changed: 45 additions & 28 deletions

File tree

README.md

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Gong
2+
13
## Introduction
24

35
gong is a small multitrack MIDI control language. It consists of a shell with live mode, player and a linter.
@@ -16,57 +18,54 @@ go install github.com/mgnsk/gong/cmd/gong@latest # Requires rtmidi development p
1618
- The default command lists the available MIDI ports. The default port is the 0 port.
1719

1820
```sh
19-
$ gong
20-
0: Midi Through:Midi Through Port-0 14:0
21-
1: Hydrogen:Hydrogen Midi-In 135:0
22-
2: VMPK Input:in 128:0
21+
$ gong
22+
0: Midi Through:Midi Through Port-0 14:0
23+
1: Hydrogen:Hydrogen Midi-In 135:0
24+
2: VMPK Input:in 128:0
2325
```
2426

2527
- Play a file through a specific port. The port name must contain the passed in flag value:
2628

2729
```sh
28-
$ gong play --port "VMPK" examples/bach
30+
gong play --port "VMPK" examples/bach
2931
```
3032

3133
To use piped input, pass `-` as the argument:
3234

3335
```sh
34-
$ cat examples/bach | gong play --port "VMPK" -
36+
cat examples/bach | gong play --port "VMPK" -
3537
```
3638

3739
- Port can also be specified by its number:
3840

3941
```sh
40-
$ gong play --port 2 examples/bonham
42+
gong play --port 2 examples/bonham
4143
```
4244

4345
- Enter a shell on the default port:
4446

4547
```sh
46-
$ gong shell
47-
>>>
48+
gong shell
4849
```
4950

5051
A shell is a text shell for the gong language. It is capable of multiline input when entering bars.
5152

5253
- Enter a shell on a specific port:
5354

5455
```sh
55-
$ gong shell --port "Hydrogen"
56-
>>>
56+
gong shell --port "Hydrogen"
5757
```
5858

5959
- Load a file and enter a shell:
6060

6161
```sh
62-
$ gong load --port "Hydrogen" examples/bonham
63-
>>>
62+
gong load --port "Hydrogen" examples/bonham
6463
```
6564

6665
- Enter live mode by entering the `live` command (TODO):
6766

6867
```sh
69-
$ gong live --port "Hydrogen" examples/live_drumset
68+
gong live --port "Hydrogen" examples/live_drumset
7069
```
7170

7271
Live mode is an unbuffered input mode in the shell. Whenever an assigned key is pressed,
@@ -75,13 +74,13 @@ a note on message is sent to the port.
7574
- Lint a file:
7675

7776
```sh
78-
$ gong lint examples/bonham
77+
gong lint examples/bonham
7978
```
8079

8180
- Help.
8281

8382
```sh
84-
> gong --help
83+
$ gong --help
8584
gong is a MIDI control language and interpreter.
8685

8786
Usage:
@@ -92,6 +91,7 @@ Available Commands:
9291
completion Generate the autocompletion script for the specified shell
9392
help Help about any command
9493
lint Lint a file
94+
live Load a file and continue in a live shell
9595
load Load a file and continue in a gong shell
9696
play Play a file
9797
shell Run a gong shell
@@ -105,13 +105,16 @@ Use " [command] --help" for more information about a command.
105105
## Syntax
106106

107107
The language consists of commands and note lists.
108-
The commands tempo, program, control, start and stop are global commands. The commands timesig, velocity and channel are local (when used in bars). TODO: make the distinction that global commands are like global functions and local commands are like local variables.
108+
The commands tempo, program, control, start and stop are global commands.
109+
The commands timesig, velocity and channel, when used in bars, are local to bars.
110+
111+
- ### Comments
109112

110-
- #### Comments
111113
```
112114
// This is a line comment.
113115
```
114-
- #### Commands
116+
117+
- ### Commands
115118

116119
```
117120
// Assign a note.
@@ -142,17 +145,22 @@ The commands tempo, program, control, start and stop are global commands. The co
142145
control 1 127
143146
```
144147

145-
- #### Note assignment
148+
- ### Note assignment
149+
146150
Assign a MIDI note number to a note letter.
151+
147152
```
148153
// Kick drum (on the drum channel).
149154
assign k 36
150155
// Middle C (on other channels).
151156
assign c 60
152157
```
153-
- #### Notes
158+
159+
- ### Notes
160+
154161
Notes are written as a letter symbol (must be assigned first) plus properties.
155162
The available properties are
163+
156164
- sharp (`#`)
157165
- flat (`$`)
158166
- accentuated (`^`)
@@ -161,7 +169,9 @@ The commands tempo, program, control, start and stop are global commands. The co
161169
- dot (`.`)
162170
- tuplet (`/3`) (The number in the tuplet specifies the divison, for example a quintuplet `/5`)
163171
- let ring (`*`)
164-
- #### Note values
172+
173+
- ### Note values
174+
165175
```
166176
// Whole note.
167177
x1
@@ -177,14 +187,18 @@ The commands tempo, program, control, start and stop are global commands. The co
177187
x32
178188
// And so on...
179189
```
190+
180191
- ### Rests
192+
181193
```
182194
// A quarter rest.
183195
-
184196
// An 8th rest.
185197
-8
186198
```
187-
- #### Dotted notes and tuplets
199+
200+
- ### Dotted notes and tuplets
201+
188202
```
189203
// Dotted quarter note.
190204
x.
@@ -199,7 +213,9 @@ The commands tempo, program, control, start and stop are global commands. The co
199213
// Dotted 8th quintuplet note.
200214
x8./5
201215
```
202-
- #### Flat and sharp notes.
216+
217+
- ### Flat and sharp notes
218+
203219
```
204220
// A note.
205221
c
@@ -208,7 +224,8 @@ The commands tempo, program, control, start and stop are global commands. The co
208224
// A flat note (MIDI note number - 1).
209225
c$
210226
```
211-
- #### Note grouping
227+
228+
- ### Note grouping
212229

213230
Notes can be arbitrarily grouped and properties applied to multiple notes at once.
214231

@@ -229,7 +246,7 @@ The commands tempo, program, control, start and stop are global commands. The co
229246
f8 c8 g8 f#8 c#8 g#8
230247
```
231248

232-
- #### Bars
249+
- ### Bars
233250

234251
Bars are used to specify multiple tracks playing at once.
235252
Only `timesig`, `velocity` and `channel` are scoped to the bar.
@@ -263,7 +280,7 @@ The commands tempo, program, control, start and stop are global commands. The co
263280
The file is included in the `examples` directory. To play into the default port, run
264281

265282
```sh
266-
$ gong play examples/bonham
283+
gong play examples/bonham
267284
```
268285

269286
```
@@ -333,7 +350,7 @@ play "fill"
333350
The file is included in the `examples` directory. To play into the default port, run
334351

335352
```sh
336-
$ gong play examples/bach
353+
gong play examples/bach
337354
```
338355

339356
It is possible to write melodies using gong in a limited way. Here's 2 bars of Bach:

0 commit comments

Comments
 (0)