// title: Wine Glass Code - Edited // author: schun // description: // This is an addition to my first code of wine glass sound: "The friction between a finger dipped in water and the edge of a wine glass creating a sound." I have added a couple more synthdefs/codes to demonstrate the differences when modfreq is changed. A higher modfreq changes the purity of the tone. // code: // Wine Glass Sound ( SynthDef("AM", { arg freq = 523.25, modfreq = 1, amp = 0.5, attack = 2, dur = 5, pos = 0; var carrier, modulator, env; modulator = SinOsc.kr(modfreq).range(0, 1); carrier = SinOsc.ar(freq: freq, mul: modulator); env = Env.perc(attackTime: attack, releaseTime: dur - attack, level: amp).kr(2); carrier = carrier * env; Out.ar(0, Pan2.ar(carrier, pos)) }).add; ) ( Pbind( \instrument, "AM", \note, 15, \dur, 10, \amp, Pwhite(0.5, 0.1), \att, 1, \rel, 10 ).play; ) // changes to the modfreq in SynthDef "AM1" -- rougher rubbing against the glass ( Pbind( \instrument, "AM", \note, 15, \dur, 10, \amp, Pwhite(0.5, 0.1), \att, 1, \rel, 10, \modfreq, 10 ).play; ) // even higher modfreq -- greater number of voices ( Pbind( \instrument, "AM", \note, 15, \dur, 10, \amp, Pwhite(0.5, 0.1), \att, 1, \rel, 10, \modfreq, 1000 ).play; )