This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

An Audio Envelope Generator Derived from Industrial Process Control

Ashwin Pillay University of Mumbai, Mumbai, India
Abstract

Audio envelopes serve a crucial role in ensuring the versatility of synthesizers in producing timbres. To this end, the Attack, Decay, Release and Sustain (ADSR) envelope generator and its derivatives have been established as a mainstay in modern music. However, there may be merit in exploring alternate techniques to produce envelopes that could not only resemble ADSR but also be used to create novel timbres. Consequently, an attempt is made in this research to formulate the framework of a new envelope generator by redefining the Proportional-Integral-Derivative (PID) algorithm used in feedback-based process control. Additionally, a detailed analysis is made on the modes of operation and the nature of envelopes thus generated to establish it as a potential harbinger of distinctive styles of music.

1 INTRODUCTION

Ever since its advent, modern synthesizers have revolutionized the way music is produced. However, on its own, a mere triggering of the synthesizer keys may not faithfully recreate the cornucopia of sounds produced by physical instruments or those present in nature. As a result, the concept of audio envelopes was developed to control various aspects like the pitch, filter cutoff frequencies and most commonly, the amplitude of an electronically synthesized sound to increase the degrees of freedom involved with timbre generation. Envelope generators have therefore been an integral part of synthesizers right from their inception [1].

The technological advancements in digital electronics and computers ushered significant improvements in the portability, storage capabilities, and methods of sound generation available for synthesizers [2]. However, the ADSR envelope generator conceptualized initially as part of the Moog Synthesizer [1] in the 1960s continues to be a popular technique to create envelopes for both hardware and software synthesizers [2]. The main factors contributing to a wide acceptance are its relative simplicity in implementation and ability to model many musical instruments and natural sounds. While simplified variants like the attack-release (AR) and enhanced versions having the hold (AHDSR) or delay (DADSR) phases have been implemented for some synthesizers [2], the fundamentals of ADSR envelope generation have remained unchanged to a great extent.

Refer to caption
Figure 1: The ADSR envelope generator has remained the most popular choice for synthesizer manufacturers owing to its relative simplicity and versatility. During key-on, the envelope sweeps through the attack, decay and sustain phase. On key-off, it undergoes the release phase.

1.1 PID Control Scheme

Refer to caption
Figure 2: PID control acts on the error between the desired setpoint and current output of the controlled system and is essentially a combination of three main components. While the P component operates only on the immediate error, the I and D components consider the past and future errors, respectively.

The PID control strategy is considered among the most effective and widespread techniques used in industrial process control [3]. It chiefly involves producing control action as feedback to the error (E) between the desired value or setpoint (SP) and the current value of the process variable (PV) to be controlled. The action produced effectively combines the control’s three main constituents: the proportional (P), integral (I) and derivative (D) components.

While the P component is dependent only on the instantaneous difference between SP and PV, the I component records historical trends by integrating such differences over time [4]. Additionally, the D component anticipates the future course of the PV based on the rate of change of these differences. From a control theory perspective, the I component provides low-frequency compensation by adding a pole at zero, thereby regulating the steady-state error to nil [5]. Correspondingly, the D component adds high-frequency compensation by adding a pole at infinity, moderating the transient response of the controller. Ultimately, when all components are active, the PID control scheme is a form of lead-lag compensation.

Additionally, each component of PID is associated with a gain factor to adjust its contribution to the final control output; these are termed as KpK_{p}, KiK_{i} and KdK_{d}, respectively. The efficacy of a PID control depends on the values chosen for this set of gains, and sometimes even on how these values change with time [6]. To this end, several tuning methods have been developed and are beyond the scope of this research. The overall transfer function for PID control may be obtained from fig. 2 as eq. 1 in the continuous-time domain and eq. 2 in the discrete-time domain [7].

c(t)=Kpe(t)+Ki0te(τ).dτ+Kdde(t)tc(t)=K_{p}e(t)+K_{i}\int_{0}^{t}e(\tau).d\tau+K_{d}\frac{de(t)}{t} (1)
c[n]\displaystyle c[n] =c[n1]+Kp{e[n]e[n1]}+Kifse[n]\displaystyle=c[n-1]+K_{p}\{e[n]-e[n-1]\}+\frac{K_{i}}{f_{s}}e[n] (2)
+Kdfs{e[n]2e[n1]+e[n2]}\displaystyle+K_{d}f_{s}\{e[n]-2e[n-1]+e[n-2]\}
where:fs=samplingfrequency\displaystyle where:f_{s}=sampling\ frequency

While the versatility of the PID scheme has led to widespread industrial acceptance, its applications are mostly confined to being a means of achieving continuous control. There is a dearth of significant research on non-control related PID implementations in academia, posing whether such possibilities are realistic or surprisingly overlooked.

Similarly, the availability and versatility of synthesizers heralded new genres of music— often going beyond the possibilities of what classical musical instruments could produce [8]. While this led to the growing use of ADSR envelope generators in experimental endeavours, the fact that the core of the ADSR technique has withstood notable innovation might have impeded an escalation to more intriguing forms of audio synthesis. Consequently, an effort is made in this study to analyze the potentialities of a novel form of audio envelope generation, fusing two technologies whose fundamentals have withstood the wave of innovation around them: a PID based audio envelope generator, hereafter referred to as PIDEG.

This paper is organized as follows. Section 2 establishes the link between PID control and envelope generation and subsequently lays out the PIDEG framework. Section 3 discusses some of the possible design choices to be made while implementing PIDEGs in practice. Section 4 analyzes the working of PIDEGs in detail, including the possible modes of operation and the envelope shapes generated for each of them. Section 5 summarizes the study after presenting some of the potential research directions in the future. Finally, section 6 culminates the study.

2 The PID Envelope Generator

Refer to caption
Figure 3: PIDEGs extend the concept of PID control for generating audio envelopes. Like the ADSR, the envelope generation is controlled by the gate signal representing key-on when active and key-off otherwise. The shape of the envelope thus generated can be controlled by its five parameters: KpK_{p}, KiK_{i}, KdK_{d}, KrK_{r} and KfK_{f}.

The premise of PID based envelope generation lies in redefining the control scheme as a mechanism to bring the value of one entity closer to another— traditional PID controllers have a fixed SP value against which it generates an output in an attempt to get the PV value increasingly closer to SP. Audio envelopes, on the other hand, are governed by gate signals: a binary square wave corresponding to the synthesizer “key-on” when it is triggered and “key-off” otherwise.

In almost all cases, during key-on, the envelope tries to bring the aspect of sound under control (usually amplitude) towards the maximum value (100 %). Correspondingly, it brings this aspect back towards the minimum (0 %) when the key is off, as evidenced by fig. 1. In PID terminology, this may be interpreted as setting SP to 100 % on key-on and 0 % on key-off, the resulting controller output being the envelope generated. Thus, by setting desired values of KpK_{p}, KiK_{i} and KdK_{d} parameters, the shape and duration of this envelope can be controlled in a way analogous to that provided by ADSR parameters: this lays the crux of PIDEG, a PID controller reformed to generate audio envelopes (see fig. 3).

Deviating from the orthodox use of PID for feedback control, PIDEGs are robust enough to account for variations in SP value over time— the output produced by the controller at any instant of time is calculated for the instantaneous SP. This allows the use of continuous or piecewise setpoint curves to generate envelopes with increased granularity. Hence, in the generalized definition of PIDEG, the SP is referred to as the “leader” curve LC, while the envelope output is termed as the “follower” curve FC. The integration of LC adds two more control parameters to the envelope generator: the rise gain (KrK_{r}) and fall gain (KfK_{f}) factors that regulate the time taken by the LC to reach 100 % on key-on and 0 % on key-off, respectively.

3 Implementational Choices

The core concept of PIDEG defined previously is in a generalized form, leaving many degrees of freedom for audio engineers to develop varying kinds of PIDEG implementations. In this section, some of the potential areas where such design choices can be made are discussed.

3.1 LC Functions

Refer to caption
Figure 4: The inverse exponential function results in zero at infinity. Hence, it can be used without safeguards to maintain SPs within range, allowing simplicity in design.

Theoretically, there are no limitations to the kind of LCs against which a PIDEG can generate envelopes, providing considerable encouragement for experimentation in synthesizing timbres that may be beyond the possibilities of the conventional ADSR. However, it must be noted that the envelope output should be restricted within the range of 0-100 %. For most implementations, an LC having its value in this range at all times would be sufficient to allow for simplicity in design without compromising on the variety of envelope shapes that could be generated using it. Hence, the inverse-exponential function, given by eq. 3, is suggested in this study as the stock LC generating function for the PIDEG—ensuring that a sustained key-on will cause the output to saturate at 100 % while on key-off, it will eventually drop to 0 %. The LC generated using this function can be visualized by fig. 4.

LC(n)={1eKr×nfs,during keyoneKf×nfs,otherwiseLC(n)=\left\{\begin{array}[]{l}1-e^{-\frac{K_{r}\times n}{f_{s}}},\ \textrm{during }key-on\\[4.0pt] e^{-\frac{K_{f}\times n}{f_{s}}},\ otherwise\\ \end{array}\right. (3)

The trapezoidal function represented by eq. 4 is another suitable candidate for LC generation. Compared to inverse-exponential LCs, they might not lead to a wide variety in the PIDEG envelopes produced. However, being devoid of floating-point computations, generating trapezoidal LCs may be more feasible for low-resourced microcontrollers. The envelope generation, in this case, is depicted in fig. 5. Additionally, there exist numerous other LC generation functions, including the boxcar [9] and staircase functions [10], that are beyond the scope of this study.

Refer to caption
Figure 5: The trapezoidal function is suited for generating LCs in systems without floating-point units. However, its linear rise and fall tends to limit the variety of envelope shapes produced.
Refer to caption
Figure 6: By patching it to the PIDEG, the ADSR envelope generator can be used as an LC source. The PID induced oscillations present in the envelope thus generated can be used to better model tremolo effects. Whenever LC is supplied externally, the KrK_{r} and KfK_{f} PIDEG parameters are inactive.
LC(n)={min(1,Kr×nfs),during keyonmax(0,1Kf×nfs),otherwiseLC(n)=\left\{\begin{array}[]{l}\min(1,\frac{K_{r}\times n}{f_{s}}),\ \textrm{during }key-on\\[4.0pt] \max(0,1-\frac{K_{f}\times n}{f_{s}}),\ otherwise\\ \end{array}\right. (4)

For all aforementioned cases, the PIDEG parameter KrK_{r} is used to control the rate with which the LC “rises” towards 100 % on key-on. Correspondingly, the KfK_{f} parameter is used during key-off to control how quickly it “falls” back to 0 %— higher the value of these parameters, faster is the respective rise and fall.

Additionally, PIDEGs can also allow externally provided signals to become their LC source. The PID envelope generated by using an ADSR envelope as its LC is illustrated in fig. 6. Multiple envelope generators can be thus chained in series to obtain many varied and unprecedented envelope shapes. When external signals are used as LCs, the KrK_{r} and KfK_{f} parameters of PIDEG are deactivated and their set values are disregarded.

3.2 Integral Windup

Refer to caption
(a) Envelope generated for PIDEG having integral windup
Refer to caption
(b) Envelope generated without integral windup for the same set of parameters
Figure 7: Integral windup has the effect of steadily maintaining the envelope at either limit. For the same set of parameters, the envelopes generated by PIDEGs operating without windup contain oscillations with decreasing amplitudes about these limits.

Like its counterpart in the process control domain, PIDEGs are also liable to integral windup [11]— the envelope output is constrained to be strictly between 0-100 %, both inclusive. While such range limitations are problematic in control applications, they may be desirable in the case of PIDEGs. Integral windups will cause the envelope output to be constantly clamped to 100 % during prolonged durations of key-on and to 0 % on prolonged key-off as described by fig. 7a. The absence of integral windup, on the other hand, will cause oscillations in the PIDEG output about 100 % and 0 % on sustained key-on and key-off, respectively, as evidenced by fig. 7b.

Therefore, incorporating integral windup is the preference of implementers and musicians, depending upon the properties they desire in the envelope output. For instance, using PIDEGs having windup might be better suited for the generation of ambient drones. Contrarily, a PIDEG free of this property may be more amicable to model tremolo effects of string instruments like the violin. By nature, PIDEGs possess integral windup by default. However, a convenient way to avoid it is by isolating the FC output from that of the envelope. In such situations, the FC is free to assume any value resulting from per-sample PID calculations. At the same time, a hard limiter will ensure this value is within the valid range before appearing as the envelope output (EO) as described by eq. 5. While this technique seems to allow unrestricted accumulation of the integral in theory, the range of computer data units (in software) and capacitor charge limits (in analogue electronics) tend to, at best, defer the effects of windup in practice. As an alternative, any of the widely accepted anti-windup solutions [12] can also be implemented. Furthermore, software implementations of PIDEGs may include a switch to allow users to activate integral windup as per their requirement.

EO(n)=max(0,min(1,FC(n))EO(n)=\max(0,\min(1,FC(n)) (5)

3.3 Bumps in Envelope Output

“Bumps” in controller output [13] is another undesirable phenomenon in PID control that is also observable for PIDEGs. They are likely to occur when there are quick and significant changes in the LC values, like during integral windup or for step-function LCs. However, addressing these bumps is also subject to the implementor’s liking, and most of the commonly available bumpless transfer techniques should prove remedial [13]. PIDEGs that only support continuous function LCs include bumpless transfer through this constraint itself, and consequently, the bumps in the envelopes generated are negligible.

3.4 Negotiating Key-Off Instability

Refer to caption
(a) Runaway envelope generated as a result of instability in PID control. Note that the oscillations in key-off are sustained and hence, never-ending.
Refer to caption
(b) The envelope when generated with takeover mechanism kicking-in at 0.6 s
Figure 8: Similar to its applications in industrial control, the PID algorithm is prone to instabilities. In the case of PIDEGs, these appear as infinite-length envelopes during key-off. Implementing a takeover mechanism can prevent this by ensuring that envelopes eventually decay back to 0 %.

Similar to the observations in feedback control [4], the P component in PIDEGs tends to introduce instability conditions for gains higher than the ultimate gain. The D component, being sensitive to sudden changes, is also likely to do the same at higher KdK_{d} values. Meanwhile, the nature of the I component will always lead to unstable output, as discussed in section 4.1. Though instability may not be of much concern during the key-on phase and might instead be a preference, it could lead to a potentially never-ending envelope being generated during the key-off phase, as demonstrated in fig. 8a. Hence, efforts must be made to ensure that PIDEGs always result in envelopes that will drop to 0 % without compromising the effects of the control parameters during key-off.

Some of the possible ways of reducing the chances of instability are limiting the maximum gain set for KpK_{p}, KiK_{i} and KdK_{d} to one and turning off the I and D modes after some time into key-off. However, as observed in fig. 10, it might not be enough to prevent this situation. Another option would be implementing a “takeover mechanism”, a preset array of PIDEG outputs generated once a specific condition has been met during the key-off phase to ensure that the envelope eventually decays to 0 %. Particulars like the total number and values of the takeover samples and the condition at which they must be triggered are left to the implementer’s choice. For example, outputting an inverse-exponential stream of 250 envelope samples once the total number of samples generated in the key-off phase has exceeded KfK_{f}, and the envelope output has fallen under 2 %, as illustrated in fig. 8b.

4 Analysis of Envelopes Generated

To demonstrate the effect of each control parameter on the envelope shape and the modes of operations resulting from their permutations, a computer-program version of PIDEG was implemented in C language. Envelopes were generated at a sampling rate of 1 kHz, against inverse-exponential LCs having KrK_{r} = 100 and KfK_{f} = 100 (as seen in fig. 9), the integral windup being deactivated for each PID mode examined. Additionally, the D component was also turned off after 92 samples into key-off to reduce the probability of instability.

There may be endless possibilities for generating envelopes in each mode. However, only a subset is considered to understand PIDEG working in each of them as part of this section.

4.1 Single-controlled Modes

Refer to caption
(a) Kp=104K_{p}=10^{-}4
Refer to caption
(b) Kp=103K_{p}=10^{-}3
Refer to caption
(c) Kp=101K_{p}=10^{-}1
Refer to caption
(d) Kp=2K_{p}=2
Figure 9: Envelopes generated for PIDEGs operating in P-mode, against LC having Kr=Kf=100K_{r}=K_{f}=100. As the value of KpK_{p} is increased, the FC follows LC more aggressively. At values beyond one, the envelope consists of high-frequency oscillations denoted by the black bars in fig. 9d

At an elementary level, PIDEG can operate with only one of its PID controls activated at a time. In the P-mode, the KiK_{i} and KdK_{d} parameters will be set to zero, and KpK_{p} will be regulated to understand its effect on the envelope shape. Figure 9 represents the variations in envelope shape as this parameter is varied from 10410^{-4} to 2.

Since P-mode is directly proportional to the error between SP and PV, the value of KpK_{p} effectively determines the speed of overall rise and fall of the envelope on key-on and key-off, respectively. Compared with the ADSR envelope, the values of KpK_{p} and KrK_{r} as a whole are analogous to the attack time, while KpK_{p} and KfK_{f} together correspond to the release time. As observed in fig. 9a, a lower value of this parameter leads to a higher attack and release time. Contrarily, on setting higher values, the FC will tend closer to the value of LC and will have the same output eventually, as evidenced in fig. 9c. Any further increase in KpK_{p} will cause FC to oscillate about LC at half the sampling frequency as discussed in section 3.4 and seen for fig. 9d. While this may lead to the generation of desirable timbres, implementers must ensure that instability conditions are avoided by keeping a ceiling on KpK_{p} values and preventing infinite length envelopes from being produced as a result.

Refer to caption
(a) Ki=104K_{i}=10^{-}4
Refer to caption
(b) Ki=103K_{i}=10^{-}3
Refer to caption
(c) Ki=102K_{i}=10^{-}2
Refer to caption
(d) Ki=101K_{i}=10^{-}1
Figure 10: Envelopes generated for PIDEGs operating in I-mode. As the value of KiK_{i} is increased, the oscillations in the envelope produced tend to be of higher frequency (represented by the black bars) and decreasing amplitudes. Note that residue error integrals carried over from key-on may make this observation less apparent during key-off.

In the I-mode, KiK_{i} will be the sole active PIDEG parameter in operation. A phase lag is introduced to the FC thus generated and is hence sluggish in following the LC. It overcorrects the errors accumulated while lagging behind it and consequently collects an equivalent amount of error while leading. This results in oscillations occurring in the envelope about the instantaneous value of LC, with the overall output resembling FM waves as a consequence. The oscillatory nature of envelopes in this mode will lead to infinite-length envelopes, and hence, it should be used judiciously.

At lower values of KiK_{i}, the oscillations are higher in amplitude (in terms of displacement from LC) and lower in frequency; when the parameter is tuned to higher values, their amplitude decreases while frequency increases, as represented by the black bars seen in fig. 10. The explanation for this observation is that at higher values, the effect of integrating errors over time decreases, with the integral error dropping increasingly closer to zero. Therefore, the output is chiefly dependent on the instantaneous difference between LC and FC, meaning that the controller is effectively acting in the P-mode. In these situations, the KiK_{i} value is comparable to KpK_{p}. Although, it must be noted that during key-off, it may be difficult to infer this observation since the integral and starting point of envelope samples depends on the last sample of key-on. It can significantly influence the ensuing envelope shape, as is the case for fig. 10b and fig. 10c.

Finally, PIDEG operates in D-mode when only the KdK_{d} parameter is activated. Here, the envelope shape largely follows the LC curve and is a miniature version of it at lower KdK_{d} values like in fig. 11. This is because as the LC value saturates to 100 %, the differences in consecutive errors (or the first-order derivative of the error) decay to 0, saturating the envelope output in the process, the value of saturation being directly proportional to KdK_{d}.

However, at higher KdK_{d} values, the control action produced is large enough to prevent this saturation of the envelope output. In fact, the envelope consists of triangle-wave oscillations occurring at half the sampling rate as it alternates between two values that average at 50 %. However, since this implementation of PIDEG involves turning off D-mode after some time into key-off, such oscillations are not observed as the envelope decays back to zero.

Refer to caption
Figure 11: Envelopes generated for PIDEGs operating in D-mode. At lower values of KdK_{d}, the envelopes produced are weaker. However, on increasing its value beyond one, the resulting envelope contains oscillations about 50 % at half the sampling frequency, as indicated by the black bars for Kd=1K_{d}=1.

4.2 Dual-controlled Modes

Refer to caption
(a)
Refer to caption
(b)
Figure 12: Envelopes generated for PIDEGs operating in PI-mode. In this case, KpK_{p} controls how fast the envelope follows the LC. Meanwhile, KiK_{i} controls the frequency and amplitude of the oscillations present in the envelope similar to the I-mode.

In dual-controlled modes, PIDEGs operate with any two of the PID parameters activated. The resulting envelopes tend to amalgamate the effects of the individual controls that constitute each mode, with their specific contribution being proportional to the applied values.

When only KpK_{p} and KiK_{i} are varied, the PIDEG is in PI-mode. The P component, in this case, shapes the skeleton of the envelope: at higher values of KpK_{p}, it grows faster towards the LC, as observed in fig. 12a. Meanwhile, the I component controls the frequency of the oscillations in the envelope about the skeleton. Similar to the I-mode, these oscillations are of higher frequency as KiK_{i} increases, like in fig. 12b. However, one crucial difference here is that the P component negates the phase lag inertia induced by the I component. Hence, the impact of KiK_{i} on the amplitude of oscillations is negligible. The PI-mode for PIDEGs, much like its counterpart in PID control, guarantees that the controlled value will eventually match the SP [4]. Hence, it is desirable to generate audio envelopes in this mode to ensure that they settle to 100 % and 0 % without undergoing perpetual oscillations about these limits.

Refer to caption
(a)
Refer to caption
(b)
Figure 13: Envelopes generated for PIDEGs operating in PD-mode. When KdK_{d} is low, the effect of the D component is negligible, and the generator largely works in the P-mode. However, as KdK_{d} is set to values beyond one, high-frequency oscillations are induced in the envelope. Additionally, there are sudden spikes that appear at the points of transition between key-on and key-off.

In the PD-mode, where only KpK_{p} and KdK_{d} are active, the effect of the P component is similar to that of the PI-mode in shaping the envelope structure. However, the influence of the D component on the output is negligible at lower values of KdK_{d}, as is the case for fig. 13a; in these situations, the PIDEG operation is equivalent to P-mode. As KdK_{d} is increased to values greater than one, the D component kicks in sharply, producing conspicuous bumps on significant changes in LC values (e.g., while transitioning from key-on to key-off) and high-frequency oscillations in the envelope generated.

The ID-mode combines the effects of I and D components observed in the PI- and PD-modes, respectively. At lower KdK_{d} values, this mode is similar to the I-mode as observed in fig. 14a. On increasing KdK_{d}, the D component begins to growingly oppose the lag introduced by the I component. As a result, the envelope output changes steeply whenever there occurs a sudden shift in LC like in fig. 14b, causing it to oscillate at the limits faster than it would for the equivalent I-mode. Unlike the PI-mode, the changes brought by the D component are momentary and due to sudden LC changes only. As a result, envelopes generated in the ID mode are susceptible to having infinite lengths identical to those of the I-mode.

Refer to caption
(a)
Refer to caption
(b)
Figure 14: Envelopes generated for PIDEGs operating in ID-mode. Here, the KiK_{i} and KdK_{d} parameters function similar to their working in the PI- and PD-modes, respectively.

4.3 The PID Mode

Refer to caption
(a) Kp=103,Ki=104,Kd=103K_{p}=10^{-}3,K_{i}=10^{-}4,K_{d}=10^{-}3
Refer to caption
(b) Kp=102,Ki=104,Kd=103K_{p}=10^{-}2,K_{i}=10^{-}4,K_{d}=10^{-}3
Refer to caption
(c) Kp=103,Ki=103,Kd=103K_{p}=10^{-}3,K_{i}=10^{-}3,K_{d}=10^{-}3
Refer to caption
(d) Ki=103,Ki=104,Kd=1K_{i}=10^{-}3,K_{i}=10^{-}4,K_{d}=1
Figure 15: Envelopes generated for PIDEGs operating in PID-mode. By combining the effects of KpK_{p}, KiK_{i} and KdK_{d} parameters, this mode provides the highest variability in envelope shapes. Since PIDEG operation occurs at full capacity, it is recommended to benchmark them in the PID mode.

As is the case for the dual-controlled modes, the envelopes generated for the triple-controlled or PID-mode are coalescent of the discrete effects of the P, I and D components relative to the value of their respective gains. The contribution of the D component is imperceptible at lower values of KdK_{d}, with the PIDEG appearing to operate in the PI-mode in these situations. As KdK_{d} increases to higher values, the envelope output reflects sharp deviations on likewise changes in the LC. With an increase in KiK_{i} values from zero, the oscillations in envelope output have increased frequencies. As is the case for PI- and PD-modes, the KpK_{p} parameter crafts the basic shape of the envelope about which oscillations occur over time. On increasing it, the envelope saturates quicker at either limit.

The granularity provided by each control in the PID-mode appreciably increases the possibilities of generating varied envelope shapes, as evidenced by fig. 15. PIDEGs in this mode can be considered to be running at full capacity. Therefore, analyzing the performance of the PIDEG algorithm, in terms of the computational complexities involved, and drawing subsequent comparisons with popular ADSR implementations like the STK [14] should be done for the PIDEG operating in the PID-mode. However, it is beyond the scope of this research.

5 Summary

ADSR envelopes have greatly influenced the synthesis of music, both in the hardware and software domains. On the other hand, the PID scheme has been a long-term mainstay in feedback-based industrial control applications. The PIDEG framework discussed in this paper attempts to explore the possibilities of using the fundamentals of PID to generate envelopes that have a marked distinction from the standard ADSR— by extrapolating its underlying flexibilities to cause stability and controlled instability conditions preferentially. Through this study, the individual and combinatory effects of the three controlling PIDEG parameters: KpK_{p}, KiK_{i} and KdK_{d}; as well as the two LC-related parameters, KrK_{r} and KfK_{f}, were analyzed to conveniently generate envelopes having varying rates of rise and fall, apart from being marked by oscillations that constituted of changing amplitudes and frequencies with time. However, there are certain aspects of PIDEGs where further investigation may be required beyond this study.

5.1 Future Scope

5.1.1 Replicating ADSR Decay and Sustain

In the two-phased LC scheme described in section 3.1, the envelope does have the potential to display oscillatory variations on prolonged key-on durations. However, inverse-exponential or trapezoidal LCs may lack the flexibility of dropping and settling the envelope to a desired level (which could be as low as 0 %) due to their value constancy in this period. This might make it challenging for PIDEGs to model instruments like the kick drum [15], flute [16] and piano [17]. The decay and sustain phases in ADSR, on the other hand, dedicatedly serve to control this nature of the envelope. Therefore, the PIDEG scheme could benefit from adding additional curve phases once the rising inverse-exponential or trapezoidal LC has reached its peak to replicate ADSR decay and sustain modes. Alternatively, using ADSR as an LC source may also suffice, as seen in fig. 6.

5.1.2 Analogue Electronic Implementations

The envelopes discussed as part of section 4 were generated using a software implementation of the PIDEG. However, in practice, PID controllers are available in varied forms, including pneumatic and electronic systems [4]. While microcontrollers are a suitable option to realize PIDEGs as Eurorack modules or as components of non-modular synthesizers, it would also be interesting to assess the envelopes produced by purely analogue electronic PIDEGs made of capacitors, resistors and op-amps [18].

6 Conclusion

In the current form, PIDEGs may be used as an experimental basis to generate audio timbres that could not only resemble those produced by ADSR envelopes but also potentially create novel ones that are beyond its capability. The incorporation of PIDEGs into synthesizer designs could even lead to distinguishing styles of music. Nevertheless, there is enough scope to further examine PIDEG behaviour for the provided parameter inputs, among other areas of possible additions or improvements in the future, before proposing it as a competent alternative to the ADSR envelope generator.

References

  • [1] T. Pinch and F. Trocco, Analog days: the invention and impact of the Moog synthesizer.   Cambridge, Mass.; London: Harvard University Press, 2004, oCLC: 432671362.
  • [2] M. Vail, The synthesizer: a comprehensive guide to understanding, programming, playing, and recording the ultimate electronic music instrument.   New York City: Oxford University Press, 2014.
  • [3] M. G. Lin, S. Lakshminarayanan, and G. P. Rangaiah, “A Comparative Study of Recent/Popular PID Tuning Rules for Stable, First-Order Plus Dead Time, Single-Input Single-Output Processes,” Industrial & Engineering Chemistry Research, vol. 47, no. 2, pp. 344–368, Jan. 2008.
  • [4] B. G. Liptak, Ed., Instrument engineers’ handbook, 4th ed.   Boca Raton, FL: CRC Press, 2003.
  • [5] K. H. Ang, G. Chong, and Y. Li, “PID control system analysis, design, and technology,” IEEE Transactions on Control Systems Technology, vol. 13, no. 4, pp. 559–576, Jul. 2005.
  • [6] J. Y. Lee, M. Jin, and P. H. Chang, “Variable PID Gain Tuning Method Using Backstepping Control With Time-Delay Estimation and Nonlinear Damping,” IEEE Transactions on Industrial Electronics, vol. 61, no. 12, pp. 6975–6985, Dec. 2014.
  • [7] B. Sreenivasappa and R. Udaykumar, “Design and implementation of FPGA based low power digital PID controllers,” in 2009 International Conference on Industrial and Information Systems (ICIIS), Dec. 2009, pp. 568–573, iSSN: 2164-7011.
  • [8] N. Collins, M. Schedel, and S. Wilson, Electronic Music.   Cambridge: Cambridge University Press, 2013.
  • [9] E. W. Weisstein, “Boxcar Function,” publisher: From MathWorld–A Wolfram Web Resource. [Online]. Available: https://mathworld.wolfram.com/BoxcarFunction.html
  • [10] ——, “Staircase Function,” publisher: From MathWorld–A Wolfram Web Resource. [Online]. Available: https://mathworld.wolfram.com/StaircaseFunction.html
  • [11] H.-B. Shin and J.-G. Park, “Anti-Windup PID Controller With Integral State Predictor for Variable-Speed Motor Drives,” IEEE Transactions on Industrial Electronics, vol. 59, no. 3, pp. 1509–1516, Mar. 2012.
  • [12] L. R. da Silva, R. C. Flesch, and J. E. Normey-Rico, “Analysis of Anti-windup Techniques in PID Control of Processes with Measurement Noise * *This work was supported by the Brazilian National Council for Scientific and Technological Development (CNPq) under Grants 311024/2015-7 and 305785/2015-0.” IFAC-PapersOnLine, vol. 51, no. 4, pp. 948–953, 2018.
  • [13] S.-Y. Cheong and M. G. Safonov, “Improved bumpless transfer with slow-fast controller decomposition,” in 2009 American Control Conference, Jun. 2009, pp. 4346–4350, iSSN: 2378-5861.
  • [14] G. Scavone and P. Cook, “RTMidi, RTAudio, and a Synthesis Toolkit (STK) UPdate,” in Proceedings of the 2005 International Computer Music Conference, ICMC.   Barcelona, Spain: Michigan Publishing, Sep. 2005.
  • [15] L.-M. Garcia, “Beats, flesh, and grain: sonic tactility and affect in electronic dance music,” Sound Studies, vol. 1, no. 1, pp. 59–76, Jan. 2015.
  • [16] A. Ashtamoorthy, P. Prasad, S. Dhar, and D. Vijayasenan, “Frequency Contour Modeling to Synthesize Natural Flute Renditions for Carnatic Music,” in 2018 International Conference on Signal Processing and Communications (SPCOM), Jul. 2018, pp. 172–176, iSSN: 2474-915X.
  • [17] C.-T. Lee, Y.-H. Yang, and H. H. Chen, “Multipitch Estimation of Piano Music by Exemplar-Based Sparse Representation,” IEEE Transactions on Multimedia, vol. 14, no. 3, pp. 608–618, Jun. 2012.
  • [18] V. Michal, C. Premont, G. Pillonet, and N. Abouchi, “Single active element PID controllers,” in 20th International Conference Radioelektronika 2010.   Brno: IEEE, Apr. 2010, pp. 1–4.