«Gabun/Bavaria» by codepool

on 27 Apr'17 22:10 in bengmouth harp

Migration from the old SourceForge wiki.

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
/*
all the patterns are just approximations, not part of 'real' songs.
Licenced under Creative Commons 'some rights reserved'
Julian Rohrhuber (jrh) 2002 / 2005
*/

// A simulation of a Beng (a Gabon mouth bow):

(
play {
  		var bowRoot, stick, bow, mouth;
		var speed, stickPattern, rootStickPattern, rootStick, tstick, trigger, hi, lo;
		
		
		
		speed = 0.7;
		trigger = Impulse.kr(12*speed);
		
		stickPattern = Dseq([
						Dseq(#[1, 0, 1, 0, 1, 1, 0, 1, 0.3, 1, 0], 8),
						Dseq(#[1, 0, 1, 0, 0.2, 1, 0, 1, 1, 1, 0], 2),
						Dseq(#[0, 1, 0, 1, 0, 1, 0, 0, 0.5, 1, 0], 2)
				], inf) * Dwhite(0.8, 1.2, inf);
		
		hi = Dwhite(65.95, 66.05, 1);
		lo = 68;
		rootStickPattern = Dseq([hi, hi, lo, hi, lo, lo, hi, lo], inf);
		
		
		stick = Demand.kr(trigger, 0, stickPattern) * trigger;
				
		rootStick = PulseDivider.kr(stick, 3, 3);
		bowRoot = Lag.kr(Demand.kr(rootStick, 0, rootStickPattern).midicps, 0.05, 1/3.5);
		
		bow = CombL.ar(
						GrayNoise.ar(Decay2.kr(stick, 0.001, LFNoise1.kr(12, 0.05, 0.1), 0.3)),
						0.01,
						Lag.kr(bowRoot, 0.15).reciprocal,
						LFNoise2.kr(0.32, 0.2, 0.5 - (0.2*ToggleFF.kr(rootStick)) * 4)
                                                // Add a little mouse-magic (comment previous line, uncomment the following)						
                                                //LFNoise2.kr(0.32, MouseY.kr([0.2,0.005],[100,40],\exponential), 0.5 - (0.2*ToggleFF.kr(rootStick)) * 4)
				);
		tstick = Trig.kr(stick,0.01);		 
		mouth = RLPF.ar(
						bow,
						Lag.kr(
						Demand.kr(tstick, 1,
								Dseq([Drand([
										Drand(#[3, 4, 5, 6], 2),
										Drand(#[2, 3, 5], 4 * 3),
										Drand(#[ 2, 4, 6, 3 ], 3 * 4),
										Dseq(#[6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 6], 2)
										
										], 3)], inf)
					 	), 0.05) * bowRoot,
						LFNoise1.kr(0.8, 0.05, 0.1)
				 );
		Pan2.ar(LPF.ar(mouth, 2000), -0.3) +
		Pan2.ar(HPF.ar(bow * 0.3, 5000), 0.4)
                // If you're using "mouse-magic" you can leave out the first Pan2
                // LPF.ar(mouth, 2000) +
		// Pan2.ar(HPF.ar(bow * 0.3, 5000), 0.4)


};
)

// A Bavarian mouth harp:


(
	play {
			var root, finger, harp, mouth;
			var speed, trigger, troot;
			speed = MouseX.kr(0.7, 1.0) * 6;
			trigger = Impulse.ar(speed + LFNoise2.kr(0.1, 0.1));
			troot = PulseDivider.ar(trigger, 24, 24);
			root = Demand.ar(troot, 1, Dseq([ 47, 52 ], inf)).midicps;

			finger = Demand.ar(trigger, 0,
					Dseq([
							Dseq(#[1, 1, 0.05, 1, 0.7, 0.02, 1, 1, 0.1, 1, 0.1, 0.1], 4),
							Dseq(#[1, 1, 1, 0.1, 0.1, 0.2, 1, 1, 0.1, 1, 1, 0.1], 5),
							Dseq([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 2] ++ (0 ! 16+2))
							
					])
			) * trigger;
			
			harp = Saw.ar(Lag.ar(root, 0.15), Decay.ar(finger, LFNoise1.ar(0.4, 0.3, 0.8), 0.2));
			mouth = RLPF.ar(
							harp,
							Lag.ar(
						 	 Demand.ar(finger, 0, 
									Dseq([
										Dseq([
											Dseq(#[4, 5, 6], 2),
											Dseq([6, 5, Drand(#[8, 7], 1)], 4),
											Dseq(
												#[3, 5, 6, 7, 6, 5, 7, 5, 6, 9, 
												8, 7, 5, 6, 4, 3], 2)
										], 3)
									], inf)
							), 0.1) * root,
							LFNoise1.kr(0.3, 0.05, 0.08),
							1,
							LPF.ar(harp, 2000) * 0.4
							);
						
		 Pan2.ar(
		 	LPF.ar(mouth, 4000), 
		 	LFNoise1.kr(0.5, 0.3)
		 );
			
	};
)

// Using patterns rather than Demand Ugens:


(
SynthDef("mursing", { |freq, harm, t_trig, gate=1, metal=0.5, base=0.5, out, pan, amp=0.1|
			var env, harp, mouth, trigger;
			env = Linen.kr(gate,  doneAction:2);
			trigger = Impulsar.ar(t_trig);
			amp = amp * Decay2.ar(trigger, 
						LFNoise1.kr(5).range(0.0001, 0.01), 
						LFNoise1.kr(5).range(0.4, 0.8), 
						0.2
					);
			harp = Saw.ar(Lag.kr(freq, 0.15));
			
			harp = harp + PinkNoise.ar(harp.max(0) * 0.2) * amp * 10;
			
			mouth = RLPF.ar(
							harp,
							Lag.kr(harm, LFNoise1.kr(2).range(0.2, 0.3)) * freq,
							LFNoise1.kr(0.3).range(0.01, 0.05),
							1,
							LPF.ar(harp, 2000) * 0.4
			);
			
			Out.ar(out,
				 Pan2.ar(
		 			LPF.ar(mouth, 4000) + 
		 			(HPF.ar(harp, 2000) * metal) +
		 			LPF.ar(harp, 400, 14 * base), 
		 			pan,
		 			env
		 		)
			);

}).store;
)


(
var a, b;
a = 0;
b = 5;
Pmono(\mursing,  
	\note, Pseq([Pseq([Pn(a, 24), Pn(b, 24)], 2), Pseq([Pn(a, 12), Pn(b, 12)], 2)], inf),
	\octave, 4,
	\harm,  Pseq([
				Pseq([ Pseq([4, 1, 5]), Pseq([4, 6, 2]) ], 24),
				Pseq([ Pseq([7, 6, 5]), Pseq([1, 7, 4]) ], 24),
				Pseq([ Pseq([4, 1, 5]), Pseq([4, 6, 2]) ], 12),
				Pseq([ Pseq([7, 6, 5]), Pseq([6, 1, 1]) ], 12)
			], inf),
	\t_trig, Pswitch([
			Pseq([1, 0.3, 0.3, 1, 0, 0]), Pseq([1, 0.3, 0, 0, 1, 0])],
			Pseq([0,0,1,0,1,1,0], inf)
	),
	\metal, Pbrown(0.3, 0.8, 0.01, inf),
	\base, Pwrand([1, 0.3], [0.1, 0.8], inf),
	\dur, 0.14
).play;
)
raw 4920 chars (focus & ctrl+a+c to copy)
reception
comments