-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDRUMBOT.F
executable file
·132 lines (109 loc) · 2.84 KB
/
DRUMBOT.F
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
\ $Workfile: drumbot.f $
\
\ the weird drummer guy
\
\ $Revision: 1.7 $
needs b0b b0b.f
ifndef __SYNTH110 needs __NU110 nu110.f
ifend
needs __DRUMS110 drums110.f
needs __VOLUME volume.f
Forth
ifdef __DRUMBOT forget __DRUMBOT
ifend
create __DRUMBOT .( loading drumbot.f ...) cr
variable Drumming
: Limb:
create ( n n n ... count -- ) \ each n is a note, x is the # of n's
dup c,
0 do c, loop
does> ( -- adr count )
count
;
bd2 bd4 2
Limb: lfoot \ 2 hollow bass drums
bd1 1
Limb: clubfoot \ the dead bass drum
ltt1 mtt1 htt1 3
Limb: tomhand \ some tom toms
rcl rcm rch 3
Limb: ridehand \ some ride cymbals
cch ccl 2
Limb: crashhand \ some crash cymbals
sd1 sd2 2
Limb: snarehand \ main snare drum
ltt3 mtt3 mtt3 htt3 bd3 5
Limb: rotohand \ rototoms
\ Syntax example: snarehand Hit
\ Hits one of the drums in the snarehand array
:ap Hit ( adr count -- )
?ChangeVolume
irnd + c@ $
;ap
\ Syntax example:
\ lfoot 1|2 64 Pound
\ Checks the lfoot every half note,,
\ and hits a random drum about 1 time in four (64/16)
\ If air is less than 17, it hits every time
:sg pulse ( rate -- )
begin Drumming @
while dup &
repeat drop
;sg
:ap Pound ( adr count rate air -- )
Drumming on
::ap [ 4 params ]
swap
::tsg ( rate -- )
[ 1 params ] pulse
;;sg
0 100 SetVolumeRange
begin Drumming @
while dup irnd 4 >> \ divide a copy of 'air' by 16
if brnd if pedon$
else pedoff$ \ two kinds of silence
then
else -rot \ tuck 'air'
2dup Hit \ Hit a drum
rot \ 'air' to top of stack
then
repeat
drop 2drop
;;ap
;ap
:ap Drumbot4
drumChannel drums /4
crashhand Hit
lfoot 1|4 0 Pound
clubfoot 128|129 0 Pound
crashhand 7|32 180 Pound
rest
snarehand 1|2 0 Pound
snarehand 64|129 0 Pound
rest
::ap 8192|129 time-advance
crashhand Hit
Drumming off
;;ap
;ap
:ap Drumbot5
drumChannel drums
clubfoot 1|4 22 Pound
lfoot 5|4 0 Pound
crashhand 7|19 200 Pound
2|4 time-advance
snarehand 5|4 0 Pound
snarehand 5|8 0 Pound
1|8 time-advance
snarehand 15|8 0 Pound
lfoot 5|8 0 Pound
ridehand 1|16 22 Pound
5|8 time-advance
snarehand 5|4 0 Pound
;ap
\ :ap SetDrumbot
\ formula
\ Techs.Band
\ drumChannel drums
\ 125 beats-per-minute
\ ;ap