-
Notifications
You must be signed in to change notification settings - Fork 1
/
OHM.F
executable file
·211 lines (191 loc) · 5.12 KB
/
OHM.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
\ $Workfile: ohm.f $
\ $Revision: 1.4 $
\ $Log: B:/formula/vcs/ohm.f_v $
\
\ Rev 1.4 27 Dec 1990 16:46:06 b0b
\ Put ?delay back in (oops).
\ Adjusted volumes and made a recording with new "Ohm2" patch.
\
\ Rev 1.3 04 Nov 1990 10:19:32 b0b
\ implemented __NAME convention for file labels
\
\ Rev 1.2 03 Sep 1990 18:36:06 b0b
\ Code to adjust volume pulled out into its own module, volume.f
\
\ Rev 1.1 03 Sep 1990 12:30:16 b0b
\ Added $minvol and $maxvol pquans to better control balance
\ Added PVCS header comment
needs b0b b0b.f
needs __SYNTH110 synth110.f
needs __VOLUME volume.f
Forth
ifdef __OHM forget __OHM
ifend
create __OHM .( loading ohm.f...) cr
\ the "Church" patch is assigned to P-59 on my U-110:
\ PART 1 2 3 4 5 6
\ MODE L8 R8 11 4 4 4 (Mode #45)
\ bell.1 e.organ.3 a.piano.1 choir.1 choir.1 choir.1
quan ChurchSynth
quan BellChannel
quan OrganChannel
quan PianoChannel
quan CenterChoir
quan LeftChoir
quan RightChoir
: config-church-synth
declare-synth to ChurchSynth
0 U-110 ['] generic-MIDI-driver 5 declare-channel to BellChannel
1 U-110 ['] generic-MIDI-driver 3 declare-channel to OrganChannel
2 U-110 ['] generic-MIDI-driver 11 declare-channel to PianoChannel
3 U-110 ['] generic-MIDI-driver 4 declare-channel to CenterChoir
4 U-110 ['] generic-MIDI-driver 4 declare-channel to LeftChoir
5 U-110 ['] generic-MIDI-driver 4 declare-channel to RightChoir
U-CTRL
U-110 ['] generic-MIDI-driver 0 declare-channel drop
;
: select-church-synth
$DSM \ use dumb synth manager
BellChannel to $channel \ bell channel
58 U-CTRL mpc ; \ Patch #59
formula config-church-synth
:ap ?delay
brnd
if 1 64 irnd 55 + r>i time-advance
then
;ap
pquan curtime
quan finished
quan #done
:ap ?time.change
19 irnd 0=
if $channel PianoChannel =
if 7 irnd
else curtime 1+ dup to curtime
then
case 0 of /6 endof
1 of /32 endof
2 of /16 endof
3 of /12 endof
4 of /8 endof
5 of /6 endof
6 of /4 endof
7 of /2 endof
/1
#done 1+ to #done
#done 8 > to finished
endcase
then
;ap
:ap vocalrange ( n -- n' )
dup 43 < over 76 > or
if drop 0 aps
then
;ap
:ap major.ending
0 aps dup dup brnd
if 4 + swap 7 +
else 5 - swap 8 -
then
/4 $3
;ap
:ap choir.loop ( n -- )
begin
finished not
while
?time.change
?ChangeVolume
3 irnd
case 0 of +ps vocalrange
endof
1 of -ps vocalrange
endof
2 of 0 +nps
endof
endcase
2 irnd 2+
brnd if +nps
else -nps
then
vocalrange
$2
?delay
repeat
major.ending
;ap
:ap organrange ( n -- n' )
dup 40 < over 80 > or
if drop 0 aps
then
;ap
:ap organ.loop
begin
finished not
while
?time.change
?ChangeVolume
brnd
if +ps vocalrange
2 irnd 2+ +nps organrange
2 irnd 2+ +nps organrange
else -ps vocalrange
2 irnd 2+ -nps organrange
2 irnd 2+ -nps organrange
then
$3
?delay
repeat
major.ending
;ap
:ap Ohm
select-church-synth
false to finished
now 1+ rot 1+ rot 1+ * * rndinit
0 to #done
." Type 'done!' for premature finish. "
g just
30 beats-per-minute
::ap BellChannel to $channel
70 100 SetVolumeRange
c majorscale set-ps
1|2 time-advance
1 to curtime /6
organ.loop
major.ending
;;ap
::ap BellChannel to $channel
50 70 SetVolumeRange
g majorscale set-ps
1 to curtime /6
?delay choir.loop
major.ending
;;ap
::ap PianoChannel to $channel
65 120 SetVolumeRange
f majorscale set-ps
?delay /12 choir.loop
;;ap
::ap CenterChoir to $channel
55 95 SetVolumeRange
c majorscale set-ps
1 to curtime /6
choir.loop
;;ap
::ap LeftChoir to $channel
50 100 SetVolumeRange
e minorscale set-ps
?delay ?delay
0 to curtime /12
choir.loop
;;ap
::ap RightChoir to $channel
50 100 SetVolumeRange
a minorscale set-ps
?delay ?delay
0 to curtime /12
choir.loop
;;ap
;ap
:ap Done!
true to finished
;ap