Saturday, April 28, 2007

Music and Computers

This article introduces the main concepts supporting the use of computers to record, generate, edit, process, mix and play sound, and music in particular: American Institute of Physics, Conference Proceedings April 28, 2007, Volume 905, pp. 220-223.

Keywords: computer, sound, music, digital audio, sound synthesis, sequencers, MIDI.

Reprinted with permission. Copyright 2007, American Institute of Physics. This article may be downloaded for personal use only. Any other use requires prior permission of the author and the American Institute of Physics.

COMPUTERS

Electronic, digital computers are devices designed to represent objects. They are made up of a Central Processing Unit (CPU), central and external memory and some elements to interact with the final user: I/O peripherals like the keyboard, the screen or the printer. At a basic functional level, the memory is made up of a finite number of elements, each of them being in one of two possible states, and they are said to hold a bit of information each. Duly organized in packets of a certain size and with an associated address, different combinations of the status of these bits can be mapped very flexibly to different sets of objects (numbers in digit form for example).
When these representations are the elements to be transformed, or the result proper of the transformations, they are called data. When the objects represented are the operations to be performed on the data, they are called instructions and are usually grouped in programs. Some of these programs manage the whole of the system resources, and they are said to constitute the Operating System of the computer [1].
Instructions and data are fetched from memory into the CPU, where operations are performed in synchronization with an electronic clock. The external memory is usually larger than the central one, and does not need in general to be powered to keep the data.

Representable numbers in digit form

Owing to the limitation in the number of bits of any computer, when the objects to be represented are numbers in digit form (i.e.: pi as 3.14159... and not as “pi”, for example), only a finite quantity of numbers, each with a finite quantity of decimals are representable, i.e., only a finite quantity of numbers taken from of a finite subset of Q is representable. We will refer to this set as Q*, and due to the different memory capacities of different computers on one side, and to the different existing ways to represent numbers using bits on the other, the elements of Q* and the quantity of numbers that are representable will depend in general on the particular computer system under consideration.
For the purpose of this paper, we are interested in the possibilities of computers to record, create, edit, process, mix and play music, and as music is sound with a particular structure, we will first turn our attention to it.

SOUND

Sound is the name for pressure waves in elastic media like air, water or certain solids. For these sound waves to be audible, their frequency must be in the range 20Hz to 20,000Hz. In air, for example, the variations happen around the atmospheric pressure, whose standard value is 100KPa. An additional condition for sound to be audible regards the amplitude of the pressure wave, which must be above 20μPa rms. At the other end, amplitudes of around 65Pa can damage the listener’s ears. By means of microphones, sound waves can be turned into electrical waves, and these ones back into sound with the help of amplifiers and loudspeakers.
Theoretically, sound pressure (and its associated voltage signal) can be represented as a continuous function of time, typically assigning 0 to the value around which the pressure oscillates, with positive portions corresponding to overpressures and negative ones to depressures. With amplitude and time taking values on R, this continuous representation rely upon the Real Numbers Theory, that states that some real numbers (the so called irrational ones) have to be represented in digit form as a non-repeating, arbitrarily large sequence of digits belonging to a particular base.
Furthermore, continuous functions like the one described have input and output sets that contain also arbitrarily large quantities of both irrational and rational numbers. This is the limit case of the more practical ones in which, due in part to limitations in the equipment used to convert pressure into voltage, both the time and the voltage take indeed values in just another finite subset of Q, which we will call Q**. Though Q** is obviously smaller than R, it is in general much larger than Q*. In practice, this means that these so-called analog signals can’t be represented on computers.

Digital vs. Analog Sound Signals

A possible solution is to give up some precision by transforming the analog signal into another one, a digital signal, one in which both the time and the amplitude take values only in Q*. Signal Theory shows that this does work if certain conditions –easily met by current technology– are satisfied. In practice, to record sound on a computer, the transformation implies the use of an analog-to-digital converter (ADC), a system usually contained in a single integrated electronic circuit connected to the computer. The ADC takes samples of the analog signal (produced by a microphone, an electric guitar or an electronic keyboard, for example) at a rate that is at least twice the highest frequency component in the signal, and rounds off the values obtained so that all of them become members of Q*.
Note that the number of samples taken, which depends both on the sample rate and the duration of the signal, must also fit in the computer’s memory. A related process is the construction of an analog signal from the original samples by means of a digital-to-analog converter (DAC), which is carried out by holding each sample for the duration of the interval of time that separates samples, producing in this way a staircase-like signal. This signal is later smoothed out by means of a filter. If the conditions mentioned above are met, the human ear will be unable to tell the original signal from the reconstructed one.

OPERATIONS ON DIGITAL AUDIO

Once in memory, a suite of programs allows us to edit the signal (erase, split and splice portions of it) and to process it with Digital Signal Processing (DSP) techniques, adding effects like filtering, reverberation, delay, etc., all in order to achieve a particular musical result. Other interesting operations are described below.

Sampling and Sequencing

We can also sample the different notes of a particular instrument, tweak them if necessary and organize the whole into a sound library. Once in the computer’s memory, samples can be triggered to produce music, thus playing the sounds of that instrument from the computer. This can be achieved either by sending the triggering messages live from a keyboard (see MIDI below), or by having a computer program known as sequencer to automate the recording and dispatching of the triggering messages.
When we have samples from several instruments held in memory in this way, a sequencer can trigger them in a timely manner, thus opening the door to compositions for several instruments. A sequencer organizes visually the parts of the intervening instruments as a stack of tracks, and provides many tools for the composer to record, arrange and mix a piece of music. Sequencers, samplers and sound libraries are common nowadays among musicians that use computers [2].

Sound Synthesis

Another interesting possibility is the programmatic generation of sound signals, i.e., the synthesis of sound via the direct calculation of the value of each sample at a time, followed by the corresponding DAC conversion. The calculations may be based on a particular physical model, for example the differential equation that governs the vibration of a string, or may stray from physical constrains to produce a rich variety of sounds. One could apply, for instance, substractive synthesis on a signal having a rich spectral content; by removing certain frequencies with the help of filters, one can end up obtaining very interesting sounds. Additive synthesis, on the other side, proceeds by adding several simple signals to get a final sound.

MIDI

Good standards are always a boon to users and manufacturers. Back on the seventies, electronic musical equipment was becoming increasingly affordable [3]. The need to make keyboards, synthesizers, sequencers and computers –all from different manufacturers– talk to each other in a standard way gave birth to the MIDI specification in 1983. MIDI is an acronym for Musical Instruments Digital Interface, and refers to a suite of specifications covering the way devices connect to each other and the kind of messages they exchange.
For example, a keyboard connected to a computer sends the MIDI message note-on each time a key is depressed. The message carries several numbers that identify the note assigned to the key, the intensity with which the note was played, and a channel of communication from among 16 possible ones [4]. If there is a synthesizer or a sampler player program running on the computer, tuned to the channel specified by the message, it will trigger the corresponding note with the corresponding intensity. After conversion in the DAC, its sound can be heard through loudspeakers or headphones connected to the computer.
If there is instead a sequencer program running, the message can be time-stamped according to the sequencer’s clock and recorded on the computer’s memory. As each note-on message is followed by the corresponding note-off message upon the releasement of the key, the sequencer can easily figure out the duration of the sound from the time-stamping information of both messages, and optionally display that duration in a score as a particular note.
The sequencer is thus the heart of the computer-based recording studio. Besides providing a useful visual interface to the user and the possibility to record and play MIDI messages from and to external devices, high-end modern sequencers come with integrated samplers and programmable synthesizers like the ones described in this paper. Many are also capable of recording and reproducing digital audio, thus integrating in a single environment all elements conducive to modern music production.On the downside, if the computer is not fast enough, the overhead to handle many tracks of MIDI and audio data (which includes their retrieval from memory, processing, mixing, etc.) may render the overall process so slow that the computer delivers the music not in real time, but with some latency. For a fixed workload, the delays involved get shorter with each improvement in technology.

ACKNOWLEDGEMENTS

The author wishes to thank professor Antonio Alfonso Faus for his kind support on the occasion of the 8th International Symposium: “Frontiers of Fundamental Physics” held in Madrid in October 2006.

REFERENCES

  1. Gregorio Fernández Fernández and Fernando Saéz Vacas, Fundamentos de los ordenadores Vol. I., Madrid: E.T.S.I.T. Ciudad Universitaria, 1978.
  2. Palomo, Miguel, El Estudio de Grabación Personal, Madrid: Amusic, 1995.
  3. http://en.wikipedia.org/wiki/Musical_Instrument_Digital_Interface
  4. Giulio Clementi, Non solo MIDI, Ancona (Italy): Berben Edizioni Musicali, 1989.

Sunday, March 19, 2006

Educación

Me pregunto qué es conveniente enseñar en los centros educativos. Pienso que podría ser una combinación de hechos por un lado, de estímulos para que la otra parte llegue a sus propias conclusiones... y de más estímulos para que cuestione estas mismas conclusiones por otro.

Una y otra vez a lo largo de la historia se comprueba que lo que se tenía por seguro en realidad no lo era. Esto ha sucedido con asuntos que parecían evidentes: el carácter absoluto del tiempo, la posibilidad de medir algo con cualquier precisión, la posición central de la Tierra en el cosmos, la supuesta gran diferencia entre un hombre y un simio… ¿No es esto una buena razón para cuestionar lo que hoy da uno por seguro?

Otra razón para hacerlo es la posibilidad de que muchos de los problemas con los que hoy nos enfrentamos se deriven precisamente de la aplicación de principios erróneos que no se han reconocido como tales, principios que además no se investigan ni se cuestionan.

Una persona necesita conocimientos para vivir, y quizá también creencias. Además de proporcionar los primeros, la educación debería servir también para invitar a ser muy consciente de las fronteras entre unos y otras, a saber reconocer qué son hechos y qué no, y a extraer las consecuencias. Sería una tragedia que muchos de los sufrimientos de los hombres vinieran por mantener creencias que ninguno de ellos ha comprobado ni comprendido, creencias que se convierten en regentes de muchos aspectos de la vida cuando quizá paradójicamente ni siquiera se correspondan con los hechos.

Cualquiera puede comprender la utilidad inmediata del conocimiento de hechos frente a las creencias, y por tanto habrá que buscar en ciertas necesidades psicológicas el origen del fomento de las mismas. La necesidad de suprimir el miedo a lo desconocido es una de ellas. Ahora bien, si el miedo desapareciera sin intervención de las creencias, también desaparecería la necesidad de éstas para evitarlo, y con ello también el riesgo de introducir un desorden esencial en la vida.

Considero por ahora que el análisis de estas cuestiones es fundamental en la educación de los hombres.

Sunday, January 15, 2006

El Andamio

No he cambiado todavía el andamio que levanté para hacerme la casa. Es verdad que todavía no está terminada, en parte porque el plan inicial se ha ido modificando con el tiempo: ahora somos más de familia, y también he pensado en hacer un pequeño taller quitándole espacio a una habitación. El caso es que no he adaptado el andamio a estas nuevas necesidades, y aunque he pasado mucho tiempo sin plantearme esta cuestión, las molestias de todo tipo acumuladas a lo largo de los años por algo ya inútil me han forzado a pensar un poco sobre el asunto.

Creo que mi resistencia a cambiar las partes innecesarias del andamio viene de la gran inversión emocional que hice en su día, cuando pensé en lo bonita y cómoda que iba a ser mi casa, lo feliz que iba a ser en ella con mi familia y la sensación de plenitud que me embargaría. Luego, con la naturalidad de estas cosas, uní sin pensar esa felicidad imaginada al andamio, que era lo que tenía entre manos en ese momento. Esta asociación emocional ha sido tan fuerte que me ha llevado a rechazar siempre cualquier consejo para modificar el andamio.

Ahora que lo he considerado un poco me sorprenden mis reacciones, que más o menos se pueden desglosar así: al escuchar una crítica primero me embarga una gran desazón, y luego replico de forma más o menos automática defendiendo mi andamio. La primera fase es tan corta que ha estado pasando desapercibida todo este tiempo.

Ahora empiezo a ver, cuando estoy solo y sereno, que estoy condicionado por el temor a que se rompa mi querida dependencia emocional, construida y cultivada durante años. Veo también que el andamio es un símbolo de esta dependencia, y que soy por tanto doblemente dependiente: de la emoción y de su símbolo. Así, en vez de escuchar sin prejuicios a los que me hablan del asunto, el andamio se pone delante y activa mi respuesta. Claro, yo no admito todo esto delante de ellos, y siempre encuentro muchas razones putativas para rebatirlos.

Me doy cuenta ahora de la bondad de sus argumentos, pero también de que no puedo deshacerme fácilmente del andamio y de lo que representa, incluso cuando me dicen cómo ese apego innecesario me dificulta la vida, sea porque me topo con él al salir, sea porque me hace ser víctima fácil de una cohorte de aprovechados que se benefician de mi adicción: pintores de andamios, fabricantes de barras planchas y anclajes, montadores y sobre todo, hombres de publicidad que me arengan sobre las bondades intrínsecas de los andamios.

Como primer paso para recobrar mi libertad de actuación tendría que mirar de frente a mi dependencia. Pero debo reconocer que prefiero escuchar los mensajes que la refuerzan, y rodearme de personas proclives a atribuir perennidad a los andamios, y leer los libros escritos por ellas.

Además, con el paso de los días me he acostumbrado a ver el andamio a través de las ventanas, con esa manera tan especial que tiene de dividir las vistas en cuadraditos y de ocultar ciertas cosas, y ello aunque no sea natural ver el paisaje fragmentado.

Y es que construir una casa no es fácil ni rápido, y por eso su disfrute completo se ve lejano. Dejo así que el andamio me anticipe entonces un poco de esa felicidad futura, aunque tropiece con él de vez en cuando...

Sunday, September 19, 2004

Something inside

I want to show something to you
I may say you already have it
It lies deep within, but close enough
for you to watch very quietly

This wonder has no proper name
yet it contains all names known
It knows all about life and death
not being itself born or unborn

I want you to watch this, my dear
for its contemplation dazzles
to such an extreme, that I´d say
your worries will never appear

Open your eyes fully to life
Don´t judge this that you see
You deserve to share this joy
You are what you are within

Más aire, más noche

No te has ido desde ayer
Líneas rojas en tus alas
me hacen percibir de pronto
el perfil adusto de una mujer egipcia

Mi pequeña compañera,
inmóvil pero bien viva
la exaltación me ha sumergido
en el vacío primordial de la noche

Et maintenant...

La plage de Sète est longue,
Plus de sept minutes tu sais...
Je rigole avec Fernande
(le nom est affreux mon Dieu!)

Une petite Déesse
Sans rien demander me touche
Oh qu´ils sont doux les arcs de sa bouche!
Elle fait des cadeaux de rève!

Le témoin: un vent nocturne
qui vient de France, oui
Je me laisse aller bien sûr
Souffle, souffle depuis Paris!

Sunday, September 12, 2004

Sweet Angel of Love

We need you, Sweet Angel of Love
Even if your wings are crippled
you still have much to give us all
We long for what is more needed...

Let me untie the subtle knot
that stifles your gentle heart
I´ll say “let it be no more,
release this noble soul at once,

For her owner has the power
of Heavens here on Earth
Only she´s forgotten a bit
that Eternity is with her”

And by kissing your holy eyes
with the whole Universe above
you will surely realize
that you did not ever fall

Sunday, August 15, 2004

El hombre tonto

Un hombre ve con asombro
cómo la luz cegadora del tiempo
brota de una mujer sublime y sincera
de una mujer que teje versos como otros respiran

Pero este hombre es un estúpido,
e incapaz de absorber tanta dulzura
corta las alas de la ninfa...

Y como también es un tonto,
no ve su jardín secreto de caleidoscopios
que giran con cada momento

Este hombre insensible descubre tarde la profundidad de sus ojos
la sensibilidad minuciosa que disecciona el momento
la femineidad que exhala sentimientos sólidos...

Este hombre se disculpa
Este hombre agradece

No pasó nada (para el remordimiento)
Sí que pasó para el destino