<<

Simulation of the Ribbon-Controlled Oscillator Using Energy-Balanced Modeling of Nonlinear Time-Varying Electronic Components Judy Najnudel, Thomas Hélie, David Roze

To cite this version:

Judy Najnudel, Thomas Hélie, David Roze. Simulation of the Ondes Martenot Ribbon-Controlled Oscillator Using Energy-Balanced Modeling of Nonlinear Time-Varying Electronic Components. AES - Journal of the Audio Engineering Society Audio-Accoustics-Application, Audio Engineering Society Inc, 2019, 67 (12), pp.961-971. ￿10.17743/jaes.2019.0040￿. ￿hal-02425249￿

HAL Id: hal-02425249 https://hal.archives-ouvertes.fr/hal-02425249 Submitted on 2 Sep 2020

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. PAPERS

Simulation of the Ondes Martenot ribbon-controlled oscillator using energy-balanced modelling of nonlinear time-varying electronic components

Judy NAJNUDEL, judy.najnudel@.fr AES student member

Conservation Recherche team, CNRS-Musee´ de la Musique and S3AM team, STMS laboratory, IRCAM-CNRS-SU

Thomas HELIE, [email protected] AND David ROZE [email protected]

CNRS, S3AM team, STMS laboratory, IRCAM-CNRS-SU

The Onde Martenot is a classic electronic musical instrument. This paper focuses on the power-balanced simulation of its ribbon-controlled oscillator, composed of linear, nonlinear as well as time-varying components. To this end, the proposed approach consists in formulating the circuit as a Port-Hamiltonian System, for which power-balanced numerical methods are available. A specificity of the Martenot oscillator is to involve parallel capacitors, one of them having a capacitance which non-linearly depends on the time-varying ribbon position state. In the case of linear time-invariant (LTI) capacitors in parallel, an equivalent component can be deduced using the classic impedance approach. Such a reformulation into a single equivalent component is required to derive a state-space Port-Hamiltonian representation of a circuit. One technical result of this paper is to propose a method to determine such an equivalent component in the non LTI case. This method is applied to the present Martenot oscillator. Then, power-balanced numerical experiments are presented for several configurations: fixed ribbon position, realistic and over-speed movements. These results are examined and interpreted from both the electronic and mechanical points of view.

0 Introduction components are not linear. It is multi-physical (a system can be electrical, mechanical, thermal or a mix as well) and As the audio industry is moving towards the digital era, modular (a system made of several connected PHS is still the question of the preservation of analog machines and in- a PHS). Yet for some circuit configurations, a direct state- struments is paramount. This question is especially relevant space form cannot be derived - the circuit is said not to be for the Onde Martenot, one of the first electronic musical in- realizable - and an equivalent circuit must be computed in struments [1] invented in 1928, for it is no longer produced order to perform simulations. This is the case with parallel and some of its components are now obsolete. A satisfying capacitors which must be replaced by a single equivalent solution consists in modelling its circuit in order to build capacitor. However, when the components involved in the a virtual instrument, so that the community of composers, circuit are not LTI, as some are in the controllable oscillator musicians and musicologists may at least have access to fac- of the Onde Martenot, the classic impedance approach is simile. To model electronic circuits for audio applications, no longer suitable and equivalent components must be com- the state-space form known as Port-Hamiltonian Systems puted through a specifically designed method. (PHS) has proven to be a powerful approach as it guaran- This paper is structured as follows: the Martenot control- tees the power balance of the considered system, therefore lable oscillator circuit is presented in section 2, with a par- preserves the passivity of simulations [2] even when its

J. Audio Eng. Sco., Vol. , No. , 1 NAJNUDEL ET AL. PAPERS ticular attention drawn to the realization problem it poses. Time-invariant system, the notion of impedance allows to In section 3, the PHS formalism is briefly described. In determine the equivalent capacitor. Indeed, denoting the 1 1 section 4, a method to compute equivalent components in capacitors impedances ZA = and ZB = respec- jCAω jCBω this formalism is developed. A modelling of the complete tively, Kirchoff’s laws iC = iA + iB and vC = vA = vB yield oscillator is then derived, and several configurations are the relation simulated in section 5. Finally the simulation results are 1 1 1 discussed in section 6. = + (1) ZC ZA ZB 1 Ondes Martenot ribbon-controlled oscillator This relation characterizes entirely the equivalent compo- and problem statement nent CC and gives the value of its capacitance:

1.1 Circuit overview jCCω = jCAω + jCBω ⇒ CC = CA + CB (2) The Onde Martenot, invented by Maurice Martenot in 1928, is one of the first electronic musical instruments and However, this classic impedance approach is no longer suit- is based on heterodyne processing. Heterodyning is a tech- able for non LTI systems: if we were to naively define nique used to shift high frequency signals into the audio impedance by the ratio v/i (transfer function), that of non- domain. In the Onde Martenot specifically, each one of two linear capacitors would still depend on the charge q, it- oscillators generate a high frequency quasi-sinusoidal volt- self time-dependent. By definition, time-varying capacitors age (around 80 kHz); one is fixed, and the player controls would also yield a time-dependent transfer function. As the the second frequency using a sliding ribbon. The sum of ribbon-controlled capacitance depends on the ribbon posi- these two voltages is an amplitude-modulated signal. Its tion, which itself depends on time, an adapted method to envelope is detected using a triode vacuum tube, producing characterize the equivalent capacitor is needed. The PHS an audible sound, for which the frequency is the difference formalism allows to represent an energy-storing component between the two oscillators frequencies. The triode vacuum by its energy function instead of its impedance. We thus tube in the detector is a nonlinear component which adds may rely on this notion in a non LTI case, as it is more harmonics to the signal. This enriched signal is then routed general. towards special kinds of loudspeakers (called diffuseurs) selected by the musician, adding another layer of coloration 2 Port-Hamiltonian Systems: formalism and to the sound. The oscillators are made of an LC circuit cou- examples This section recalls basics on port-Hamiltonian systems (PHS). For detailed presentation, readers can refer to [3] and [4].

2.1 Formalism Here we rely on a differential-algebraic form adapted to multi-physical systems [5][6], which allows to represent a dynamical system as a network of storage components with their state variable x and total energy of the state H(x), dissipative components with their variable w and consti- tutive law z(w), and connection ports as control inputs u and their associated outputs y such as u|y is the external power brought to the system. The variables are generally time-dependent and can be vectors. If such a system is real- izable [7][8], the flows and efforts exchanges between the Fig. 1. Schematic of the Onde 169 controllable oscillator (source: system components are coupled through a skew-symmetric Musee´ de la Musique, Paris). pled to a triode vacuum tube (for amplification), through a transformer. In the controllable oscillator, one of the ca- pacitors of the LC circuit is variable and controlled by the ribbon. Fig. 1 shows that the total capacitor is in fact made of several capacitors connected in parallel, some of them LTI, but one of them time-varying.

1.2 Problem statement Two capacitors CA and CB connected in parallel are equiv- Fig. 2. Equivalence between two parallel capacitors and a single alent to a single capacitor CC (fig. 2). In the case of a Linear capacitor.

2 J. Audio Eng. Sco., Vol. , No. , PAPERS Simulation of the Ondes Martenot ribbon-controlled oscillator using energy-balanced modelling of nonlinear time-varying electronic components matrix S = −S|:  dx    dt ∇H(x)  w  = S. z(w)  (3) −y u | {z } | {z } F (flows) E (efforts) The skew-symmetry of S guarantees that the system re- mains passive, i.e there is no spontaneous creation of energy. Indeed, from Eq. (3), the scalar product of the efforts and flows yields a E |F = E |SE = (E |SE )| = −E |SE (4) = −E |F = 0, meaning that the following power-balance is satisfied

dE = Pext − Pdiss , (5) dt |{z} |{z} |{z} u|y z(w)|w ≥ 0 | dx ∇H(x) dt where E = H(x) is the energy, Pext is the (incoming) ex- ternal power and Pdiss ≥ 0 the dissipated power. Appendix A.2 and [2] describe a numerical scheme preserving those b properties in discrete time. Fig. 3. (a) Voltage functions H0 (associated with constitutive law 2.2 Capacitors constitutive laws Eq. (6)) and (b) energy functions H for different capacitors types. For linear time-invariant capacitors, the charge q and the voltage v are mapped according to a constitutive law q = Cv, 3 Equivalent component description of non-LTI which depends on a unique characteristic constant (capac- parallel capacitors itance C in Farad). The electric power P = iv received by dE such a component makes its stored energy E vary as dt = P. 3.1 Method dq q With current i = dt , voltage v = C and assuming a zero en- 3.2 Problem statement and hypotheses ergy for a discharged component, a time integration yields Consider two capacitors connected in parallel (fig. 2). q2 dx E = H(q) with H(q) = 2C . This energy is sometimes ex- These components are flow-controlled ( = q˙ = i, current). qv dt pressed independently of value C as E = 2 . As they are connected in parallel, their dual efforts (volt- For nonlinear capacitors, the last expression in no longer ages) are equal and there is no skew-symmetric matrix S true. But a description based on an energy function q 7→ such that H(q) is still applicable. The constitutive law is described by     the voltage function H0 (derivative of H), namely, iA vA i = S. v , 0  B   B v = H (q), (6) −V I with power balance vi = H0(q) dq = dH(q) = dE . dt dt dt and formulation (3) cannot be retrieved. Replacing those parallel capacitors by a single equivalent capacitor (with Remark 1 (Constitutive laws based on q or v). In prac- common voltage v := v = vB and total current i = tice, constitutive laws are usually formulated (and mea- C A C iA + iB) allows to restore such a formulation. For linear sured) with respect to the voltage (effort) rather than the time-invariant (LTI) laws, the use of transfer functions of charge (state). Formally (if possible), such a description cor- impedance-type makes this operation straightforward. For v = H0(q) = q/C responds to invert ( for linear capacitors) non LTI laws, no characterization can be based on usual 0−1 into q = F(v) (= Cv for linear capacitors) with F = H transfer functions. In this case, energy-storing components 0−1  Cv2 and formulates the energy as E = H H (v) = 2 . Note are characterized by their energy function to be used in the that differentiating this formula yields a (correct) power PHS formalism. balance but more difficult interpretations. The purpose of this section is to derive the energy func- tion HC of the equivalent component from the energy func- This remark applies to varactors proposed in [9], with tions Hk (k = A,B) of isolated components, including for 0−1 p model H = F : v 7→ Cv/ 1 + v/v2. Another example non LTI laws, under the following hypotheses: 0 q is tanh type which is of the form q 7→ H (q) = v1 tanh( q ). 0 1 Fig. 3 shows the voltage functions and the corresponding (i) the energy function Hk is C positive-definite energy functions of these different capacitors types (for q0 (Hk(0) = 0 and Hk(x) > 0 for x 6= 0) = 7nC, v1 = 80mV, C = 50nF and v2 = 0.2V).

J. Audio Eng. Sco., Vol. , No. , 3 NAJNUDEL ET AL. PAPERS

0 (ii) the voltage function Hk (derivative of Hk) is strictly In this case, the charge of each component k is 0 increasing and definite (Hk(0) = 0) 0−1 qk = Hk (vC) According to Eq. (6), this means that the voltage vk = " #−1 0 K (12) H (qk), 0−1 0−1 k = Hk ◦ ∑ Hk (qtot) continuously and strictly increases with the charge qk, k=1 and is zero for a zero charge. In particular, the constitutive This method is adapted to other types of storage compo- law Eq. (6) makes v and q in one-to-one relation, allowing k k nents that poses similar realization problems. For instance, therefore its invertibility. it is suitable for coils in series, for which the state is the magnetic flux φ, i = H0(φ) provides the current law and the 3.3 Method voltage is v = φ˙. Moreover, when the constitutive laws of To express the total energy HC as a function of the total the components are not well known, this method can still be charge qC = qA + qB under the constraint that capacitors in used with laws interpolated from measurements. An imple- parallel share the same voltage vA = vB = vC, the method mentation of the method using piecewise linear functions is is decomposed into three steps. available in the PyPHS library [10].

Step 1: express the total charge qC = qA + qB as functions of the common voltage vA = vB = vC. 4 Simulation of the ribbon-controlled oscillator From Eq. (6), the charge of isolated components is 4.1 Ribbon-controlled oscillator modelling q = H0−1(v ), for k = A,B, (7) k k k Constitutive laws of components R1, L, C1, C2, C13 and so that the total charge depends on the common volt- C14 are supposed to be linear and described in table 4, in age as appendix A.1. The transformer is also supposed to be lin- ear, and of ratio M. The remaining components models are  0 −1 0 −1 qC = HA + HB (vC). (8) described in the next section. This function continuously and strictly increases and is zero at zero. 4.1.1 Equivalent variable capacitor Step 2: express this common voltage vC as a function of The ribbon slides between the faces of a comb-shaped the total charge qC. capacitor. As it slides, its conductive part hides and acti- vates complementary parts of the teeth that compose the − capacitor, according to the ribbon position (fig. 4). Section v = H0 −1 + H0 −1 1(q ). (9) C A B C 4.2 validates that the LTI capacitors C13 and C14 and the C Step 3: express the total energy as a function of qC. variable capacitor 15 connected in parallel are equivalent The energy values Hk(qk) of elementary components to a single variable capacitor. In order to evaluate how the k = A,B can be reformulated as functions of the total equivalent capacitor behaves with respect to its charge q and (9) (7) the ribbon position x, the position is mapped with the heard charge, using the composed functions q 7−→ v 7−→ C C frequency. The ribbon follows a dummy piano keyboard on q . Their sum yields the total energy function, that is, k which the width −1 −1 H (q ) = H ◦ H0 + H ◦ H0  −3 C C A A B B x0 = 11.10 m (13)  0 −1 0 −1 −1 ◦ HA + HB ] (qC). (10) is a [11]. These steps are detailed on examples in appendix A.3.

Remark 2 (Time-varying case). For capacitors that depend on other additional state variables (e.g. the time-varying space variable in Eq. 15, section 4.1.1), steps 1 to 3 are unchanged (these additional variables are considered as parameters in this method).

This is applied to the ribbon controlled-oscillator in sec- tion 4.

3.3.1 Generalizations This method can also be extended to K non-LTI capaci- tors connected in parallel, leading to Fig. 4. Variable capacitor of the Onde Martenot with its ribbon −1 " K # " K # control. h is the ribbon height, l is the width of a tooth, x is the 0−1 0−1 ribbon position and d the distance between the ribbon and the Htot(qtot) = ∑ Hk ◦ Hk ◦ ∑ Hk (qtot) (11) k=1 k=1 capacitor.

4 J. Audio Eng. Sco., Vol. , No. , PAPERS Simulation of the Ondes Martenot ribbon-controlled oscillator using energy-balanced modelling of nonlinear time-varying electronic components

Denoting n the semitone number where the reference 4.1.2 Triode is A1 (110 Hz, n = 0), we roughly have x = nx0 (except The triode vacuum tube is modelled with an enhanced when the ribbon slides between a B and a C or between an Norman Koren model [12]. This gives the anode current ipc E and a F where the displacement is greater). The Onde and grid current igc in function of the voltages vpc and vgc: Martenot is tuned on equal temperament, therefore the heard x ( Ex 12x0 2E1 /Kg if E1 ≥ 0 frequency from A1 is fm = A12 . Denoting F the carrier ipc = (16) frequency, the actual oscillator frequency is f = F − fm 0 else and the corresponding capacitance of the LC circuit for a ( static configuration is (ignoring the dissipative effects of the 0 if vgc < Va i = (17) triode vacuum tube for simplicity): gc vgc−Va else Rgk 1 with C(x) = x . (14) 2 12x 2 4π (F − A12 0 ) L vpc 1 vgc + Vct E1 = ln(1 + exp(Kp( + q ))) Kp µ K + v2 Fig. 5 shows C in function of x with L = 2mH and F = vb pc 10kHz. The parameters set θ = (µ,Ex,Kg,Kp,Kvb,Vct ,Va,Rgk) is retrieved from the datasheet [13] through a least squares minimization. This allows the modelling of the triode as a dissipative component in the PHS formalism, with w =     vpc ipc and zθ (w) = . vgc igc

4.1.3 Transformer and feedback loop The oscillation starts with a voltage noise Vstart at the tri- ode grid, which is amplified and filtered by the LC circuit at the triode plate before being re-injected in the grid through a transformer of ratio M. Under open circuit (negligible influence of the following stages) and small-signal (possi- ble linearization around an operating point) hypotheses, the Fig. 5. Capacitance of the variable oscillator in function of the oscillator can be represented as a system of input Vstart and ribbon position from A1 to A6.

q Based on the linear electric behaviour v = C(x) observed for any static position x, the total energy of the electro- mechanical component has the form H(q,x) = H(q = R q ξ 0,x) + 0 C(x) dξ. Moreover, the discharged component (then purely mechanical) applies no force F on the ribbon ∂H whatever the position x. This means that F = ∂x is zero at any state (q = 0,x), leading to H(q = 0,x) = H(q = 0,x = 0) = 0: the discharged component stores no pure me- chanical energy. Finally, the internal energy of the electro- mechanichal component is given by (see also fig. 6)

q2 Fig. 6. Energy function of the variable capacitor. H (q,x) = . (15) cap 2C(x)

Remark 3 (Energy time-variation). The total energy E = dE H(q,x) varies as dt = Pe + Pm where

∂H dq Pe = ∂q (q,x) dt accounts for the incoming electrical r dq ∂H q power due to current dt and voltage v = ∂q (q,x) = C(x) , ∂H dx Pm = ∂x (q,x) dt accounts for the incoming mechanical dx r power due to velocity dt and a spring reaction force 0 2 F = ∂H (q,x) = −C (x)q ∂x 2C(x)2 , induced by the capacitance variation. Fig. 7. Constitutive law of the variable capacitor.

J. Audio Eng. Sco., Vol. , No. , 5 NAJNUDEL ET AL. PAPERS output Vout (fig. 8, with µ the triode amplification factor and cording to the power-balanced numerical scheme presented ra the anode resistor). The plate load is constituted by a LC in [2] (see also the PyPHS library [10]). In order to ob- parallel circuit, with impedance (s is the Laplace variable) serve the frequency changes, we choose a carrier frequency sL F = 10kHz (instead of the actual 80 kHz) and perform Z = (18) 1 + s2LC the sweep in 2 ms (vel1) or in 0.5s (vel2). The simulation   parameters are presented in table 1. Due to important nonlin- Moreover, as Vbias is constant, ∆Vout = − Z/(Z + ra) ∆vpc earities of some components, a large sample-rate is chosen where operator ∆ denotes variations around the operating to avoid any aliasing. Table 2 recaps the components values. point. Considering the triode amplification factor defini-   We denote C1//C2 = C3 and C13//C14//C15 = C8. Figs. 9 and tion, this yields ∆Vout = Z/(Z + ra) µ(M∆Vout + Vstart ), so that FFss F vveeell1 vveeell2 ∆Vout Zµ = . (19) 768kHz 10kHz 385 m/s 1.54 m/s Vstart Z(1 − µM) + ra Table 1. Simulation parameters. The poles of transfer function (19) are found to be the roots (in s) of the characteristic equation 1 − µM s2 + s + ω2 = 0 (20) 6F5 µ Ex Kg Kp Kvb raC 0 2 1 98 1.6 2614 905 1.87 with ω0 = LC . The condition for the system to start oscil- lating is that a complex pole has a positive real part. This Vct Va Rgk leads to 0.5 0.33 1300 1 1 2ω0C ≤ M < + (21) R1 LLCC1//C2 C13//C14 V bias M µ µ gm 7.5kΩ 2mH 0.22µF 440pF 90V 1 where gm = µ/ra is the triode transconductance. The closer µ to 1/µ is chosen M, the more stable is the oscillation am- Table 2. Components parameters values. plitude. 10 show the observed flows and efforts of the oscillator as the ribbon slides. Figs. 11 and 12 show the states of the dif- ferent storage components, reflecting the frequency changes. Figs. 14 and 15 show the power balance of the complete sys- tem during the simulation. Fig. 13 shows the spectrogram of the output voltage, suggesting that the harmonic distortion is sufficiently negligible. It is also worth noting that the PHS formalism gives access to other physical parameters of the ribbon, which would otherwise prove difficult to measure. Indeed, the quantity −q2C0(x) ∇xHcap(x,q) = (22) Fig. 8. Schematic of the simplified oscillator. 2C2(x) is the force produced by the ribbon displacement (see Re- mark 3) ; figs. 16 and 17 show that the values taken by this 4.1.4 Interconnection force during the sweep are negligible no matter the sweep Replacing parallel capacitors C1//C2 with equivalent ca- velocity. pacitor C3 and C13//C14//C15 with equivalent capacitor C8, the oscillator is realizable and can be represented as the qqCC rree f qqCC rree f φ rree f following PHS: 3 8 −6 −8 −6       vel1 4.60.10 C 3.13.10 C 4.60.10 Wb vL 0 1 0 0 0 0 0 0 iL −6 −8 −6  iC8  −1 0 0 0 1 −M 0 0  vC8  vel2 4.58.10 C 4.76.10 C 4.58.10 Wb        iC3   0 0 0 −1 1 1 0 0  vC3  Table 3. Reference values.        vR1   0 0 1 0 0 0 0 0  iR1    =  .   vpc   0 −1 −1 0 0 0 1 0  ipc         vgc   0 M −1 0 0 0 0 1  igc        5 Interpretation and discussion −Ibias   0 0 0 0 −1 0 0 0 Vbias  −Istart 0 0 0 0 0 −1 0 0 Vstart Due to the nature of the Ondes Martenot instrument (rare, fragile and expensive), setting up extensive measurements to evaluate the accuracy of the oscillator model is a complex 4.2 Numerical experiments operation which is still ongoing. However, a preliminary ob- We now simulate the complete variable oscillator, sliding servation is that with the chosen parameters, the oscillation the ribbon from A1 to A6. The simulation is performed ac- is quasi-sinusoidal (less that 0.1 % harmonic distortion for

6 J. Audio Eng. Sco., Vol. , No. , PAPERS Simulation of the Ondes Martenot ribbon-controlled oscillator using energy-balanced modelling of nonlinear time-varying electronic components the second harmonic), which corresponds to observations made in [14] : ”on the whole ribbon range, the sinusoidal quality of the signal produced by the oscillator is excel- lent”. Moreover, the behaviours of the components are not affected by the ribbon displacement speed and there is no latency between the ribbon displacement and the frequency changes. This suggests that for future simulations of the complete circuit, the oscillator could be modelled with a frequency-controlled sinusoidal voltage generator, which would save computation time. It can be noted though that the output voltage of the oscillator slightly decreases as

Fig. 12. Velocity vel2 = 1.54 m/s: simulated states of the storage components during a sweep from A1 to A6 zoomed on the first 2ms. Table 3 shows the reference values.

Fig. 9. Velocity vel1 = 384 m/s: simulated flows and efforts of the storage components, for a carrier frequency F = 10kHz, during a sweep from A1 to A6. Fig. 13. Spectrogram of the output voltage during a sweep from A1 to A6.

Fig. 10. Velocity vel2 = 1.54 m/s: simulated flows and efforts of the storage components, for a carrier frequency F = 10kHz, during a sweep from A1 to A6 zoomed on the first 2ms. Fig. 14. Velocity vel1 = 384 m/s: power balance of the system during a sweep from A1 to A6.

Fig. 11. Velocity vel1 = 384 m/s: simulated states of the storage components during a sweep from A1 to A6. Table 3 shows the Fig. 15. Velocity vel2 = 1.54 m/s: power balance of the system reference values. during a sweep from A1 to A6 zoomed on the first 2ms.

J. Audio Eng. Sco., Vol. , No. , 7 REFERENCES PAPERS the heard frequency increases, which is not the case in real lent bi-variate capacitor, depending on an electric state (total Ondes Martenot. Real instruments have a higher frequency charge) and a space state (ribbon position). As a second con- carrier, therefore frequency modulations are relatively less tribution, the ideal energy function for the ribbon-controlled important. The oscillator capacitance varies less and con- equivalent capacitor is derived in correspondence with the sequently the triode amplification, which depends on its target keyboard designed by Martenot. Numerical experi- load, is stable during the whole sweep. A second observa- ments on the nonlinear time-varying circuit lead to expected tion is that consistently with the PHS formalism, the power observations: (1) the combination of the triode amplification balance is preserved despite the nonlinearities of some com- and the LC-resonator produces a quasi-sinusoidal oscilla- ponents. A third observation is that the mechanical force tion with a stable amplitude for a static configuration; (2) produced by the ribbon displacement is extremely low (less the mechanical force produced by the variable capacitor due than 10nN), thus presumably not detectable by the musician. to the ribbon displacement is undetectable by the musician This is likely to be what Maurice Martenot intended as the (less than 10nN) for over-speed movement ( 300m/s); (3) interaction between the player and the instrument should be the latency between the instantaneous frequency and the as smooth as possible. ribbon position is also undetectable. This corroborates that the Martenot’s ribbon-controlled circuit is close to an ideal oscillator. 6 Conclusion and perspectives Further work aims to model and simulate the complete In this paper, a refined simulation of the ribbon-controlled Martenot instrument, including all its stages and the dif- oscillator of the Ondes Martenot has been proposed, allow- fuseurs. Furthermore, for real-time sound synthesis pur- ing a numerical investigation of this circuit. It is based on poses, the examination of anti-aliasing methods [15] could an energy-balanced modelling adapted to LTI (capacitors, be profitable to handle the nonlinear heterodyne process at resistor, inductor) and non LTI (vacuum tube and the multi- reasonable sampling rates. physical time-varying capacitor mechanically-driven by a ribbon) components. One contribution of this paper is the de- 7 Acknowledgments sign of a method to compute equivalent energy functions of groups of components when required, to derive a PHS state- This work was funded by the Collegium Musicae and space realization of a global circuit. This method reveals is supported by the project ANR-16-CE92-0028, entitled that LTI and variable capacitors in parallel build an equiva- Interconnected Infinite-Dimensional systems for Heteroge- neous Media, INFIDHEM, financed by the French National Research Agency (ANR).

References [1] Leipp, E., “Les Ondes Martenot,” bulletin du GAM no60, 1972. [2] Falaize, A., Modelisation,´ simulation, gen´ eration´ de code et correction de systemes` multi-physiques audios: Approche par reseau´ de composants et formulation Hamiltonienne a` Ports, Ph.D. thesis, Universite´ Pierre & Marie Curie-Paris 6, 2016. [3] Duindam, V., Macchelli, A., Stramigioli, S., and Fig. 16. Velocity vel1 = 384 m/s: mechanical flow and effort Bruyninckx, H., Modeling and control of complex during a sweep from A1 to A6. physical systems: the port-Hamiltonian approach, Springer Science & Business Media, 2009. [4] van der Schaft, A., Jeltsema, D., et al., “Port- Hamiltonian systems theory: An introductory overview,” Foundations and Trends® in Systems and Control, 1(2-3), pp. 173–378, 2014. [5] Helie,´ T., Falaize, A., and Lopes, N., “Systemes` Hamil- toniens a` Ports avec approche par composants pour la simulation a` passivite´ garantie de problemes` conser- vatifs et dissipatifs,” in Colloque National en Calcul des Structures, volume 12, 2015. [6] Falaize, A. and Helie,´ T., “Passive guaranteed simu- lation of analog audio circuits: A port-Hamiltonian approach,” Applied Sciences, 6(10), p. 273, 2016. Fig. 17. Velocity vel2 = 1.54 m/s: mechanical flow and effort [7] Brockett, R. W., Finite dimensional linear systems, during a sweep from A1 to A6. volume 74, SIAM, 2015.

8 J. Audio Eng. Sco., Vol. , No. , PAPERS REFERENCES

[8] Van der Schaft, A., “A realization procedure for sys- x dx H(x) ∇H(x) tems of nonlinear higher-order differential equations,” dt 2 IFAC Proceedings Volumes, 20(5), pp. 85–90, 1987. q q C q q˙ = iC 2C C = vC [9] Sarti, A. and De Poli, G., “Toward nonlinear wave dig- φ 2 φ L φ φ˙ = vL = iL ital filters,” IEEE Transactions on Signal Processing, 2L L 47(6), pp. 1654–1668, 1999. w z(w) [10] Falaize, A. and Helie,´ T., “PyPHS: Passive model- vR R vR R = iR ing and simulation in python,” https://pyphs. Table 4. State variables and constitutive laws for a linear parallel github.io/pyphs/, 2016. RLC circuit. [11] Courrier, T., “Analyse de fonctionnement Onde 169,” 2012, unpublished document, Musee´ de la musique. [12] Cohen, I., Modelisation,´ analyse et identification de components. Kirchoff’s laws in receptor convention yield       circuits non lineaires:´ Application aux amplificateurs iC 0 −1 −1 1 vC guitare a` lampes pour la simulation en temps reel´ ,  vL   1 0 0 0 iL    =  .  Ph.D. thesis, Universite´ Pierre & Marie Curie-Paris 6,  vR   1 0 0 0 iR  2012. −V −1 0 0 0 I [13] Tung-Sol, “6F5 typical operating conditions and char- acteristics,” https://frank.pocnet.net/ Currents are flows and voltages are efforts, therefore their sheets/127/6/6F5.pdf, 1942. products are powers. Eq. (5) is thus naturally retrieved. Note [14] Courrier, T., “Analyse de fonctionnement Onde 15,” that in this simple example, the matrix S is sparse with con- 2012, unpublished document, Musee´ de la musique. stant coefficients, but the properties of the PHS formalism [15] Muller, R. and Helie,´ T., “Trajectory anti-aliasing on hold for nonlinear or coupled systems which yield more guaranteed-passive simulation of nonlinear physical complex matrices. systems,” in 20th International Conference on Digital Audio Effects (DAFx-17), 2017. A.2 PHS : numerical scheme for simulations [16] Itoh, T. and Abe, K., “Hamiltonian-conserving discrete The PHS formalism guarantees the passivity of the sys- canonical equations based on variational difference tem in continuous time. Introducing discrete gradient in quotients,” Journal of Computational Physics, 76(1), the numerical scheme [16] allows to preserve this passivity pp. 85–102, 1988. property in discrete time, therefore granting the stability of the simulation as well. Here a one-step numerical scheme is used, yielding x(k + 1) = x(k) + δx(k) (23) 8 Appendix In the mono-variate storage component case (H(x) = N ∑ Hn(xn) where N is the storage components number), A.1 PHS formalism : example n=1 the discrete gradient [∇¯ H(x,δx)]n is defined by Consider a linear parallel RLC circuit (fig.18). The ca- ( Hn(xn+δxn)−Hn(xn) if δxn 6= 0, [ ¯ H(x, x)] = δxn ∇ δ n 0 (24) Hn(xn) else. The discrete energy variation is retrieved by chain deriva- tion: δE(k) δx(k) = ∇¯ H(x,δx(k))| (25) ts ts

where ts is the sampling period. The simulation is achieved replacing dx with δx(k) and ∇H(x) with ∇¯ H(x,δx) in (3). dt ts This yields a dynamic equation of the form

δx(k) = ts fk(x(k),δx(k)) (26)

where fk is a function depending on H, z, u and S. Its solv- Fig. 18. Parallel RLC ing (using Newton-Raphson method for instance) allows to compute x(k + 1) and y(k). pacitor C and the inductor L are storage components whose A.3 Equivalent component method : examples states are given by the variables q (charge) and φ (magnetic The method steps (sec. 3) are detailed on two examples: flux) respectively ; the resistor R is a dissipative component described by Ohm’s law. The system is current (flow) con- (LTI) linear time-invariant capacitors with capacitances Ck, trolled, its associated output is a voltage (effort). Table 4 (in order to illustrate how the standard results of section 2 recaps the variables and the constitutive laws of the three are restored, and to be compared at each step to)

J. Audio Eng. Sco., Vol. , No. , 9 REFERENCES PAPERS

This leads to the following sequence of derivations. 0−1 Step 1. Eq. (7) yields qk = Hk (vk) with 0−1 (LTI): Hk (vk) = Ckvk, (28)  1/α 0−1 vk (NL): Hk (vk) = q0 , (29) Vk  0 −1 and Eq. (8) yields qC = QC(vC) with QC(vC) := HA + 0 −1 HB (vC),

(LTI): QC(vC) = (CA + CB)vC (30) a  1/α  1/α vC vC (NL): QC(vC) = q0 + q0 VA VB  1/α vC = q0 , (31) VC h −1/α −1/α i−α with VC = VA + VB . −1 Step 2. Eq. (9) yields vC = QC (qC) with −1 qC (LTI): QC (qC) = (32) CA + CB q α (NL): Q−1(q ) = V C . (33) C C C q b 0

0 Step 3. Eq. (10) yields Fig. 19. (NL) Energy functions Hk (top) and voltage functions Hk −8 C q C q (bottom) for various degrees α (q0 = 0.9.10 C and Vk = 0.5V). ( A C )2 ( B C )2 CA+CB CA+CB (LTI): HC(qC) = + 2CA 2CB (NL) capacitors with homogeneous laws of common de- q2 = C (34) gree α > 0 (nonlinear for α 6= 1, see Fig.19). 2(CA + CB) α 1+α h qC i 1/α 0 VC  Label Energy function Hk Voltage function Hk q0 q0 V q2 k k 0 qk (NL): HC(qC) = Ek LTI Hk(qk) = vk = Hk(qk) = C ∑ q 2Ck k k=A,B 0 1+α  α qk 0 qk NL Hk(qk) = Ek vk = H (qk) = Vk q k q 1+α 0 0 qc In the model (NL), [x]α = sign(x)|x|α denotes the signed = EC (35) q0 power function and constant values q0 (charge), Ek (energy) where E is found to be related to V as E to V in Eq. (27). and Vk (voltage) are related by C C k k Note that the equivalent laws for (LTI) and (NL) have the Vk = (1 + α)Ek/q0. (27) same expression. This is not the case in general.

THE AUTHORS

10 J. Audio Eng. Sco., Vol. , No. ,