번역 1

msp Programming and Digital Audio

• msp is a set of digital audio extensions for Max. These extensions are a port of work done by Miller Puckette at IRCAM and UCSD to the Opcode Macintosh Max environment and have been programmed and marketed by David Zicarelli, the programmer of Opcode’s version of Max. The name msp has a couple of connotations: one is Max Signal Processing. Another is that msp are the initals of Miller Smith Puckette.

msp는 max의 디지털 오디오 확장된 set입니다. 이 확장은 IRCAM and UCSD에 있는 Puckette에 의해 매킨토시 환경의 맥스 옵코드로 작업 되었으며 David Zicarelli (맥스의 옵코드 버전의 프로그래머)에 의해 프로그램화, 상용화 되었습니다. Msp는 두 개의 논리로 되어있는데요, 한가지는 맥스의 signal processing이며, 또 한가지는 mas가 Miller Smith Puckette 이름의 이니셜 이라는 것입니다.

• Figure 1 shows a simple msp patch. All msp objects end with a twiddle (~) after the name of the object. Because it looks vaguely like a sine wave, the twiddle indicates that information coming into and/or out of the object is happening at the audio rate. Information in Max usually is sent whenever the user does something — plays in some MIDI, clicks with the mouse, etc. The fastest rate at which events can be scheduled to occur in Max is 1000 times per second. In audio, however, samples must be produced at the sampling rate for the sound to continue, and all msp objects update their outputs at the sampling rate (typically 44100 samples per second).

Figure 1에서는 단순한 패치를 보여줍니다. 모든 msp object들은 object name 뒤에~의 기호로 끝납니다. 이것이 sine곡선과 같은 굴곡으로 보여지기 때문에, 들어오고있는 정보나, object의 밖에서 audio rate에 벌어지고 있는 정보를 지시합니다. 보통 맥스 내의 정보는 사용자가 어떤 것을 해야 할 때 그 정보가 보내어 집니다 -미디를 플래이하거나, 마우스를 클릭하는등등. 사건들이 맥스 안에서 발생하기 위해 계획될 수 있는 가장 빠른 rate는 초당 1000번입니다. 그러나 오디오에서는 samples는 사운드를 지속시키기 위한 sampling rate에 맞추어 만들어져야 합니다. 그리고 모든 msp onject들은 그들이 출력을 sampling rate (전형적으로 초당44100)으로 업데이트 합니다.

Figure 1: 440-hz oscillator

• The dac~ object at the bottom of Figure 1 is the digital-to-analog conversion object of msp. The two inlets at the top correspond to the left and right outputs from the sound system attached to the computer. This can be simply the stereo output from the computer itself or the outputs of a sound card (such as Digidesign gear) installed on the machine. The patch as a whole takes the audio output of a cycle~ object (a simple table-lookup oscillator), reduces the amplitude by multiplication, and sends it to the dac. The startwindow and stop messages to the dac turn on audio (for this window’s patch only) and turn it off, respectively.

figure 1 의 하단에 있는 ‘dac~’object는 msp의 digital을 analog로 변환시킵니다. 상위에 있는 두 개의 inlet은 컴퓨터에 적합한 사운드 시스템으로부터 왼쪽과 오른쪽 output으로 대응됩니다. 이것은 컴퓨터 자체의 스테레오 출력으로, 또는 컴퓨터 내에 인스톨된 사운드 카드 출력(Digidesign gear같은)으로 단순화 될 수 있습니다. cycle~ object(a simple table-lookup oscillator)의 오디오 출력을 택한 패치는 multiplication에 의한 amplitude를 줄이고 dac로 전송합니다. dac로보내지는 startwindow 와 stop messages는 각각 오디오를 키거나 끌 수 있습니다.(이 윈도우 패치에서만)

• A sine wave is an example of simple harmonic motion. The wave completes one cycle of a simple back-and-forth motion at a constant rate. Because each cycle is completed in a constant amount of time, the motion of the wave is periodic. The number of cycles completed per second is the frequency of the wave, and the inverse of the frequency is its period. A wave that completes its cycle 100 times per second, then, has a frequency of 100 cycles per second (cps), also known as hertz (hz), and a period of 1/100 second, or 10 milliseconds.

사인 웨이브는 단순한 하모닉 운동의 예입니다. Wave는 반대의 rate에서 단순하게 앞 뒤로 움직이는 운동에 의해 완성되며, 그 운동은 주기성을 가집니다. 초당 만들어지는 주기의 양이 웨이브의 음높이를 결정합니다. 그리고 그 frequency의 반대(역수? 표현하기가 적당하지 않지만..)는 그것의 주기입니다. 초당 100번의 주기로 된 웨이브를 본다면 100의 cycles per second (cps), (hz라고 알려진) frequency를 가집니다. 그리고 초당 1/100 또는 millisecondf 10의 한 주기를 가집니다.

• Sampling Theorem: To represent digitally a signal containing frequency components up to X Hz, it is necessary to use a sampling rate of at least 2X samples per second. If a signal has frequency components above one-half the sampling rate, these will be misrepresented in what is termed foldover, or aliasing. The frequency that is one-half the sampling rate is called the Nyquist frequency. Each frequency “has an alias equally far from the Nyquist frequency but on the other side of it. . . For this reason the Nyquist frequency is often called the folding frequency because we can think of frequencies above Nyquist as being folded down below Nyquist” [Steiglitz p. 47]. Simplifying this a bit, we can say that when an original frequency higher than one-half the sampling rate is sampled, it will produce a new frequency that is equal to the sampling frequency minus the original frequency.

Sampling 원리 : X Hz에 이르기 위한 frequency성분을 포함하고 있는 한 신호가 보여지기 위해서는, 적어도 초당 2X샘플의 sampling rate를 사용이 요구됩니다. 만약에 한 signal이 1/2의 sampling rate보다 위인 frequency 성분을 가진다면, 이것은 초과된 것으로, 또는 위신호로 잘못 전달 될 것입니다. 이런 1/2의 sampling rate의 frequency를 the Nyquist frequency라고 합니다. 각각의 frequency는 the Nyquist frequency로부터 동등한 거리이지만 그것의 반대편에 있는 alias(허상이라고나 할까요)를 가지고 있습니다. 이런 이유로 the Nyquist frequency는 종종 the folding(‘접힌’ 이라고 생각하시면 이해가 빠를 것 같아요) frequency로 불리는데, 그 이유는 우리가 아래에 접힌 것처럼 Nyquist위에 있는 frequency를 상상할 수 있기 때문입니다. 이것의 한 조각이 단순화 될 때 우리는, 1/2의 sampling rate보다 더 높은 원래의 frequency가 sample될 때, sampling frequency 에서 원래 frequency를 땐 것과 같은 새로운 frequency가 생겨날 것이라고 말할 수 있습니다.

• Samples in msp are interpreted as floating point values within the range –1.0 to +1.0. Samples conforming to that range occupy the full dynamic spectrum when sent to the dac~ object. Therefore, to attenuate the volume of a signal, the signal should be made to occupy a smaller range of values. In Figure 1 and Figure 2 below, the attenuation is performed by multiplying the output of cycle~ by a fractional value. Multiplication by a fraction is equivalent to division (another way to reduce the range of a signal) but is more economical to perform. Adding two signals together is equivalent to mixing them. Whenever more than one signal is mixed (added) together, take care that the combined output of the mixed sources does not exceed the range –1.0 to +1.0, because outside of that range the signal will clip.

msp의 sample들은 -1.0에서 +1.0까지의 범위 내에서 부동의 값으로 설명됩니다. 샘플들은 dac~ object로 보내질 때 full dynamic spectrum이 발생하는 범위에 따릅니다. (문장에 동사가 하나 빠진 것 같은디..) 그러므로 signal의 볼륨을 희박하게 하기 위하여 signal은 작은 범위의 값이 이용되어야 합니다. Figure 1과 2에 따르면, 그 희박함은 분수 값의 cycle~출력을 곱하는 것에 의해 실행됩니다. 그 분수 값을 곱하는 것은 나눗셈과 같지만(이것은 range를 줄이는 또 다른 방법이겠지요)실행에 더 경제적입니다. 두 signal을 더하는 것은 그것들은 섞는 것과 같습니다. 하나의 시그널보다 더 많은 것이 서로 더해질 때 마다 그 혼합된 소스의 혼합된 출력이 range -1.0에서 +1.0을 초과하지 못하도록 처리됩니다. 왜냐하면 그 신호가 clip될 수 있는 범위의 출력이기 때문입니다.
—오늘은 여기까지 -_-!

msp programming and digital audio

msp Programming and Digital Audio

• msp is a set of digital audio extensions for Max. These extensions are a port of work done by Miller Puckette at IRCAM and UCSD to the Opcode Macintosh Max environment and have been programmed and marketed by David Zicarelli, the programmer of Opcode’s version of Max. The name msp has a couple of connotations: one is Max Signal Processing. Another is that msp are the initals of Miller Smith Puckette.

• Figure 1 shows a simple msp patch. All msp objects end with a twiddle (~) after the name of the object. Because it looks vaguely like a sine wave, the twiddle indicates that information coming into and/or out of the object is happening at the audio rate. Information in Max usually is sent whenever the user does something — plays in some MIDI, clicks with the mouse, etc. The fastest rate at which events can be scheduled to occur in Max is 1000 times per second. In audio, however, samples must be produced at the sampling rate for the sound to continue, and all msp objects update their outputs at the sampling rate (typically 44100 samples per second).


Figure 1: 440-hz oscillator

• The dac~ object at the bottom of Figure 1 is the digital-to-analog conversion object of msp. The two inlets at the top correspond to the left and right outputs from the sound system attached to the computer. This can be simply the stereo output from the computer itself or the outputs of a sound card (such as Digidesign gear) installed on the machine. The patch as a whole takes the audio output of a cycle~ object (a simple table-lookup oscillator), reduces the amplitude by multiplication, and sends it to the dac. The startwindow and stop messages to the dac turn on audio (for this window’s patch only) and turn it off, respectively.

• A sine wave is an example of simple harmonic motion. The wave completes one cycle of a simple back-and-forth motion at a constant rate. Because each cycle is completed in a constant amount of time, the motion of the wave is periodic. The number of cycles completed per second is the frequency of the wave, and the inverse of the frequency is its period. A wave that completes its cycle 100 times per second, then, has a frequency of 100 cycles per second (cps), also known as hertz (hz), and a period of 1/100 second, or 10 milliseconds.
• Sampling Theorem: To represent digitally a signal containing frequency components up to X Hz, it is necessary to use a sampling rate of at least 2X samples per second. If a signal has frequency components above one-half the sampling rate, these will be misrepresented in what is termed foldover, or aliasing. The frequency that is one-half the sampling rate is called the Nyquist frequency. Each frequency “has an alias equally far from the Nyquist frequency but on the other side of it. . . For this reason the Nyquist frequency is often called the folding frequency because we can think of frequencies above Nyquist as being folded down below Nyquist” [Steiglitz p. 47]. Simplifying this a bit, we can say that when an original frequency higher than one-half the sampling rate is sampled, it will produce a new frequency that is equal to the sampling frequency minus the original frequency.

• Samples in msp are interpreted as floating point values within the range –1.0 to +1.0. Samples conforming to that range occupy the full dynamic spectrum when sent to the dac~ object. Therefore, to attenuate the volume of a signal, the signal should be made to occupy a smaller range of values. In Figure 1 and Figure 2 below, the attenuation is performed by multiplying the output of cycle~ by a fractional value. Multiplication by a fraction is equivalent to division (another way to reduce the range of a signal) but is more economical to perform. Adding two signals together is equivalent to mixing them. Whenever more than one signal is mixed (added) together, take care that the combined output of the mixed sources does not exceed the range –1.0 to +1.0, because outside of that range the signal will clip.


Figure 2: Attenuation in msp

• To operate with signals digitally, we must discretize the waveform in two dimensions: in time (sampling) and in amplitude (quantizing). There are three steps to the conversion of an analog signal into a digital signal, the process called analog-to-digital conversion (ADC):

1) FILTER: A low-pass filter removes any frequency components of the signal exceeding one-half of the sampling rate.
2) MEASURE: A measurement is taken of the instantaneous amplitude of the signal at equally spaced intervals of time.
3) QUANTIZE: A quantizer assigns a precise numeric value to the measurement made in the previous step.

• The inverse process changes a digital representation to an analog one, and is called digital-to-analog conversion (DAC). In a DAC, voltage generators proportional to 2k volts are switched on when the corresponding bit k of the incoming digital representation is on. The steps of the DAC process are as follows:

1) TO VOLTAGE: The digital signal is converted to a time-varying voltage proportional to the sequence of numbers at the input.
2) TRANSIENT REMOVAL: “Glitches” introduced by step one are eliminated by ignoring fast transients.
3) FILTER: A low-pass filter set to half the sampling rate smoothes out the resultant analog signal.


Figure 3: DSP status window

• The DSP status window shows information about the configuration of digital audio on the Mac and the load a running msp program places on the central processing unit (CPU). Figure 3 shows the DSP status window during a typical execution of the simple oscillator patch of Figure 1. Notice that just running one oscillator uses almost 9% of the processing power of a Macintosh 8500/150 Power PC. The power of current CPUs to deliver digital audio directly is revolutionary, but actually using such applications quickly places a premium on processing speed.

• The cycle~ object is a table-lookup oscillator that uses a stored table of 512 samples. You can input your own sample tables or use the default sine wave. Cycle~ continuously outputs samples from the table at a frequency that corresponds to its argument (as in Figure 1) or to a value input to the left inlet.


Figure 4: cycle~ with variable frequency

• Figure 4 shows a patch with variable control over the oscillator frequency. The object line~ works like the object line, but at audio rates. Therefore the messages coming into line~ in Figure 4 will be changed into audio rate designations of frequency for the cycle~ object. Changing the value of the interpolation time into line (100 ms. in Figure 4) will change the speed with which the patch makes a portamento from one frequency to another.

• Note that the input to line~ is an ordinary Max message box. Some msp objects (such as line~ ) can take non-signal inputs and interpret these as controls over processes at the audio rate. The msp object sig~ explicitly upsamples a max value to an audio value; the object snapshot~ downsamples audio outputs to the Max range (a maximum of 1000 values per second).

• The average amplitude of a waveform is usually measured by the root-mean-square (rms) method. This works as it sounds: instantaneous measurements of amplitude are squared, summed, and averaged. The square root of the resulting number is the rms amplitude of the waveform.

• Noise is any unwanted signal added to the desired representation. Noise generally has a constant value (think of “hum”) and can be thought of as a lower limit to the range of useful signals. A commonly used measure of the presence of noise in a system is the signal-to-noise ratio (SNR), “which is usually defined as the ratio between the amplitudes of the largest useful signal and the amplitude of the inherent noise in a system.” Both amplitudes are expressed as rms values, and the SNR in decibels.
SNR (in dB) =  

• msp is very useful for experimenting with digital audio processing because so many DSP algorithms can be implemented quite directly using the objects msp provides. Rather than simply memorizing a formula such as the one above, you can use msp patches to try it out in practice. The patch shown in Figure 5 changes an amplitude value (varying between 0.0 and 1.0) to a value in decibels, using the formula shown above.


Figure 4: Amplitude to DB conversion

• MSP Exercise: Bring a Max/MSP patch to class February 26. Use MSP to implement one of the following digital signal processing techniques:
1) a low-pass filter
2) a reverb unit
3) a mixer
4) a flanger
NB: Don’t just copy the tutorial examples: do something in your patch that differs from the manual

Roads, C.. (1996) The Computer Music Tutorial. Cambridge, MA: The MIT Press.

Steiglitz, K. (1996) A Digital Signal Processing Primer New York: Addison-Wesley Publishing Company, Inc.

DC offset 원인과 해결

DC offset은 프로툴스 뿐만 아니라 다른 하드 레코딩에서도 나타날 수 있는 현상으로 알고 있습니다…그리고 DC offset을 꼭 없애야 하는 것인지 없애려면
DC offset REMOVER를 사용해야 겠죠?

DC offset 에 대하여 알기전에 먼저 DC offset문제의 시작점이 되는
AGC에 대하여 알아봅니다

AGC (Automatic Gain Control)
AGC는 수신기의 이득을 조절하여 ADC (analog-to-digital converter) 출력이
원하는 레벨을 유지 하도록 하는 기능이다.
수신 전력을 측정하여 IF 수신단 이득을 조절함으로써 ADC 입력 신호가 과도하게
켜져 ADC 출력이 overflow 되거나 ADC 입력 신호가 과도하게 작아
ADC 상위 비트가 낭비되지 않도록 하는 것이 중요하다.
DC offset 은 아날로그단 및 ADC (analog-to-digital converter)
에서 옵셋이 존재하는 경우에 AGC가 작동하면서 신호의 레벨이 한방향으로
clipping되는 현상으로 DC offset remover 는 아날로그 단 및 ADC에서 발생하는
DC 레벨 옵셋을 측정하여 보정하는 신호를 발생하여 주는 기능을 담당한다

자료출처 : postech ac.kr

제가 알고 있는 DC offset은 녹음시에 직류성분이 들어가는 것 정도로만 알고 있는데 이것이 왜 생기는 것이며 DC offset에 의해 미치는 현상은 무엇인지….
좀더 깊이 파고 들어가면…^^

ADA의 변환방식…

1) Hybrid 방식 :
Burr-Brown의 PCM67/69에 사용된 방식으로 상위의 대부분 비트는
R-2R 방식으로 변환하고 하위 2~4비트정도를 delta-sigma방식으로 변환하여
신호를 합성하는 방식이다. 이 경우 문제가 완벽한 해결이 되지는 않지만
신호에서의 왜곡이 크게 낮아지게 된다. 따라서 어느 정도 R-2R방식과
delta-sigma 방식의 장점을 겸할 수 있다.

2) Offset 방식 :
Analog Device 사의 AD1862에서 사용된 방식으로 입력된 수에 매우 큰 수
(16비트면 2^15)를 더해 모두 양수로 만들어 변환하고 나중에 숫자를 더해서 생긴 offset을 DC servo 등으로 없애주는 방식. delta-sigma 방식을 혼용하지 않으므로 S/N이 좋아 지지만 DC servo를 잘 걸지 않으면 저역이 안좋다.

3) Sign-magnitude 방식 :
이 방식은 Burr-Brown의 PCM1702에서 쓰인 방법으로 +변환용 DAC와 -변환용 DAC를 따로 두어 양수와 음수를 따로 변환하고 그 출력을 합산하여 DAC자체의 오차나
왜곡을 절감하고 zero-crossing distortion을 없애는 방법이다.
각 DAC에는 같은 부호의 숫자만 입력되므로 zero-crossing이 없다.

자료출처 : postech ac.kr

제가 경험한바에 의하면 일반적으로 BASS 녹음시에 가끔 생기곤 해서 라인 녹음시에 생기나 했더니 BRASS녹음때도 생기더군요…

DC offset은 하드레코딩 뿐 아니라 멀티, adat등 모든 디지탈에서 발생하는 것이고
컨버터의 성능에 의해 발생 빈도수가 좌우됩니다
일반적으로 kick, bass, timpani, 등 저역대에서 많이 발생하는 것을 볼 수 있습니다.
경험상 개인적으로 DC offset을 생기기 않게 하는 방법은 신호의 Gain Margin을
넉넉히 주는 것밖에는 없다고 생각합니다
아니면 아포지,프리즘같은 고가의 컨버터를 사용하는 것이지요…
괜히 비싼게 아니더군요…^^

Bob Clearmountain 형님은 Sony-3348 HR에
AD-8000 6대를 컨버터로 사용하지요… 하긴 형수님이 Apogee 사장님이니…^^

-.-…참고로 저는 그 형님과 아무 관련 없으며 오로지 에릭 형님(Eric Clipton)만
형님으로 모실뿐 입니다. ㅋㅋㅋ
밥 형님 홈 페이지인 http://www.mixthis.com에서 본 것 뿐임…^^