Theme Lune4-128x128.png Sonification Image 1

Entendre une image / Listen to a picture

Patch Pure Data: pdExMM149-Sonification.zip

ExMM149b.png

Play
ExMM149b-Lune4.mp3
(115K)
 
Compatible:
  Pd-"Vanilla"
  + libraries:
pddp
cyclone
zexy
 
  Pd-0.43.4-extended  

Compatible:
  MacOS
  Linux
  Windows
 
Ce patch est constitué de modules ARGOPd et d'objets Pure Data reliés.  
 
Comment ça marche:
 
- Le module "Sonification" peut transformer chaque octet (ou groupe d'octets) d'un fichier en 1 échantillon Audio.
  Dans cet exemple, le fichier est une image "bit map" dont chaque pixel est transformé en 1 échantillon Audio.
 
- Ouvrir le module "Sonification":
This patch is made of ARGOPd modules and Pure Data objects interconnected.

How it works:
 
- The "Sonification" module can convert each byte (or group of bytes) of a file in one Audio sample.
  In this example, the file is a "bit map" picture in which each pixel is converted into 1 Audio sample.

- Open the "Sonification" module:
MM-Sonification.png
- L'essentiel du patch se résume à:
- The patch can be reduced to:
ExMM149-Essentiel.png
qui fonctionne si le fichier "Lune4.tif" est placé dans le même dossier.

- Voir le Help de l'objet readsf~
 
- L'image "Lune4.tif"
    est au format de couleur RGB
    occupe 922132 Bytes
    a 640 x 480 pixels.

  640 x 480 = 307200 pixels
  
- Un fichier tif (ou bmp) est constitué d'un "header" (en-tête) suivi des pixels.
  Chaque pixel RGB occupe 3 Bytes: 1 Byte rouge, 1 Byte vert, 1 Byte bleu
  307200 x 3 = 921600 Bytes
  Le header (l'en-tête) du fichier de l'image occupe donc 922132 - 921600 = 532 Bytes.
  Il est possible de choisir n'importe quel nombre pour le header.

- Mais... si header = 0 le module (readsf~) tente de lire le fichier comme si c'était un fichier Audio au format wav ou aiff.
error: dsp: xxx: unknown or bad header format
s'affiche dans la console Pd.
 
- Le module "Sonification" transforme chaque pixel de l'image en 1 échantillon Audio.
  Si on "écoute l'image" à 44100 échantillons/seconde, l'écoute a une durée de:
  307200 pixels/44100 = 6.96 secondes
  Les pixels sont lus dans l'ordre du fichier image: de gauche à droite puis de haut en bas.
 
- Un fichier image au format tif sans compression, ou au format bmp est préférable à un fichier au format jpeg ou gif qui est compressé. Tous les pixels sont présents, dans l'ordre dans un fichier non compressé.
  A faire: écouter le fichier "Lune4.gif"... décevant, proche d'un bruit blanc.
  Conseil: utiliser le logiciel ImageJ pour créer les différents formats d'un fichier image.
 
- Le module "Sonification" possède en sortie un filtre "High-pass-filter" (50Hz) commutable (objet hip~ 50) pour éliminer un niveau de signal continu souvent présent (inaudible, mais pouvant saturer un DAC).
 
- Le patch possède un filtre passe-bas réglable (module  "Flt-LP") qui permet d'atténuer les fréquences les plus hautes du signal Audio... C'est une affaire de goût...
 
- L'image dans le patch: l'objet iem_image Lune4.gif  de la library iemgui est utilisé pour afficher une image dans la fenêtre du patch. Problème: seule une image au format gif est affichable. Le fichier Lune4.gif est donc placé dans le dossier du patch "ExMM149b-Sonification.pd".
which works if the "Lune4.tif" file is placed in the same folder.

- View the Help of readsf~ object
 
- The "Lune4.tif" picture
    is in the RGB color format
    occupies 922,132 Bytes
    has 640 x 480 pixels.

  640 x 480 = 307,200 pixels
 
- A tif (or bmp) file consists of a "header" followed by the pixels.
  Each RGB pixel occupies 3 Bytes: 1 red Byte, 1 green Byte, 1 blue Byte
  307200 x 3 = 921600 Bytes
  The header of the picture file thus occupies 922,132 - 921,600 = 532 bytes.
  It is possible to choose any number for the header.

- But... if header = 0, the module (readsf~) tries to read the file as if it was an audio file in wav or aiff format.
error: dsp: xxx: unknown or bad header format
appears in the Pd console.
 
- The "Sonification" module converts each pixel of the picture to 1 audio sample.
  If we "listen to the image" at 44100 samples/second, the listening has a duration of:
  307200 pixels/44100 = 6.96 seconds
  The pixels are read in the order of the image file: from left to right then from top to bottom.
 
- An uncompressed tif or bmp format picture file is preferable to a jpeg or gif format file that is compressed. All pixels are present, in sequence, in an uncompressed file.
   To do: listen to "Lune4.gif" file... close to a white noise, disappointing.
   Tip: use ImageJ software to create the different formats of image files.
 
- The "Sonification" module includes at the output a switchable "high-pass-filter" (50Hz) (hip~ 50 object) to remove a DC signal often present (inaudible, but which can saturate a DAC).
 
- The patch include an adjustable low pass filter ("Flt-LP" module) which attenuates the higher frequencies of the Audio signal... It's a matter of taste ...
 
- The picture in the patch: the iem_image Lune4.gif object of the iemgui library is used to display an image in the window of the patch. Problem: only a gif image can be displayed. So the Lune4.gif file is placed in the folder of the patch "ExMM149b-Sonification.pd."
 
 
A voir:
 
- Les objets Pure Data soundfiler + tabread4~
  Avantage: vitesse de lecture variable
 
- Sonification d'une image avec GEM:
  Sonification Image 2
 
- L'image dans le patch avec l'objet image Lune4.gif de la library ggee (format d'image: .gif, .ppm, .pgm).
To see:
 
- Pure Data objects soundfiler + tabread4~
  Advantage: variable playback speed
 
- Picture sonification with GEM:
  Sonification Image 2
 
- The picture in the patch: with image Lune4.gif object of the ggee library (.gif, .ppm, .pgm image format).
 

 
Autre Patch: dans pd ExMM149-Sonification.zip
 
- ExMM149a-Sonification.pd -> idem ExMM149b sans affichage de l'image.

- ExMM149c-Sonification.pd -> idem ExMM149b + expansion Audio.

Le module "Sonification" peut ouvrir n'importe quel fichier
(même un fichier qui n'est pas une image).
Another Patch: in pd ExMM149-Sonification.zip
 
- ExMM149a-Sonification.pd -> same as ExMM149b without picture display.

- ExMM149c-Sonification.pd -> same as ExMM149b + Audio expansion.

The "Sonification" module can open any file
(even a file that is not a picture).
 
 
Liens: Links:
 
- Image matricielle  ../ARGOPd/wikipedia-16x16fr   ../ARGOPd/wikipedia-16x16en  Raster graphics
- Pd-"Vanilla" & Pd-Extended & ARGOPd
- ImageJ
- Sonification par Pierre Mersadier (Cumulonimbus)
- The ARSS
- photo_pianoroll (GridFlow)
- Data Sonification Archive -> 2012...

 


Paresys Accueil
24 3 2023
Valid HTML 4.01 Transitional

Paresys Home