AudioResearchBlog

Covering all audio related stuff with special focus on programming and digital signal processing

Archive for August, 2007

Audio Player Wordpress plugin

Posted by hordia on 26th August 2007

De casualidad (buscando otra cosa) me topé con esto: Audio Player Wordpress plugin. Parece bastante bien logrado y lo instalé en este blog… (además en este último tiempo venia averiguando sobre estos temas, ver: “Streaming audio from your website (mp3 and ogg!)” y “Many files to stream with cortado in the same page“). Al estar basado en flash, solo soporta mp3, pero es bastante configurable y tiene cosas copadas como la posibilidad de agregar audios por defecto al inicio o al final de cada track (útil por ejemplo para anuncios comerciales en podcasts o instrucciones de uso), distintas alternativas de mostrado de los audios en el feed, configuración de colores y otras cosas más.

También se puede usar en sitios no basados en wordpress (ver tutorial) y por ejemplo es el que usa digg.com para los podcasts (ver).

Ejemplo:



, , , , , , ,

Posted in audio, music, podcast, open source, blog, Castellano, web, flash | 2 Comments »

Fundamental (in Hz) to a MIDI note

Posted by hordia on 26th August 2007

Working to have audio-to-midi in NetworkEditor (CLAM) I needed to convert a fundamental frequency value to a MIDI note one.

I found some source code related with this in Voice2MIDI app, but was not explained at all, so looking for the reason of that formula I arrived at this:

Knowing about equal-tempered scale (check this) and 2^{\frac{n}{12}} relation between frequencies plus the fact that C4 or “middle c” has a MIDI value of 60, it’s easy to conclude that then A4 (which its frequency value is 440Hz, a standard for tunning and is 9 semi-tones more) has a MIDI value of 69.

 

Then, starting with:
fundfrec = 440Hz * 2^{(\frac{1}{12})^n}

 

It’s easy to arrive at this:
fund_{midinote} = 69+log_{2^{(\frac{1}{12})}}(\frac{fundfrec}{440Hz})

 

and then, also taking in account this mathematical relation::
log_{2^{\frac{1}{12}}}(a) = log_{e}(a)*17.31234

 

the final formula looks like:
fund_{midinote} = 69+log_{e}(\frac{fundfrec}{440Hz})*17.31234

 

and a final c++ code like:

fund_midinote = round( 69. + log(fundfrec/440.)*17.31234 );

 
Related post: nictuku’s inverse formula (i.e. from MIDI to Hz) here “Translanting MIDI Notes to frequencies in the diatonic scale using the central A (440hz) as reference“.


, , , , , , , , , ,

Posted in audio, algorithms, programming, music theory, c++, midi, math, English, CLAM, standards, GSoC2007 | No Comments »

SMS interference mystery solved

Posted by hordia on 8th August 2007

Andrés Kasulin, a friend of mine from the University gave me some light about the issue of SMS interference (check “Catching (phone) SMS pulse train with CLAM…“)

He says in a comment from that post:

“I’ve found nice data in wikipedia[1].

It seems to be radiofrequency interference produced by the the phone, and filtered by the mic-cable-probes-osciloscope system. I think there is only a square pulse because the carrier frequency is much higher than filter cutoff frequency (maybe near 10^5 times).”

[1] http://en.wikipedia.org/wiki/GSM#Radio_interface

 
 

I’d add from that article:

“A nearby GSM handset is usually the source of the “dit dit dit, dit dit dit, dit dit dit” signal that can be heard from time to time on home stereo systems, televisions, computers, and personal music devices. When these audio devices are in the near field of the GSM handset, the radio signal is strong enough that the solid state amplifiers in the audio chain function as a detector. The clicking noise itself represents the power bursts that carry the TDMA signal. These signals have been known to interfere with other electronic devices, such as car stereos and portable audio players. This is a form of RFI, and could be mitigated or eliminated by use of additional shielding and/or bypass capacitors in these audio devices. However, the increased cost of doing so is difficult for a designer to justify.”

Very thanks Andrés!


, , ,

Posted in audio, noise, hardware, English | 1 Comment »

Trabajar con wavs de 8 bits en python

Posted by hordia on 6th August 2007

Hace un tiempo escribí un par de funciones para trabajar con wavs en python como si fuesen vectores, es decir, al “estilo” matlab (para más detalles ver este post “Funciones para trabajar con wav’s vectorialmente en python“).

Casualmente en la misma semana 2 personas, Cesar Perez (Colombia) y Elizabeth Coixet (España), me escribieron a este blog comentandome que estaban usando mis funciones con éxito pero tenian problemas al leer wav’s de 8 bits. Les recomendé que lo charlaramos en el grupo Buena Señal ya que entre todos (y posiblemente alguna contribución de alguno más de los del grupo) seguramente iba a ser más fácil y todos podriamos aprender algo de ello (ver estos 2 threads: 1, 2).

Y asi fue :-)

Luego de que Cesar planteara el problema y yo hiciese mis apreciaciones sobre el asunto, Elizabeth encontró que el wav de 8 bits era unsigned y no signed (como el de 16 bits) con lo que se termino de resolver el misterio de porque la solución que manejabamos leia en forma extraña…

Bueno la función queda asi:

# Example: [ y, Fs, bits ] = wavread8bits( 'filename' )
def wavread8bits( name ):
	file = wave.open( name, 'r' )
	[Channels,Bytes,Fs,Frames,Compress,CompressName] = file.getparams() # (nchannels, sampwidth in bytes, sampling frequency, nframes, comptype, compname)
	Bits = Bytes*8 # 8 bits per sample
	Data = file.readframes( Frames )
	Data = (fromstring( Data, UInt8 ) / 128.0 ) - 1.0 # -1..1 values
	print "Fs: ",Fs,"\nBits: ",Bits,"\nChannels: ",Channels
	file.close()
	return Data, Fs, Bits

 
De paso también escribí la función para escribir un wav de 8 bits.

# Example: wavwrite8bits( y, Fs, filename )
def wavwrite8bits( data_array, Fs, name ):
	file = wave.open( name, 'w' )
	file.setframerate( Fs ) # sets sampling frequency
	file.setnchannels( 1 ) # sets number of channels
	file.setsampwidth( 1 ) # number of bytes, 8 bits per sample
 
	clipped = False
	block_size = 1024*10 # write block size: 10k
	a_max = 255 # max amp
	a_min = 0 # min amp
	n = 0
	len_data_array = len( data_array ) # 1 byte (UInt8) data
	while n < len_data_array :
		frame = '' # string frame of 'block_size'
		for i in range( block_size ) :
			if n < len_data_array :
				newbyte = int( (data_array[n]+1.0) * 128 ) # ~ 255/2
				if newbyte > a_max or newbyte < a_min : clipped = True
				newbyte = min( max(newbyte,a_min), a_max ) # normalization, 0..255
				#newbyte.clip( min=a_min, max=a_max ) # normalization, 0..255
				frame += chr( newbyte & 0xFF ) # takes the byte, converts it to char and adds it to the frame
				n += 1
		file.writeframes( frame )
	if clipped == True : print "Warning: Some values were clipped"
	print "Final length:", len_data_array/512,"kb" # n*2/1024 (bytes size/1024) = n/512
	file.close()

El archivo con todas estas funciones de lectura/escritura (8 y 16 bits) es este: wav_array.py

Gracias a todos!


, , , , , ,

Posted in audio, algorithms, programming, GPL, formats, python, Castellano | No Comments »

Many files to stream with cortado in the same page

Posted by hordia on 6th August 2007

Recently I’ve added cortado applet to my server to have ogg streaming (check this) in this blog… but then I realized that does not work with many applets in the same page… (bad for a blog) so I had to move the streaming parts to many separate (new) html pages (for example one for each post or topic)

And for each one add a code like this one:

<body>
   <script language="javascript">
     function restart() {
       document.applets[0].restart(); 
     }
     function loadUrl(uri, audio) {
       document.applets[0].setParam("audio", audio); 
       document.applets[0].setParam("url", uri); 
       restart();
     }
   </script>
<applet archive="../cortado-ovt.jar" code="com.fluendo.player.Cortado.class" width="320" height="20">
<param name="url" value="" />
<param name="local" value="false" />
<param name="framerate" value="5.0" />
<param name="keepaspect" value="true" />
<param name="video" value="false" />
<param name="audio" value="true" />
<param name="seekable" value="true" />
<param name="autoPlay" value="false" />
<param name="duration" value="200" /></applet>
 
<button onClick="loadUrl('http://audiores.uint8.com.ar/files/audios/morph/Piano.ff.C5-mono-short.ogg', 'true')">
    Piano C5
   </button>
   <button onClick="loadUrl('http://audiores.uint8.com.ar/files/audios/morph/oboe.mf.C5B5-mono-short.ogg', 'true')">
    Oboe C5
   </button>
   <button onClick="loadUrl('http://audiores.uint8.com.ar/files/audios/morph/take1.ogg', 'true')">
    Take1
   </button>
   <button onClick="loadUrl('http://audiores.uint8.com.ar/files/audios/morph/take2-inverted.ogg', 'true')">
    Take2
   </button>
 </body>

To have something like this: streaming morph demos.


, , , , ,

Posted in audio, programming, English, web, java, flash | No Comments »

SMSMorph part1

Posted by hordia on 6th August 2007

Morph effect (best know in images domain) it’s about hybridize two sounds so the resulting one has intermediate characteristics. This implementation is mainly based on interpolation (peaks and residual spectrum) and a balance (depending on interpolation factor) of fundamental.

All the code is mainly based on this idea: (1. - alpha)*FirstSound + alpha*SecondSound, where alpha is the interpolation factor (bounded to 0..1 range).

SMSMorph Network

 
I’m still have to tweak it a bit… but anyway I’ve made some demos of it:

Sources: Piano C5 and Oboe C5.
Demos: Take 1, Take 2
To hear the online/streaming version go here.

Samples were taken from Freepats / Iowa Musical Instruments Samples.


, , , , , , ,

Posted in audio, algorithms, effects, signal processing, programming, English, CLAM, GSoC2007 | No Comments »

Conferencia sobre audio multicanal en Bs As

Posted by hordia on 5th August 2007

Los días 19, 20 y 21 de agosto se realizará en el hotel Panamericano de Buenos Aires (Argentina) una conferencia sobre audio multicanal. La misma tiene caracter internacional y esta organizada por AES Latinoamerica.

Esta conferencia apunta a reunir a todos los profesionales y estudiantes que tienen contacto directo o indirecto con los diferentes campos del audio. El encuentro tiene como principal misión incentivar y facilitar el intercambio de opiniones y experiencias entre todos los participantes, contando por primera vez en Latinoamérica con la presencia de numerosas personalidades del audio de máximo reconocimiento mundial.

AES Latinoamerica Conference

Los tópicos de la conferencia serán:

  • The Surround Studio
  • Surround Recording
  • Surround Mixing
  • Surround Mastering
  • Surround Live Sound
  • Surround Psychoacoustics
  • Composing for Surround
  • Surround Encoding

El programa hasta el momento es este:

programa conferencia surround aes en bs as

Todas las conferencias serán dictadas en inglés, con traducción al español.
 

También habrá una gran exposición comercial con acceso libre y gratuito con las últimas novedades en tecnología de:
AKG - ALLEN & HEATH - BEYER DYNAMICS - BSS - DBX - CAMCO - CROWN - DBA - D.A.S. AUDIO - DIGIDESIGN - FZ - JBL - LAVRY ENGINEERING - LEXICON - MEYER SOUND - MUSI-CO - NEUMANN - NEXO - R.C.F. -SELENIUM - SENNHEISER - SHURE - SOUNDCRAFT - TEVELAM - T.H.E. AUDIO - TODOMUSICA S.A - WSDG

Exhibición de:

  • Micrófonos
  • Sistemas de altavoces
  • Sistemas de monitoreo
  • Consolas de mezcla
  • Sistemas de disco rígido
  • Procesadores de audio
  • Equipamiento de medición
  • Equipamiento multimedia

También habrá varios workshops a cargo empresas. Para más detalles consultar este link: actividades.
 

Por otra parte, la lista de invitados especiales incluye a varios de los nombres más sobresalientes de la industria, por ejemplo:

Martha De Francisco: Experta en grabación y procesamiento de sonido envolvente, Martha dará una presentación teórica en conjunto con George Massenburg y luego un imperdible workshop sobre técnicas de grabación en Surround.

Kimio Hamasaki: El Investigador Senior de la compañía de broadcasting más importante del Japón, NHK (Japan Broadcasting Corporation), vendrá especialmente para disertar y demostrar las virtudes del sonido surround con altura (monitores con distintas elevaciones que otorgan un nivel de realismo nunca antes percibido).

Tomlinson Holman: El cerebro detrás del sistema universalmente conocido como THX, Tom nos mostrará su último desarrollo: el sistema 10.2, que será explicado teóricamente y demostrado en forma práctica por primera vez en América Latina.

Bob Katz: Uno de los Ingenieros de Mastering más reconocidos del mundo, autor del único libro serio editado hasta el momento sobre masterización de CD, estará presente para darnos su particular y siempre vigente punto de vista sobre este tema tan interesante.

Dan Lavry: El fundador de la muy reconocida compañía Lavry Engineering, dedicada al desarrollo de tecnología de conversión Analógica/Digital de última generación, vendrá a exponer sobre los aspectos ocultos de la conversión y el procesamiento más allá del stereo.

Jeff Levison: Consultor internacional de la firma DTS, Jeff es una personalidad reconocida en el área de codificación de audio para nuevos formatos, tales como Blu-Ray y HD-DVD. Dará una presentación y un workshop sobre la realización de mezclas en 7.1 para distintas aplicaciones.

George Massenburg: Una de las leyendas del mundo del audio, diseñador de equipos que se han utilizado en todos los estudios del mundo, George colabora asiduamente con AES desde siempre. En esta oportunidad, dará junto con Martha de Francisco una presentación teórica sobre la creciente importancia del Surround en la Ingeniería de Audio actual.

John Pellowe: convocado por Meyer Sound, John nos dará una clara explicación sobre los sistemas de arquitectura electroacústica y sus diversas aplicaciones.

John Storyk: El reconocido diseñador acústico, fundador y Presidente de Walters-Storyk Design Group, dará un seminario explicando los criterios a utilizar para el tratamiento acústico de espacios críticos, con acento en la utilización de éstos para aplicaciones de sonido Surround. John conducirá también un Studio Tour en el que mostrará la aplicación práctica de estos criterios en distintas facilidades de la Ciudad de Buenos Aires.

Wieslaw Woszczyk: Es un verdadero honor que el Presidente Mundial de AES nos visite para esta ocasión. Está a su cargo la inauguración oficial de la Conferencia y luego una muy recomendable presentación teórica sobre Comunicación Multisensorial de la música y el espacio.

El panel “Sonido Surround Platinum” está compuesto por Martha De Francisco, Tomlinson Holman, Bob Katz, Kimio Hamasaki, John Storyk, y John Pellowe; junto con los músicos y productores Pedro Aznar, Pablo Guyot y Tweety Gonzalez.

Para descargar la ficha de inscripción a la conferencia o consultar más información relacionada visite www.americalatina.aes.org.

Se entregará certificado de asistencia expedido por AES. Vacantes Limitadas.


, , , , , , , , , , , ,

Posted in audio, acoustics, music, instruments, hardware, Castellano, talks, news, events, surround, conferences, sound | No Comments »

Streaming audio from your website (mp3 and ogg!)

Posted by hordia on 1st August 2007

If you noticed, in my last post I had added ready to play demos through del.icio.us streaming script, which it’s really simple, you only have to copy the code below and place it in anywhere you want in your HTML and your mp3 links will automatically become playable.

<script type="text/javascript" src="http://del.icio.us/js/playtagger"></script>

Then you have something like this: Elvis harmonized

 
There are many other options like odeo players with different sizes and also ready to embed where you want… Indeed, this google player (flash based) should work too:

<iframe style="border: 1px solid rgb(170, 170, 170); width: 500px; height: 25px;" id="musicPlayer"
src="http://mail.google.com/mail/html/audio.swf?audioUrl=URLMP3FILE MP3"></iframe>

 
But all those implementations only work with mp3 files and aren’t free software…, and that was annoying me a little (check this) so I was looking for ogg vorbis alternatives… and luckily I found one: Cortado.

It’s a Java applet from Fluendo which is able to play Ogg Theora, Ogg Vorbis, Mulaw audio, MJPEG and his own Smoke codec. It’s also free software and it’s released under GPL. As I read only works with SUN’s jre version… so isn’t completely free either… but I think is closer and I can choose ogg files again… btw, SUN java version should (or at least they say that) be GPL compatible very soon…

The bad thing: has poorly documentation (and not clear)… anyway I managed to get it working. I’ve downloaded the ogg vorbis last pre-compiled jar file and with an applet code like below, I get it working more or less quickly.

<applet archive="cortado-ovt.jar" code="com.fluendo.player.Cortado.class" width="320" height="20">
<param name="url" value="http://audiores.uint8.com.ar/files/audios/elvis-harmonized.ogg" />
<param name="local" value="false" />
<param name="framerate" value="5.0" />
<param name="keepaspect" value="true" />
<param name="video" value="false" />
<param name="audio" value="true" />
<param name="seekable" value="true" />
<param name="autoPlay" value="false" />
<param name="duration" value="203" /></applet>

Then you have something like this:

enjoy!

Update: For many applets in the same page check this post: “Many files to stream with cortado in the same page


, , , , , , , , , ,

Posted in audio, music, free software, podcast, programming, GPL, blog, English, web, java, flash | 8 Comments »

 
Cerrar
Enviar por Correo