Csound Csound-dev Csound-tekno Search About

[Csnd] prepiano opcode (prepared-or-not?)

Date2011-01-20 21:06
FromSchumacher Marlon
Subject[Csnd] prepiano opcode (prepared-or-not?)
Dear community,

I was looking over this paper "prepared piano sound synthesis" (http://www.dafx.ca/proceedings/papers/p_077.pdf) and tried the csound-example for the opcode 'prepiano', but somehow I can't get the 'preparations' (i.e. rattles and rubbers) to work. I've tried the MaxMSP implementation in  which the preparations seem to work well. I've attached a csd with two prepiano-instruments using the same score, one with preparations, one without it; however they seem to be the same. Could maybe someone tell me if or what I am doing anything wrong here?

best,
Marlon



; Select audio/midi flags here according to platform
; Audio out Audio in No messages
; -odac -iadc -d ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform


; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2;
; Instrument #1. Without preparations
instr 1
;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1
outs aa*.75, ab*.75
endin
; Instrument #2. With preparations
instr 2
;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1, 1, 2
outs aa*.75, ab*.75
endin


f1 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
f2 0 8 2 1 0.7 50 500 1000 ;; 1 rubber
;; first instrument
i1 0.0 0.5 1 0.09 20
i1 0.5 . -1 0.09 40 ;; 1 -> skip initialisation
i1 1.0 . -1 0.09 60
i1 1.5 . -1 0.09 80
i1 2.0 1.8 -1 0.09 100
;; second instrument
i2 4.0 0.5 1 0.09 20
i2 4.5 . -1 0.09 40 ;; 1 -> skip initialisation
i2 5.0 . -1 0.09 60
i2 5.5 . -1 0.09 80
i2 6.0 1.8 -1 0.09 100
e



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-01-21 00:58
FromSteven Yi
SubjectRe: [Csnd] prepiano opcode (prepared-or-not?)
Hi Marlon,

I tried it out here too and modified the different values but to my
ears they sounded the same, and the amplitudes reported for each set
were the same (I imagine they would be different with
rattles/rubbers).  I looked at the source code and saw that the rattle
and rubber tables were being checked and used, but I don't know the
implementation details enough to check if something is off or not
there. Hopefully John can take a look?

steven

On Thu, Jan 20, 2011 at 4:06 PM, Schumacher Marlon
 wrote:
> Dear community,
>
> I was looking over this paper "prepared piano sound synthesis" (http://www.dafx.ca/proceedings/papers/p_077.pdf) and tried the csound-example for the opcode 'prepiano', but somehow I can't get the 'preparations' (i.e. rattles and rubbers) to work. I've tried the MaxMSP implementation in  which the preparations seem to work well. I've attached a csd with two prepiano-instruments using the same score, one with preparations, one without it; however they seem to be the same. Could maybe someone tell me if or what I am doing anything wrong here?
>
> best,
> Marlon
>
> 
> 
> ; Select audio/midi flags here according to platform
> ; Audio out Audio in No messages
> ; -odac -iadc -d ;;;RT audio I/O
> ; For Non-realtime ouput leave only the line below:
> ; -o prepiano.wav -W ;;; for file output any platform
> 
> 
> ; Initialize the global variables.
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2;
> ; Instrument #1. Without preparations
> instr 1
> ;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
> aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1
> outs aa*.75, ab*.75
> endin
> ; Instrument #2. With preparations
> instr 2
> ;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
> aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1, 1, 2
> outs aa*.75, ab*.75
> endin
> 
> 
> f1 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
> f2 0 8 2 1 0.7 50 500 1000 ;; 1 rubber
> ;; first instrument
> i1 0.0 0.5 1 0.09 20
> i1 0.5 . -1 0.09 40 ;; 1 -> skip initialisation
> i1 1.0 . -1 0.09 60
> i1 1.5 . -1 0.09 80
> i1 2.0 1.8 -1 0.09 100
> ;; second instrument
> i2 4.0 0.5 1 0.09 20
> i2 4.5 . -1 0.09 40 ;; 1 -> skip initialisation
> i2 5.0 . -1 0.09 60
> i2 5.5 . -1 0.09 80
> i2 6.0 1.8 -1 0.09 100
> e
> 
> 
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2011-01-21 16:41
FromMarlon Schumacher
SubjectRe: [Csnd] prepiano opcode (prepared-or-not?)
Hi again,

many thanks for testing. Yes, in fact the opcode produces the same
signal with or without preparation (see e.g. the result of the
attached csd, in which both outputs are mixed together
(phase-inverted)). Should this be considered a bug?
Another thing which I don't really understand is what happens in this
instrument if iK is set to -1 (skip initialization)? If for example,
the durations of the previous score event overlap with the next
(non-initialized) one, it will not produce any sound...?

Many thanks again for any hints/clues,
best,
Marlon



----------------



; Select audio/midi flags here according to platform
; Audio out Audio in No messages
; -odac -iadc -d ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform


; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2;
; Instrument #1. Without preparations
instr 1
;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1
outs aa*.75, ab*.75
endin
; Instrument #2. With preparations
instr 2
;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6,
0, 0.1, 1, 2
outs aa*-.75, ab*-.75
endin


f1 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
f2 0 8 2 1 0.7 50 500 1000 ;; 1 rubber
;; first instrument
i1 0.0 0.5 1 0.09 20
i1 0.5 . -1 0.09 40 ;; 1 -> skip initialisation
i1 1.0 . -1 0.09 60
i1 1.5 . -1 0.09 80
i1 2.0 1.8 -1 0.09 100
;; second instrument
i2 0.0 0.5 1 0.09 20
i2 0.5 . -1 0.09 40 ;; 1 -> skip initialisation
i2 1.0 . -1 0.09 60
i2 1.5 . -1 0.09 80
i2 2.0 1.8 -1 0.09 100
e




On Thu, Jan 20, 2011 at 7:58 PM, Steven Yi  wrote:
> Hi Marlon,
>
> I tried it out here too and modified the different values but to my
> ears they sounded the same, and the amplitudes reported for each set
> were the same (I imagine they would be different with
> rattles/rubbers).  I looked at the source code and saw that the rattle
> and rubber tables were being checked and used, but I don't know the
> implementation details enough to check if something is off or not
> there. Hopefully John can take a look?
>
> steven
>
> On Thu, Jan 20, 2011 at 4:06 PM, Schumacher Marlon
>  wrote:
>> Dear community,
>>
>> I was looking over this paper "prepared piano sound synthesis" (http://www.dafx.ca/proceedings/papers/p_077.pdf) and tried the csound-example for the opcode 'prepiano', but somehow I can't get the 'preparations' (i.e. rattles and rubbers) to work. I've tried the MaxMSP implementation in  which the preparations seem to work well. I've attached a csd with two prepiano-instruments using the same score, one with preparations, one without it; however they seem to be the same. Could maybe someone tell me if or what I am doing anything wrong here?
>>
>> best,
>> Marlon
>>
>> 
>> 
>> ; Select audio/midi flags here according to platform
>> ; Audio out Audio in No messages
>> ; -odac -iadc -d ;;;RT audio I/O
>> ; For Non-realtime ouput leave only the line below:
>> ; -o prepiano.wav -W ;;; for file output any platform
>> 
>> 
>> ; Initialize the global variables.
>> sr = 44100
>> kr = 4410
>> ksmps = 10
>> nchnls = 2;
>> ; Instrument #1. Without preparations
>> instr 1
>> ;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
>> aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1
>> outs aa*.75, ab*.75
>> endin
>> ; Instrument #2. With preparations
>> instr 2
>> ;; fund NS detune stiffness decay loss (bndry) (hammer) scan prep
>> aa,ab prepiano 60, 3, 10, p4, 3, 0.002, 2, 2, 1, 5000, -0.01, p5, p6, 0, 0.1, 1, 2
>> outs aa*.75, ab*.75
>> endin
>> 
>> 
>> f1 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
>> f2 0 8 2 1 0.7 50 500 1000 ;; 1 rubber
>> ;; first instrument
>> i1 0.0 0.5 1 0.09 20
>> i1 0.5 . -1 0.09 40 ;; 1 -> skip initialisation
>> i1 1.0 . -1 0.09 60
>> i1 1.5 . -1 0.09 80
>> i1 2.0 1.8 -1 0.09 100
>> ;; second instrument
>> i2 4.0 0.5 1 0.09 20
>> i2 4.5 . -1 0.09 40 ;; 1 -> skip initialisation
>> i2 5.0 . -1 0.09 60
>> i2 5.5 . -1 0.09 80
>> i2 6.0 1.8 -1 0.09 100
>> e
>> 
>> 
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"