[Csnd] Modelling a piano like instrument: waveguide questions

Hey hey,
I'd like to create a piano like instrument (for starters). Some research lead me to a paper about modelling a piano based on waveguides:
https://quod.lib.umich.edu/i/icmc/bbp2372.1987.013/--modeling-piano-sound-using-waveguide-digital-filtering?rgn=main;view=fulltext
The author basically works with one-dimensional bidirectional waveguides. I expect the work was based on general purpose programming language(s).

I ran into quite a few challenges starting out. waveguide1 with higher frequencies would quickly decay, far too fast. I experimented with different cutoff settings and, naturally, the feedback.

Reading about waveguides with junctions and two delay lines, I wonder: following the above paper, should I model one string with two waveguide1 opcodes partially feeding back into each other?

Or is there perhaps a newer or different approach to modelling a piano that is easier to implement in Csound?

Best wishes and TIA,

Jeanette

Jeanette,

* Jeanette C. <julien@MAIL.UPB.DE> [2021-09-02 11:44]:

Hey hey,
I'd like to create a piano like instrument (for starters). Some research
lead me to a paper about modelling a piano based on waveguides:
https://quod.lib.umich.edu/i/icmc/bbp2372.1987.013/--modeling-piano-sound-using-waveguide-digital-filtering?rgn=main;view=fulltext
The author basically works with one-dimensional bidirectional waveguides. I
expect the work was based on general purpose programming language(s).

I ran into quite a few challenges starting out. waveguide1 with higher
frequencies would quickly decay, far too fast. I experimented with different
cutoff settings and, naturally, the feedback.

The pitch versus decay issue is already handled in the first paper by
Karplus&Strong, as is tuning issues (for high pitches, semitones can
amount to delay differences of less than one sample). You might want to
look there.

Reading about waveguides with junctions and two delay lines, I wonder:
following the above paper, should I model one string with two waveguide1
opcodes partially feeding back into each other?

Or is there perhaps a newer or different approach to modelling a piano that
is easier to implement in Csound?

Also check the work by Clayton Otey,
http://large.stanford.edu/courses/2007/ph210/otey2/
which has some code here
GitHub - claytonotey/qiano: A digital waveguide piano physical model with VST and command line int and a neat OteyPianoStrings class
in supercollider.

best, P

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Faust has a piano model that I have attached.

In theory this can be used with the Csound Faust opcodes, but unfortunately, although I have made many nice Csound instruments using Faust .dsp sources, this particular one does not work for me.

In theory you can get Faust to translate this to C++ code and make a plugin Csound opcode that way, but I haven’t (yet?) been able to get that to work.

Anyway, this model looks fairly complete.

Regards,
Mike

(Attachment faust_piano.dsp is missing)

Along with Karplus-Strong, there’s Julius Smith’s page at CCRMA,

https://ccrma.stanford.edu/~jos/

Modeling,… PHYSICAL AUDIO SIGNAL PROCESSING FOR VIRTUAL MUSICAL INSTRUMENTS AND AUDIO EFFECTS

and Struck string,… The Ideal Struck String

Enjoy.

-PBS

Hi Partev, Michael and Peter,
many thanks for all your pointers and resources. I'm slowly making my way, hoping to gain something along the roa. :slight_smile: It's definitely fun.

Best wishes,

Jeanette

Okay, I got this to work. There is evidently a bug in the Faust faust2csound tool, which I figured out how to work around (it’s easy).

The Faust piano does not sound nearly as good as the Pianoteq physically modelled VST plugin, but still, this opens the way to creating many new plugin opcodes from Faust code.

You can see all the files here: https://github.com/gogins/csound-extended/tree/develop/Opcodes/faust_piano

Regards,
Mike

If you let Yann Orlarey know about this bug, he’ll fix very quickly.

Prof. Victor Lazzarini
Maynooth University
Ireland

I have opened an issue for this in the Faust repository: https://github.com/grame-cncm/faust/issues/648.

Regards,
Mike

great

Prof. Victor Lazzarini
Maynooth University
Ireland