Physical Modeling: Karplus Strong Algorithm

References

  • Vesa Välimäki. Discrete-time modeling of acoustic tubes using fractional delay filters. Helsinki University of Technology, 1995.
    [BibTeX▼]
  • Gijs de Bruin and Maarten van Walstijn. Physical models of wind instruments: A generalized excitation coupled with a modular tube simulation platform*. Journal of New Music Research, 24(2):148–163, 1995.
    [BibTeX▼]
  • Matti Karjalainen, Vesa Välimäki, and Zoltán Jánosy. Towards High-Quality Sound Synthesis of the Guitar and String Instruments. In Computer Music Association, 56–63. 1993.
    [BibTeX▼]
  • Julius O Smith. Physical modeling using digital waveguides. Computer music journal, 16(4):74–91, 1992.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 1. Journal of the Audio Engineering Society, 19(6):462–470, 1971.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 2. Journal of the Audio Engineering Society, 19(7):542–551, 1971.
    [BibTeX▼]
  • Physical Modeling: Waveguides

    Wave Equation for Virtual Strings

    The wave-equation for the one dimensional ideal string:

    \(\frac{\partial^2 y}{\partial t^2} = c^2 \frac{\partial^2 y}{\partial x^2}\)

    Solution without losses (d'Alembert):

    \(y(x,t) = y^+ (x-ct) + y^- (x+ct)$\)

    • \(y^+\) = left traveling wave
    • \(y^-\) = right traveling wave

    Tuning the String

    The velocity \(c\) depends on tension \(K\) and mass-density \(\epsilon\) of the string:

    \(c^2 = \sqrt{\frac{K}{\epsilon}} = \sqrt{\frac{K}{\rho S}}\)

    With tension \(K\), cross sectional area \(S\) and density \(\rho\) in \({\frac{g}{cm^3}}\).

    Frequency \(f\) of the vibrating string depends on the velocity and the string length:

    \(f = \frac{c}{2 L}\)

    Make it Discrete

    \(y(m,n) = y^+ (m,n) + y^- (m,n)\)

    \(t = \ nT\)

    \(x = \ mX\)

    Spatial sample distance \(X\) depends on sampling-rate \(f_s = \frac{1}{T}\) and velocity \(c\):

    \(X = cT\)


    An ideal, lossless string is represented by two delay lines with direct coupling.

    /images/Sound_Synthesis/physical_modeling/schematic_3.png

    Losses

    Losses can be implemented by inserting filters between the delay lines.

    /images/Sound_Synthesis/physical_modeling/schematic_1.png

    References

  • Vesa Välimäki. Discrete-time modeling of acoustic tubes using fractional delay filters. Helsinki University of Technology, 1995.
    [BibTeX▼]
  • Gijs de Bruin and Maarten van Walstijn. Physical models of wind instruments: A generalized excitation coupled with a modular tube simulation platform*. Journal of New Music Research, 24(2):148–163, 1995.
    [BibTeX▼]
  • Matti Karjalainen, Vesa Välimäki, and Zoltán Jánosy. Towards High-Quality Sound Synthesis of the Guitar and String Instruments. In Computer Music Association, 56–63. 1993.
    [BibTeX▼]
  • Julius O Smith. Physical modeling using digital waveguides. Computer music journal, 16(4):74–91, 1992.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 1. Journal of the Audio Engineering Society, 19(6):462–470, 1971.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 2. Journal of the Audio Engineering Society, 19(7):542–551, 1971.
    [BibTeX▼]
  • Physical Modeling: Introduction

    Physical modeling emulates actual physical processes with digital means - oscillators, resonators and acoustic impedance are modeled with buffers and filters, respectively LTI systems. Although first realized when computers had sufficient power, the foundations are much older. Hiller et al. (1971) were the first to transport the 1774 wave equation by d'Alambert to the digital domain for synthesizing sounds of plucked strings.


    Early Hardware

    Although physical modeling algorithms sound great, offer good means for control and enable the design of interesting instruments, their had less impact on the evolution of music and digital instruments. Hardware synths for physical modeling from the 1990s, like the Korg Prophecy or the Yamaha VL1 did not become a success, in the first place. There are many possible reasons for the lack of success. Cheaper and larger memory made sampling instruments more powerful and virtual analog synthesizers sounded more attractive, followed by the second wave of analog synths.

    Yamaha VL1 (1994)

    Software Instruments

    • Pianoteq Pro 6
    • Organteq Alpha
    • Strum GS 2
    • AAS Chromophone 2

    Modular

    Since simple physical models are easily implemented on small embedded systems, various modules exist on the market:

    /images/Sound_Synthesis/physical_modeling/mysteron.jpg
    /images/Sound_Synthesis/physical_modeling/rings.jpg

    Physical Models in Experimental Music

    Eikasia (1999) by Hans Tutschku was realized using the IRAM software Modalys:



    http://www.tutschku.com/content/works-eikasia.en.php

    References

  • Vesa Välimäki. Discrete-time modeling of acoustic tubes using fractional delay filters. Helsinki University of Technology, 1995.
    [BibTeX▼]
  • Gijs de Bruin and Maarten van Walstijn. Physical models of wind instruments: A generalized excitation coupled with a modular tube simulation platform*. Journal of New Music Research, 24(2):148–163, 1995.
    [BibTeX▼]
  • Matti Karjalainen, Vesa Välimäki, and Zoltán Jánosy. Towards High-Quality Sound Synthesis of the Guitar and String Instruments. In Computer Music Association, 56–63. 1993.
    [BibTeX▼]
  • Julius O Smith. Physical modeling using digital waveguides. Computer music journal, 16(4):74–91, 1992.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 1. Journal of the Audio Engineering Society, 19(6):462–470, 1971.
    [BibTeX▼]
  • Lejaren Hiller and Pierre Ruiz. Synthesizing musical sounds by solving the wave equation for vibrating objects: part 2. Journal of the Audio Engineering Society, 19(7):542–551, 1971.
    [BibTeX▼]
  • Concatenative: Crowd Noise Synthesis

    Two master's thesis in collaboration between Audiocommunication Group and IRCAM aimed at a parametric synthesis of crowd noises, more precisely of many people speaking simultaneously (Grimaldi, 2016; Knörzer, 2017). Using a concatenative approach, the resulting synthesis system can be used to dynamically change the affective state of the virtual crowd. The resulting algorithm was applied in user studies in virtual acoustic environments.

    Recordings

    The corpus of speech was gathered in two group sessions, each with five persons, in the anechoic chamber at TU Berlin. For each speaker, the recording was annotated into regions of different valence and arousal and then segmented into syllables, automatically.

    Features

    /images/Sound_Synthesis/concatenative/valence_arousal_1.png

    Synthesis

    The following example synthesizes a crowd with a valence of -90 and an arousal of 80, which can be categorized as frustrated, annoyed or upset. No virtual acoustic environment is used, and the result is rather direct:


    References

  • Grimaldi, Vincent and Böhm, Christoph and Weinzierl, Stefan and von Coler, Henrik. Parametric Synthesis of Crowd Noises in Virtual Acoustic Environments. In Proceedings of the 142nd Audio Engineering Society Convention. Audio Engineering Society, 2017.
    [BibTeX▼]
  • Christian Knörzer. Concatenative crowd noise synthesis. Master's thesis, TU Berlin, 2017.
    [BibTeX▼]
  • Vincent Grimaldi. Parametric crowd synthesis for virtualacoustic environments. Master's thesis, IRCAM, 2016.
    [BibTeX▼]
  • Diemo Schwarz. Concatenative sound synthesis: The early years. Journal of New Music Research, 35(1):3–22, 2006.
    [BibTeX▼]
  • Diemo Schwarz, Grégory Beller, Bruno Verbrugghe, and Sam Britton. Real-Time Corpus-Based Concatenative Synthesis with CataRT. In In DAFx. 2006.
    [BibTeX▼]
  • Diemo Schwarz. A System for Data-Driven Concatenative Sound Synthesis. In Proceedings of the COST-G6 Conference on Digital Audio Effects (DAFx-00). Verona, Italy, 2000.
    [BibTeX▼]
  • C. Hamon, E. Mouline, and F. Charpentier. A diphone synthesis system based on time-domain prosodic modifications of speech. In International Conference on Acoustics, Speech, and Signal Processing,, 238–241 vol.1. May 1989. doi:10.1109/ICASSP.1989.266409.
    [BibTeX▼]
  • F. Charpentier and M. Stella. Diphone synthesis using an overlap-add technique for speech waveforms concatenation. In ICASSP '86. IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 11, 2015–2018. April 1986. doi:10.1109/ICASSP.1986.1168657.
    [BibTeX▼]
  • Faust: Conditional Logic

    The select2() directive can be used as a switch condition with two cases, as shown in switch_example.dsp

    // switch_example.dsp
    //
    //
    // Henrik von Coler
    // 2020-05-28
    
    import("all.lib");
    
    // outputs 0 if x is greater 1
    // and 1 if x is below 0
    // 'l' is used as an implicit argument
    sel(l,x) = select2((x>=0), 0, 1);
    
    process = -0.1 : sel(2);
    

    Concatenative: Introduction

    Concatenative synthesis is an evolution of granular synthesis, first introduced in the context of speech synthesis and processing (Charpentier, 1986; Hamon, 1989).

    Concatenative synthesis for musical applications has been introduced by Diemo Schwarz. Corpus-based concatenative synthesis (Schwarz, 2000; Schwarz 2006) splices audio recordings into units and calculates audio features for each unit. During synthesis, unit selection can be performed by navigating the multidimensional feature space and selected units are concatenated.

    /images/Sound_Synthesis/concatenative/concatenative-flow-1.png
    [Fig.1] (Schwarz, 2006)

    /images/Sound_Synthesis/concatenative/concatenative-flow-2.png
    [Fig.2] (Schwarz, 2006)

    References

  • Grimaldi, Vincent and Böhm, Christoph and Weinzierl, Stefan and von Coler, Henrik. Parametric Synthesis of Crowd Noises in Virtual Acoustic Environments. In Proceedings of the 142nd Audio Engineering Society Convention. Audio Engineering Society, 2017.
    [BibTeX▼]
  • Christian Knörzer. Concatenative crowd noise synthesis. Master's thesis, TU Berlin, 2017.
    [BibTeX▼]
  • Vincent Grimaldi. Parametric crowd synthesis for virtualacoustic environments. Master's thesis, IRCAM, 2016.
    [BibTeX▼]
  • Diemo Schwarz. Concatenative sound synthesis: The early years. Journal of New Music Research, 35(1):3–22, 2006.
    [BibTeX▼]
  • Diemo Schwarz, Grégory Beller, Bruno Verbrugghe, and Sam Britton. Real-Time Corpus-Based Concatenative Synthesis with CataRT. In In DAFx. 2006.
    [BibTeX▼]
  • Diemo Schwarz. A System for Data-Driven Concatenative Sound Synthesis. In Proceedings of the COST-G6 Conference on Digital Audio Effects (DAFx-00). Verona, Italy, 2000.
    [BibTeX▼]
  • C. Hamon, E. Mouline, and F. Charpentier. A diphone synthesis system based on time-domain prosodic modifications of speech. In International Conference on Acoustics, Speech, and Signal Processing,, 238–241 vol.1. May 1989. doi:10.1109/ICASSP.1989.266409.
    [BibTeX▼]
  • F. Charpentier and M. Stella. Diphone synthesis using an overlap-add technique for speech waveforms concatenation. In ICASSP '86. IEEE International Conference on Acoustics, Speech, and Signal Processing, volume 11, 2015–2018. April 1986. doi:10.1109/ICASSP.1986.1168657.
    [BibTeX▼]
  • Granular: Faust Example

    The grain_player.dsp example in the repository uses four parallel grain processes, as shown in [Fig.1].

    /images/Sound_Synthesis/granular/grain_player.png
    [Fig.1] Four parallel grain players

    The code below does not handle all problem cases. Depending on the sound material, changing the grain position may result in audible clicks. For high densities, grains are retriggered before their ampltude dacays to 0 - also resulting in clicks.

    // grain_player.dsp
    //
    // Play a wave file in grains.
    //
    // - four grains
    // - glitches when changing grain position
    //
    // Henrik von Coler
    // 2020-05-28
    
    import("stdfaust.lib");
    
    // read a set of wav files
    s = soundfile("label[url:{'../WAV/chips.wav';   '../WAV/my_model.wav'; '../WAV/sine.wav'}]", 1);
    
    // a slider for selecting a sound file:
    file_idx = hslider("file_idx",0,0,2,1);
    
    // a slider for controlling the playback speed of the grains:
    speed = hslider("speed",1,-10,10,0.01);
    
    // start point for grain playback
    start = hslider("start",0,0,1,0.01);
    
    // a slider for the grain length:
    length = hslider("length",1000,1000,40000,1): si.smoo;
    
    // control the sample density (or the clock speed)
    density = hslider("density", 0.1,0.01,20,0.01);
    
    // the ramp is used for scrolling through the indices
    ramp(f, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _ : raz
    with {
    
    // keep below 1:
    raz(x) = select2 (x > 1, x, 0);
    delta = sh(f,t)/ma.SR;
    
    // sample and hold
    sh(x,t) = ba.sAndH(t,x);
    };
    
    
    // 4 impulse trains with 1/4 period phase shifts
    quad_clock(d) = os.lf_imptrain(d) <:  _ , ( _ : @(0.25*(1/d) * ma.SR)) , ( _ : @(0.5*(1/d) * ma.SR)), ( _ : @(0.75*(1/d) * ma.SR)) ;
    
    // function for a single grain
    grain(s, part, start, l,tt) = (part, pos) : outs(s) : _* win_gain
    with {
    
    // ramp from 0 to 1
    r = ramp(speed,tt);
    
    // the playback position derived from the ramp
    pos = r*l + (start*length(s));
    
    // a simple sine window
    win_gain = sin(r*3.14159);
    
    // get recent file's properties
    length(s) = part,0 : s : _,si.block(outputs(s)-1);
    srate(s)  = part,0 : s : !,_,si.block(outputs(s)-2);
    // play sample
    outs(s) = s : si.block(2), si.bus(outputs(s)-2);
    
    };
    
    
    // four parallel grain players triggered by the quad-clock
    process =  quad_clock(density) : par(i,4,grain(s, file_idx, start, length)) :> _,_;// :> _ <: _,_;
    

    Granular: Introduction

    Granular synthesis is a special form of sample based synthesis, making use of micro sections of audio material, called grains, sometimes particles or atoms. This principle can be used to manipulate sounds by time-stretching and pitch-shifting or to generate sound textures (Roads, 2004).

    Early Analog

    John Cage's Williams Mix, realized in 1952-53 shows some of the earliest granular approaches.


    Iannis Xenakis was the first to refer to Dennis Gabor's quantum theory and the elementary signal (Gabor, 1946) for musical applications.

    Early Digital

    The possibilities to use granular synthesis grew rapidly with the advent of digital sampling and new composers made use of the technique.


    Barry Truax, who was visiting the TU Studio as guest professor in 2015-16 is known as one of the pioneers of digital granular composition (Truax, 1987). His soundscape-influenced works use the technique for generating rich textures, as in Riverrun:


    Horacio Vaggione made use of granular processing for his mixed music pieces. The original Scir - for bass flute and tape (which is granular processed bass flute) - has ben produced at the TU Studio in 1988:


    In 2018, the TU Studio performed the piece with flutist Erik Drescher and made a binaural recording:


    References

  • Curtis Roads. Microsound. The MIT Press, 2004. ISBN 0262681544.
    [BibTeX▼]
  • Barry Truax. Real-time granulation of sampled sound with the dmx-1000. In ICMC. 1987.
    [BibTeX▼]
  • D. Gabor. Theory of communication. part 1: the analysis of information. Journal of the Institution of Electrical Engineers - Part III: Radio and Communication Engineering, 93(26):429–441, November 1946. doi:10.1049/ji-3-2.1946.0074.
    [BibTeX▼]
  • NIME 2020: Setup

    The experiment took place at the Small Studio at Technical University Berlin. The room features three loudspeaker systems, including a dome of 21 Genelec 8020 loudspeakers with two subwoofers. This system is used for Ambisonics rendering in the experiments of this project. For the purpose of the study furniture was removed from the studio, making it suitable for free movement in the sweet spot of the loudspeaker dome.


    /images/NIME_2020/setup_1.JPG
    [Fig.1] Studio setup for user study.

    [Fig.1] shows the studio as it was equipped for the user study. An area of about \(1 \ \mathrm{m}^2 \)is marked with tape on the floor. This area is intended as the sweet area, where participants should operate the synthesis system. A table with chair, display, mouse and keyboard is placed close the sweet area, allowing the users to change the mapping. A second table for paperwork is placed at the edges of the loudspeaker system.


    Back to NIME 2020 Contents



    Contents © Henrik von Coler 2021 - Contact