From 96d4d223a6e2790e6269cd3b19b4944d99d61eb3 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 17 Jun 2012 09:28:18 +0000 Subject: Premiere integraation de la partie DMX. Parfois le programme rate l'initialisation ou semble freezé !! Mais l'iilumination fonctionne. La réactivité est géniale, il y a du boulot pour filtrer le plancher bruit et il y a encore un "flicker" pas sympa, je pense que ça a encore à voir avec la taille des buffers passés à la FFT... C'est très con ce pb... Les tests de cette version ont été faits avec le Netbook MSI (Ludo). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-violon-leds/trunk@21 6be1fa4d-33ac-4c33-becc-79fcb3794bb6 --- src/compute.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/compute.c') diff --git a/src/compute.c b/src/compute.c index 272d6f8..54d6929 100644 --- a/src/compute.c +++ b/src/compute.c @@ -26,7 +26,9 @@ float compute_level(const float *data, size_t nsamples, int rate) { } if (nsamples < MIN_SAMPLES) { printf("WARN : nsamples < MIN_SAMPLES : %i >= %i\n", nsamples, MIN_SAMPLES); - // Replicate with symmetry the sound to obtain an input buffer of the minimal len + return -120.f; + } + /* Replicate with symmetry the sound to obtain an input buffer of the minimal len for (i=0;i1.f) level_norm=1.f; hue=(hue+0.0002f); if (hue>1.f) hue-=1.f; - printf("%+3.1f %+1.3f\n", audio_level, level_norm); +// printf("%+3.1f %+1.3f\n", audio_level, level_norm); // Dummy code *light_h=hue; -- cgit v1.2.3