[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] guitar synth controlled by midi
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] guitar synth controlled by midi
- From: "Andrew Pascoe" <aylutar@xxxxxxxxx>
- Date: Sun, 28 Dec 2008 10:54:31 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=T5EmV8rDBMn6naSFFUn75vfX7OSGkovFe0X4t+5NqJQ=; b=gGFXtCNdrI5q94kIl/P6pywh9NcanvKId+xfA2QPgFxZ7uqjU1g08VgP0bZjRR2Gz3 DcZsO7U8cBj9mpqXrOgEAtyq2MeIWPuKGXZZ+YtAmejG2ANVcFceiK6IjC5Om0p1RpPS eWYhg2KVaWcFkhiw9bNjsxOMxfH4siqji6tbc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=hOLc2wzSJ1kgu++F0GD7bMELfWjEeJC2pV5SZTIhOvHKwX9BXjlNdBp74SGV2qaDZR +JtXKb1pU+ZQIX+5gllIYcM1AV2k/pWDGLZJLc9h13wmHWS7v6ZkHvpQCyJaFK6G+ghX 0oMxT0yWN+QLyWO1Bi7LDlcVyADWgWneuF9WU=
- In-reply-to: <fc5507fa0812272307q449a32e3i4a05c8812ad98934@xxxxxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <fc5507fa0812272307q449a32e3i4a05c8812ad98934@xxxxxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
Give this code a shot. You'll probably want to specify the
NoteOnResponder more for your own needs, and in particular, change the
velocity to amplitude function.
(
SynthDef(\guitar,
{
arg freq, amp, pan = 0;
var out, pluck, period, string;
pluck = PinkNoise.ar(Decay.kr(Line.kr(1, 0, 0.05), 0.05));
period = freq.reciprocal;
string = CombL.ar(pluck, period, period, 4);
out = LeakDC.ar(LPF.ar(string, 12000));
DetectSilence.ar(out, 0.005, 1, 2);
Out.ar(0, Pan2.ar(out, pan, amp));
}
).send(s);
n = NoteOnResponder(
{
arg src, chan, note, vel;
Synth(\guitar, [\freq, note.midicps, \amp, (vel/127).sqrt]);
},
nil,
nil,
nil,
nil
);
)
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/