-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstrument.go
68 lines (64 loc) · 1.5 KB
/
instrument.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package nbs
import (
"github.com/df-mc/dragonfly/server/world/sound"
"strconv"
)
// Instrument is one of the instruments supported through the NBS format.
type Instrument int
// instrument converts an Instrument to its representation in Dragonfly.
func (i Instrument) instrument() sound.Instrument {
switch i {
case InstrumentHarp:
return sound.Piano()
case InstrumentBass:
return sound.Bass()
case InstrumentBassDrum:
return sound.BassDrum()
case InstrumentSnare:
return sound.Snare()
case InstrumentHat:
return sound.ClicksAndSticks()
case InstrumentGuitar:
return sound.Guitar()
case InstrumentFlute:
return sound.Flute()
case InstrumentBell:
return sound.Bell()
case InstrumentChime:
return sound.Chimes()
case InstrumentXylophone:
return sound.Xylophone()
case InstrumentIronXylophone:
return sound.IronXylophone()
case InstrumentCowBell:
return sound.CowBell()
case InstrumentDidgeridoo:
return sound.Didgeridoo()
case InstrumentBit:
return sound.Bit()
case InstrumentBanjo:
return sound.Banjo()
case InstrumentPling:
return sound.Pling()
}
panic("unsupported instrument type " + strconv.Itoa(int(i)))
}
// The following are all supported NBS instruments.
const (
InstrumentHarp Instrument = iota
InstrumentBass
InstrumentBassDrum
InstrumentSnare
InstrumentHat
InstrumentGuitar
InstrumentFlute
InstrumentBell
InstrumentChime
InstrumentXylophone
InstrumentIronXylophone
InstrumentCowBell
InstrumentDidgeridoo
InstrumentBit
InstrumentBanjo
InstrumentPling
)