Piano patch

View: New views
12 Messages — Rating Filter:   Alert me  

Piano patch

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -

Does anyone have a half-decent piano patch in SC? I know that making a
good piano synth is very difficult, but anything that sounds
approximately piano-like would be interesting...

TIA
Dan

--
http://www.mcld.co.uk
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Piano patch

by Luke Selden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't...there's a stk piano simulation, but I have no idea what it
sounds like...
http://www.music.mcgill.ca/~sinclair/content/stk_piano

~luke

On Sat, Jun 14, 2008 at 8:49 AM, Dan Stowell <danstowell@...> wrote:

> Hi -
>
> Does anyone have a half-decent piano patch in SC? I know that making a
> good piano synth is very difficult, but anything that sounds
> approximately piano-like would be interesting...
>
> TIA
> Dan
>
> --
> http://www.mcld.co.uk
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Piano patch

by kernel-12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dan, there was an article in the Sound On Sound ´Synth Secrets´ series
ábout synthesizing piano patches.  However the guy concluded that you
could make something behave like a paino even if it doesn´t sound much
like a real one and and that behaviour may be recognised as a piano.  The
old DX FM synths have paino presets.  I remember tweaking one years ago
and thinking it sounded nice though.

kernel

> Hi -
>
> Does anyone have a half-decent piano patch in SC? I know that making a
> good piano synth is very difficult, but anything that sounds
> approximately piano-like would be interesting...
>
> TIA
> Dan
>
> --
> http://www.mcld.co.uk
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users




Re: Piano patch

by julio :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't have a patch but I used to work for Yamaha R&D in the late 80s  
programming their TX and SY series. For pianos one tended to use  
'algorithm 5' which had a mix of three FM modulator-carrier pairs, one  
of which would have feedback on the modulator, the gist of it was to  
create the percussive sound with that and kind of envelope the other  
two to imitate the resonance of the struck key... in the SY series,  
with the addition of sampling elements, one could use an actual piano  
attack and then synthesise the rest

this may be useless info, but curious nevertheless !

Pierre Schaeffer in his 'Solfége de l'objet Sonore' discusses at  
length the idea that making the right envelope is half the work in  
getting someting to sound like something else... again, more  
trivia !  ;)

best,

Julio


On 17 Jun 2008, at 20:28, kernel@... wrote:

> Hi Dan, there was an article in the Sound On Sound ´Synth Secrets´  
> series
> ábout synthesizing piano patches.  However the guy concluded that you
> could make something behave like a paino even if it doesn´t sound much
> like a real one and and that behaviour may be recognised as a  
> piano.  The
> old DX FM synths have paino presets.  I remember tweaking one years  
> ago
> and thinking it sounded nice though.
>
> kernel
>
>> Hi -
>>
>> Does anyone have a half-decent piano patch in SC? I know that  
>> making a
>> good piano synth is very difficult, but anything that sounds
>> approximately piano-like would be interesting...
>>
>> TIA
>> Dan
>>
>> --
>> http://www.mcld.co.uk
>> _______________________________________________
>> sc-users mailing list
>> sc-users@...
>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>>
>
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users




Re: Piano patch

by sc3.1 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dan,

Here is a synthdef based on an old SC2 code sample written by James McCartney with a couple little tweaks.  It isn't great, but it reminds me of a piano and it admirably emulates the hammer and multiple strings.  By playing with the detune array, you can get everything from toy piano to honky tonk... :-)

SynthDef(\piano, { arg outBus, freq, amp, dur, pan; 
var sig, in, n = 6, max = 0.04, min = 0.01, delay, pitch, detune, hammer;
hammer = Decay2.ar(Impulse.ar(0.001), 0.008, 0.04, LFNoise2.ar([2000,4000].asSpec.map(amp), 0.25));
sig = Mix.ar(Array.fill(3, { arg i;
detune = #[-0.04, 0, 0.03].at(i);
delay = (1/(freq + detune).midicps);
CombL.ar(hammer, delay, delay, 50 * amp)
}) );


sig = HPF.ar(sig,50) * EnvGen.ar(Env.perc(0.0001,dur, amp, -1), doneAction:2);
Out.ar(outBus, Pan2.ar(sig,pan));
}).send(s);

( //play a little ditty
Task({ 
36.do({ 
Synth(\piano, [\freq, [0,2,3,5,7,8,10].choose + 60, \outBus, 0, \amp, rrand(0.25,0.9), \dur, 1, \pan, 0], s);
[0.5,1].choose.wait
});
}).start
);


Jeff

On Jun 14, 2008, at 11:49 AM, Dan Stowell wrote:

Hi -

Does anyone have a half-decent piano patch in SC? I know that making a
good piano synth is very difficult, but anything that sounds
approximately piano-like would be interesting...

TIA
Dan

-- 
_______________________________________________
sc-users mailing list


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Piano patch

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks all for the interesting comments (and jeff for the patch).

Here is my so-far half-decent piano. I mean "half" quite literally -
it's pretty good at the lower end of the keyboard but completely
un-piano-like at the top end. But maybe useful to others, so:

SynthDef.new("mcldjospiano1", { | outbus = 0, freq = 440, gate = 0, amp=1 |
        var out, impresp, imps, dels, hammerstr, velocity, string, ampcomp,
pldelay, cutoff;
        velocity = Latch.kr(gate, gate);

        cutoff = EnvGen.kr(Env.asr(0.00001, 1, 0.2, curve: -4), gate,
doneAction: 2) * 15000 + 30;

        // We start off by appromixating the piano's impulse response.
        impresp = WhiteNoise.ar(1, 0, EnvGen.ar(Env.perc(0.02, 0.02)));
        impresp = LPF.ar(impresp, freq.expexp(50, 1000, 10000, 500));
        // FreeVerb is NOT a piano soundboard impulse response! Just a standin
        impresp = FreeVerb.ar(impresp, 0.8, freq.linlin(300, 600, 0.1, 0.9),
freq.linlin(300, 600, 0.19, 0.01));
        impresp = LeakDC.ar(impresp);
       
        // Then we simulate the multiple strikes of the hammer against the string
        dels = #[0.002, 0.006, 0.009] * freq.explin(100, 1000, 1, 0.01);
        imps = DelayN.ar(impresp, dels, dels, #[0.85, 0.32, 0.22]);
        // Note: at higher velocity, the LPF goes higher, making the hammer
hits more pointy & separate
        imps = LPF.ar(imps, freq * 2 * #[1, 1.5, 1.5] * velocity * 2, mul: 8);
        hammerstr = imps.sum;
       
        // Now push the sound into Pluck, to simulate the string vibration
        pldelay = (freq * [Rand(0.999, 0.9995), 1, Rand(1.00005, 1.001)]).reciprocal;
        string = Pluck.ar(hammerstr, Impulse.kr(0.000001), pldelay, pldelay,
10.5, 0.4);
        string = LeakDC.ar(string).sum;
       
        // patch gives un-piano-like amplitude variation across pitch; let's compensate
        ampcomp = freq.max(350).min(1000).linlin(350, 1000, 1, 60);
        string = string * ampcomp;
       
        // filter is to damp the string when the note stops
        string = LPF.ar(string, cutoff);
       
        out = string * amp;
        Out.ar(outbus, [out, out]);
}).load(s);

// Play it
v = Voicer.new(4, "mcldjospiano1");
(
Task{loop{
f = Array.fill(exprand(1,3), { (30.rand + 20).midicps });
v.trigger(f, rrand(0.5, 1.0));  // play 5 notes
[0.3, 0.6, 0.7].choose.wait;
v.release(f);  // release the same
0.1.wait;
}}.play;
)

I made this SynthDef while trying to follow the "commuted" approach
described by Julius O Smith:
http://ccrma.stanford.edu/~jos/pasp/Commuted_Piano_Synthesis.html
Any crappy sound is due to me and not him :) but *sometimes* the patch
sounds pretty nice.

(BTW I can't get the SynthDef to play from within a Pbind, some
weirdness about argument names or something? No sound comes out.)

Dan


2008/6/17 Julio d'Escrivan <julio@...>:

> I don't have a patch but I used to work for Yamaha R&D in the late 80s
> programming their TX and SY series. For pianos one tended to use
> 'algorithm 5' which had a mix of three FM modulator-carrier pairs, one
> of which would have feedback on the modulator, the gist of it was to
> create the percussive sound with that and kind of envelope the other
> two to imitate the resonance of the struck key... in the SY series,
> with the addition of sampling elements, one could use an actual piano
> attack and then synthesise the rest
>
> this may be useless info, but curious nevertheless !
>
> Pierre Schaeffer in his 'Solfége de l'objet Sonore' discusses at
> length the idea that making the right envelope is half the work in
> getting someting to sound like something else... again, more
> trivia !  ;)
>
> best,
>
> Julio
>
>
> On 17 Jun 2008, at 20:28, kernel@... wrote:
>
>> Hi Dan, there was an article in the Sound On Sound ´Synth Secrets´
>> series
>> ábout synthesizing piano patches.  However the guy concluded that you
>> could make something behave like a paino even if it doesn´t sound much
>> like a real one and and that behaviour may be recognised as a
>> piano.  The
>> old DX FM synths have paino presets.  I remember tweaking one years
>> ago
>> and thinking it sounded nice though.
>>
>> kernel
>>
>>> Hi -
>>>
>>> Does anyone have a half-decent piano patch in SC? I know that
>>> making a
>>> good piano synth is very difficult, but anything that sounds
>>> approximately piano-like would be interesting...
>>>
>>> TIA
>>> Dan
>>>
>>> --
>>> http://www.mcld.co.uk
>>> _______________________________________________
>>> sc-users mailing list
>>> sc-users@...
>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>>>
>>
>>
>> _______________________________________________
>> sc-users mailing list
>> sc-users@...
>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>



--
http://www.mcld.co.uk

_______________________________________________
sc-users mailing list

sc-users@...
archive: http://www.listarc.bham.ac.uk/lists/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Piano patch

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmm... prepared piano with two voice counterpoint:

SynthDef(\piano, { arg outBus, freq, amp, dur, pan; 
var sig, in, n = 6, max = 0.04, min = 0.01, delay, pitch, detune, hammer;
hammer = Decay2.ar(Impulse.ar(0.001), 0.008, 0.04,
LFNoise2.ar([2000,4000].asSpec.map(amp), 0.25));
sig = Mix.ar(Array.fill(3, { arg i;
detune = #[-0.04, 0, 0.03].at(i);
delay = (1/(freq + detune).midicps);
CombL.ar(hammer, delay, delay, 50 * amp) + 
SinOsc.ar(
[(freq * 2) + SinOsc.kr(2, Rand(0, 1.0), 4), 
freq * [4.23, 6.5]].flat , 
0, 
amp * [0.1, 0.25, 0.3]).sum
}) );


sig = HPF.ar(sig,50) * EnvGen.ar(Env.perc(0.0001,dur, amp, -1), doneAction:2);
Out.ar(outBus, Pan2.ar(sig,pan));
}).send(s);

( //play a little ditty
Task({ 
36.do({ 
2.do({arg i;
Synth(\piano, [\freq, [0,2,3,5,7,8,10].choose + (60 + (i * 12)), \outBus, 0, 
\amp, rrand(0.25,0.9), \dur, 1, \pan, 0], s);
});
[0.5,1].choose.wait
});
}).start
);


Josh

On Jun 17, 2008, at 2:36 PM, sc3.1 wrote:

Hi Dan,

Here is a synthdef based on an old SC2 code sample written by James McCartney with a couple little tweaks.  It isn't great, but it reminds me of a piano and it admirably emulates the hammer and multiple strings.  By playing with the detune array, you can get everything from toy piano to honky tonk... :-)

SynthDef(\piano, { arg outBus, freq, amp, dur, pan; 
var sig, in, n = 6, max = 0.04, min = 0.01, delay, pitch, detune, hammer;
hammer = Decay2.ar(Impulse.ar(0.001), 0.008, 0.04, LFNoise2.ar([2000,4000].asSpec.map(amp), 0.25));
sig = Mix.ar(Array.fill(3, { arg i;
detune = #[-0.04, 0, 0.03].at(i);
delay = (1/(freq + detune).midicps);
CombL.ar(hammer, delay, delay, 50 * amp)
}) );

sig = HPF.ar(sig,50) * EnvGen.ar(Env.perc(0.0001,dur, amp, -1), doneAction:2);
Out.ar(outBus, Pan2.ar(sig,pan));
}).send(s);

( //play a little ditty
Task({ 
36.do({ 
Synth(\piano, [\freq, [0,2,3,5,7,8,10].choose + 60, \outBus, 0, \amp, rrand(0.25,0.9), \dur, 1, \pan, 0], s);
[0.5,1].choose.wait
});
}).start
);


Jeff

On Jun 14, 2008, at 11:49 AM, Dan Stowell wrote:

Hi -

Does anyone have a half-decent piano patch in SC? I know that making a
good piano synth is very difficult, but anything that sounds
approximately piano-like would be interesting...

TIA
Dan

-- 
_______________________________________________
sc-users mailing list

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/


_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Piano patch

by Nathaniel Virgo-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



2008/6/17 Dan Stowell <danstowell@...>:

(BTW I can't get the SynthDef to play from within a Pbind, some
weirdness about argument names or something? No sound comes out.)

The gate argument has to default to 1 instead of 0, then it works (I get caught out by that one all the time).

Nathaniel


Re: Piano patch

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>
>SynthDef.new("mcldjospiano1", { | outbus = 0, freq = 440,
>gate = 0, amp=1 |
>

<..>

>
>(BTW I can't get the SynthDef to play from within a Pbind, some
>weirdness about argument names or something? No sound comes out.)

Probably it is just quiet because your amp=1. You should replace
outbus by out, too.
Then also you should use .store, not .load.

the conventional argument names/values for using events / Pbind:

out // outbus
in // filter input
freq = 440
amp = 0.1
gate = 1
// or:
sustain = 1

// this works:

Pbind(\note, Pwhite(-5, 8, inf) + Prand([[0, 2, 3, 8], [0, 2], [0, 5,
7]], inf), \dur, Prand([0.5, 0.8, 1, 1.5], inf)).play;



SynthDef.new("mcldjospiano1", { | out = 0, freq = 440, gate = 1, amp=0.1 |
        var out, impresp, imps, dels, hammerstr, velocity, string, ampcomp,
pldelay, cutoff;
        velocity = Latch.kr(gate, gate);

        cutoff = EnvGen.kr(Env.asr(0.00001, 1, 0.2, curve: -4), gate,
doneAction: 2) * 15000 + 30;

        // We start off by appromixating the piano's impulse response.
        impresp = WhiteNoise.ar(1, 0, EnvGen.ar(Env.perc(0.02, 0.02)));
        impresp = LPF.ar(impresp, freq.expexp(50, 1000, 10000, 500));
        // FreeVerb is NOT a piano soundboard impulse response! Just a standin
        impresp = FreeVerb.ar(impresp, 0.8, freq.linlin(300, 600, 0.1, 0.9),
freq.linlin(300, 600, 0.19, 0.01));
        impresp = LeakDC.ar(impresp);

        // Then we simulate the multiple strikes of the hammer
against the string
        dels = #[0.002, 0.006, 0.009] * freq.explin(100, 1000, 1, 0.01);
        imps = DelayN.ar(impresp, dels, dels, #[0.85, 0.32, 0.22]);
        // Note: at higher velocity, the LPF goes higher, making the
hammer hits more pointy & separate
        imps = LPF.ar(imps, freq * 2 * #[1, 1.5, 1.5] * velocity * 2, mul: 8);
        hammerstr = imps.sum;

        // Now push the sound into Pluck, to simulate the string vibration
        pldelay = (freq * [Rand(0.999, 0.9995), 1, Rand(1.00005,
1.001)]).reciprocal;
        string = Pluck.ar(hammerstr, Impulse.kr(0.000001), pldelay,
pldelay, 10.5, 0.4);
        string = LeakDC.ar(string).sum;

        // patch gives un-piano-like amplitude variation across
pitch; let's compensate
        ampcomp = freq.max(350).min(1000).linlin(350, 1000, 1, 60);
        string = string * ampcomp;

        // filter is to damp the string when the note stops
        string = LPF.ar(string, cutoff);

        out = string * (amp * 10);
        Out.ar(outbus, [out, out]);
}).store;
--





.

_______________________________________________
sc-users mailing list

sc-users@...
archive: http://www.listarc.bham.ac.uk/lists/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Piano patch

by Julian Rohrhuber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sorry, corrected:


SynthDef.new("mcldjospiano1", { | out = 0, freq = 440, gate = 1,
amp=0.1, pan = 0|
        var impresp, imps, dels, hammerstr, velocity, string, ampcomp,
pldelay, cutoff;
        velocity = Latch.kr(gate, gate);

        cutoff = EnvGen.kr(Env.asr(0.00001, 1, 0.2, curve: -4), gate,
doneAction: 2) * 15000 + 30;

        // We start off by appromixating the piano's impulse response.
        impresp = WhiteNoise.ar(1, 0, EnvGen.ar(Env.perc(0.02, 0.02)));
        impresp = LPF.ar(impresp, freq.expexp(50, 1000, 10000, 500));
        // FreeVerb is NOT a piano soundboard impulse response! Just a standin
        impresp = FreeVerb.ar(impresp, 0.8, freq.linlin(300, 600, 0.1, 0.9),
freq.linlin(300, 600, 0.19, 0.01));
        impresp = LeakDC.ar(impresp);

        // Then we simulate the multiple strikes of the hammer
against the string
        dels = #[0.002, 0.006, 0.009] * freq.explin(100, 1000, 1, 0.01);
        imps = DelayN.ar(impresp, dels, dels, #[0.85, 0.32, 0.22]);
        // Note: at higher velocity, the LPF goes higher, making the
hammer hits more pointy & separate
        imps = LPF.ar(imps, freq * 2 * #[1, 1.5, 1.5] * velocity * 2, mul: 8);
        hammerstr = imps.sum;

        // Now push the sound into Pluck, to simulate the string vibration
        pldelay = (freq * [Rand(0.999, 0.9995), 1, Rand(1.00005,
1.001)]).reciprocal;
        string = Pluck.ar(hammerstr, Impulse.kr(0.000001), pldelay,
pldelay, 10.5, 0.4);
        string = LeakDC.ar(string).sum;

        // patch gives un-piano-like amplitude variation across
pitch; let's compensate
        ampcomp = freq.max(350).min(1000).linlin(350, 1000, 1, 60);
        string = string * ampcomp;

        // filter is to damp the string when the note stops
        string = LPF.ar(string, cutoff);

        Out.ar(out, Pan2.ar(string, pan, (amp * 10)));
}).store;



>>SynthDef.new("mcldjospiano1", { | outbus = 0, freq = 440,
>>gate = 0, amp=1 |
>>
>
><..>
>
>>
>>(BTW I can't get the SynthDef to play from within a Pbind, some
>>weirdness about argument names or something? No sound comes out.)
>
>Probably it is just quiet because your amp=1. You should replace
>outbus by out, too.
>Then also you should use .store, not .load.
>
>the conventional argument names/values for using events / Pbind:
>
>out // outbus
>in // filter input
>freq = 440
>amp = 0.1
>gate = 1
>// or:
>sustain = 1
>
>// this works:
>
>Pbind(\note, Pwhite(-5, 8, inf) + Prand([[0, 2, 3, 8], [0, 2], [0,
>5, 7]], inf), \dur, Prand([0.5, 0.8, 1, 1.5], inf)).play;
>
>
>
>SynthDef.new("mcldjospiano1", { | out = 0, freq = 440, gate =
>1, amp=0.1 |
> var out, impresp, imps, dels, hammerstr, velocity, string, ampcomp,
>pldelay, cutoff;
> velocity = Latch.kr(gate, gate);
>
> cutoff = EnvGen.kr(Env.asr(0.00001, 1, 0.2, curve: -4), gate,
>doneAction: 2) * 15000 + 30;
>
> // We start off by appromixating the piano's impulse response.
> impresp = WhiteNoise.ar(1, 0, EnvGen.ar(Env.perc(0.02, 0.02)));
> impresp = LPF.ar(impresp, freq.expexp(50, 1000, 10000, 500));
> // FreeVerb is NOT a piano soundboard impulse response! Just a standin
> impresp = FreeVerb.ar(impresp, 0.8, freq.linlin(300, 600, 0.1, 0.9),
>freq.linlin(300, 600, 0.19, 0.01));
> impresp = LeakDC.ar(impresp);
>
> // Then we simulate the multiple strikes of the hammer
>against the string
> dels = #[0.002, 0.006, 0.009] * freq.explin(100, 1000, 1, 0.01);
> imps = DelayN.ar(impresp, dels, dels, #[0.85, 0.32, 0.22]);
> // Note: at higher velocity, the LPF goes higher, making the
>hammer hits more pointy & separate
> imps = LPF.ar(imps, freq * 2 * #[1, 1.5, 1.5] * velocity * 2, mul: 8);
> hammerstr = imps.sum;
>
> // Now push the sound into Pluck, to simulate the string vibration
> pldelay = (freq * [Rand(0.999, 0.9995), 1, Rand(1.00005,
>1.001)]).reciprocal;
> string = Pluck.ar(hammerstr, Impulse.kr(0.000001), pldelay,
>pldelay, 10.5, 0.4);
> string = LeakDC.ar(string).sum;
>
> // patch gives un-piano-like amplitude variation across
>pitch; let's compensate
> ampcomp = freq.max(350).min(1000).linlin(350, 1000, 1, 60);
> string = string * ampcomp;
>
> // filter is to damp the string when the note stops
> string = LPF.ar(string, cutoff);
>
> out = string * (amp * 10);
> Out.ar(outbus, [out, out]);
>}).store;
>--
>
>
>
>
>
>.
>
>_______________________________________________
>sc-users mailing list
>
>sc-users@...
>archive: http://www.listarc.bham.ac.uk/lists/sc-users/
>search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


--





.

_______________________________________________
sc-users mailing list

sc-users@...
archive: http://www.listarc.bham.ac.uk/lists/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Parent Message unknown Re: Piano patch

by Dan Stowell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Probably it is just quiet because your amp=1. You should replace outbus by
> out, too.

Thanks for the tweaks.

BTW my SynthDef is mainly for use with Voicer, which wants the arg to
be named "outbus" I'm afraid! Not sure if this inconsistency is for a
reason...


> Then also you should use .store, not .load.

"should"? Does that mean .load is deprecated? If so, why?


2008/6/18 Julian Rohrhuber <rohrhuber@...>:

>>
>> SynthDef.new("mcldjospiano1", { | outbus = 0, freq = 440, gate = 0, amp=1
>> |
>>
>
> <..>
>
>>
>> (BTW I can't get the SynthDef to play from within a Pbind, some
>> weirdness about argument names or something? No sound comes out.)
>
> Probably it is just quiet because your amp=1. You should replace outbus by
> out, too.
> Then also you should use .store, not .load.
>
> the conventional argument names/values for using events / Pbind:
>
> out // outbus
> in // filter input
> freq = 440
> amp = 0.1
> gate = 1
> // or:
> sustain = 1
>
> // this works:
>
> Pbind(\note, Pwhite(-5, 8, inf) + Prand([[0, 2, 3, 8], [0, 2], [0, 5, 7]],
> inf), \dur, Prand([0.5, 0.8, 1, 1.5], inf)).play;
>
>
>
> SynthDef.new("mcldjospiano1", { | out = 0, freq = 440, gate = 1, amp=0.1 |
>        var out, impresp, imps, dels, hammerstr, velocity, string, ampcomp,
> pldelay, cutoff;
>        velocity = Latch.kr(gate, gate);
>
>        cutoff = EnvGen.kr(Env.asr(0.00001, 1, 0.2, curve: -4), gate,
> doneAction: 2) * 15000 + 30;
>
>        // We start off by appromixating the piano's impulse response.
>        impresp = WhiteNoise.ar(1, 0, EnvGen.ar(Env.perc(0.02, 0.02)));
>        impresp = LPF.ar(impresp, freq.expexp(50, 1000, 10000, 500));
>        // FreeVerb is NOT a piano soundboard impulse response! Just a
> standin
>        impresp = FreeVerb.ar(impresp, 0.8, freq.linlin(300, 600, 0.1, 0.9),
> freq.linlin(300, 600, 0.19, 0.01));
>        impresp = LeakDC.ar(impresp);
>
>        // Then we simulate the multiple strikes of the hammer against the
> string
>        dels = #[0.002, 0.006, 0.009] * freq.explin(100, 1000, 1, 0.01);
>        imps = DelayN.ar(impresp, dels, dels, #[0.85, 0.32, 0.22]);
>        // Note: at higher velocity, the LPF goes higher, making the hammer
> hits more pointy & separate
>        imps = LPF.ar(imps, freq * 2 * #[1, 1.5, 1.5] * velocity * 2, mul:
> 8);
>        hammerstr = imps.sum;
>
>        // Now push the sound into Pluck, to simulate the string vibration
>        pldelay = (freq * [Rand(0.999, 0.9995), 1, Rand(1.00005,
> 1.001)]).reciprocal;
>        string = Pluck.ar(hammerstr, Impulse.kr(0.000001), pldelay, pldelay,
> 10.5, 0.4);
>        string = LeakDC.ar(string).sum;
>
>        // patch gives un-piano-like amplitude variation across pitch; let's
> compensate
>        ampcomp = freq.max(350).min(1000).linlin(350, 1000, 1, 60);
>        string = string * ampcomp;
>
>        // filter is to damp the string when the note stops
>        string = LPF.ar(string, cutoff);
>
>        out = string * (amp * 10);
>        Out.ar(outbus, [out, out]);
> }).store;
> --
>
>
>
>
>
> .
>
> _______________________________________________
> sc-users mailing list
>
> sc-users@...
> archive: http://www.listarc.bham.ac.uk/lists/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>



--
http://www.mcld.co.uk

_______________________________________________
sc-users mailing list

sc-users@...
archive: http://www.listarc.bham.ac.uk/lists/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Re: Piano patch

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jun 18, 2008 at 3:25 PM, Dan Stowell <danstowell@...> wrote:
>> Probably it is just quiet because your amp=1. You should replace outbus by
>> out, too.
>
> Thanks for the tweaks.
>
> BTW my SynthDef is mainly for use with Voicer, which wants the arg to
> be named "outbus" I'm afraid! Not sure if this inconsistency is for a
> reason...

Outbus is actually for MixerChannel, not Voicer specifically.

Actually you *can* use 'out' for this, not just outbus - that isn't
documented but it's supported.

I should change the docs.
hjh


--
James Harkins /// dewdrop world
jamshark70@...
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman

_______________________________________________
sc-users mailing list

sc-users@...
archive: http://www.listarc.bham.ac.uk/lists/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/