<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>LICENSE/agpl-3.0.txt</filename>
    </added>
    <added>
      <filename>LICENSE/agplv3-155x51.png</filename>
    </added>
    <added>
      <filename>LICENSE/javascript_preamble.js</filename>
    </added>
    <added>
      <filename>LICENSE/python_preamble.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,25 @@
+/*
+* player.js -- sound playback using soundManager and only HTML elements
+* Copyright (C) 2008 MUSIC TECHNOLOGY GROUP (MTG)
+*                    UNIVERSITAT POMPEU FABRA
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as
+* published by the Free Software Foundation, either version 3 of the
+* License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
+*
+* Authors:
+*   Bram de Jong &lt;bram.dejong at domain.com where domain in gmail&gt;
+*/
+
 soundManager.debugMode = false;
   
 soundManager.onload = function() {</diff>
      <filename>sandbox/player/player.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,28 @@
-import optparse, math
+#!/usr/bin/env python
+
+# wav2png.py -- converts wave files to wave file and spectrogram images
+# Copyright (C) 2008 MUSIC TECHNOLOGY GROUP (MTG)
+#                    UNIVERSITAT POMPEU FABRA
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
+#
+# Authors:
+#   Bram de Jong &lt;bram.dejong at domain.com where domain in gmail&gt;
+
+__author__ = &quot;Bram de Jong &lt;bram.dejong@domain.com where domain is gmail &gt;&quot;
+
+import optparse, math, sys
 import scikits.audiolab as audiolab
 import Image, ImageDraw, ImageColor
 import numpy
@@ -340,7 +364,14 @@ def create_png(input_filename, output_filename_w, output_filename_s, image_width
     waveform = WaveformImage(image_width, image_height)
     spectrogram = SpectrogramImage(image_width, image_height, fft_size)
     
+    print &quot;  &quot;,
+    
     for x in range(image_width):
+        
+        if x % (image_width/10) == 0:
+            sys.stdout.write('.')
+            sys.stdout.flush()
+            
         seek_point = int(x * samples_per_pixel)
         next_seek_point = int( (x + 1) * samples_per_pixel)
         
@@ -349,34 +380,53 @@ def create_png(input_filename, output_filename_w, output_filename_s, image_width
         
         waveform.draw_peaks(x, peaks, spectral_centroid)
         spectrogram.draw_spectrum(x, db_spectrum)
-        
     
+    print &quot; done&quot;
+   
     waveform.save(output_filename_w)
     spectrogram.save(output_filename_s)
 
 
 if __name__ == '__main__':
-    parser = optparse.OptionParser(&quot;usage: %prog [options] input-filename output-filename-wave output-filename-spectrogram&quot;, conflict_handler=&quot;resolve&quot;)
+    parser = optparse.OptionParser(&quot;usage: %prog [options] input-filename&quot;, conflict_handler=&quot;resolve&quot;)
+    parser.add_option(&quot;-a&quot;, &quot;--waveout&quot;, action=&quot;store&quot;, dest=&quot;output_filename_w&quot;, type=&quot;string&quot;, help=&quot;output waveform image (default input filename + _w.png)&quot;)
+    parser.add_option(&quot;-s&quot;, &quot;--specout&quot;, action=&quot;store&quot;, dest=&quot;output_filename_s&quot;, type=&quot;string&quot;, help=&quot;output spectrogram image (default input filename + _s.png)&quot;)
     parser.add_option(&quot;-w&quot;, &quot;--width&quot;, action=&quot;store&quot;, dest=&quot;image_width&quot;, type=&quot;int&quot;, help=&quot;image width in pixels (default %default)&quot;)
     parser.add_option(&quot;-h&quot;, &quot;--height&quot;, action=&quot;store&quot;, dest=&quot;image_height&quot;, type=&quot;int&quot;, help=&quot;image height in pixels (default %default)&quot;)
     parser.add_option(&quot;-f&quot;, &quot;--fft&quot;, action=&quot;store&quot;, dest=&quot;fft_size&quot;, type=&quot;int&quot;, help=&quot;fft size, power of 2 for increased performance (default %default)&quot;)
     parser.add_option(&quot;-p&quot;, &quot;--profile&quot;, action=&quot;store_true&quot;, dest=&quot;profile&quot;, help=&quot;run profiler and output profiling information&quot;)
-
+    
     parser.set_defaults(image_width=500, image_height=170, fft_size=2048)
 
     (options, args) = parser.parse_args()
 
-    if len(args) != 3:
-        parser.error(&quot;incorrect number of arguments&quot;)
-
-    if not options.profile:
-        create_png(args[0], args[1], args[2], options.image_width, options.image_height, options.fft_size)
-    else:
-        import hotshot
-        from hotshot import stats
-        prof = hotshot.Profile(&quot;stats&quot;)
-        prof.runcall(create_png, args[0], args[1], args[2], options.image_width, options.image_height, options.fft_size)
-        prof.close()
+    if len(args) == 0:
+        parser.print_help()
+        parser.error(&quot;not enough arguments&quot;)
+   
+    for input_file in args:
+        print &quot;processing file %s:&quot; % input_file
         
-        s = stats.load(&quot;stats&quot;)
-        s.sort_stats(&quot;time&quot;).print_stats()
+        try:
+            output_file_w = options.output_file_w
+        except AttributeError:
+            output_file_w = input_file + &quot;_w.png&quot;
+            
+        try:
+            output_file_s = options.output_file_w
+        except AttributeError:
+            output_file_s = input_file + &quot;_s.png&quot;
+        
+        args = (input_file, output_file_w, output_file_s, options.image_width, options.image_height, options.fft_size)
+
+        if not options.profile:
+            create_png(*args)
+        else:
+            import hotshot
+            from hotshot import stats
+            prof = hotshot.Profile(&quot;stats&quot;)
+            prof.runcall(create_png, *args)
+            prof.close()
+            
+            s = stats.load(&quot;stats&quot;)
+            s.sort_stats(&quot;time&quot;).print_stats()</diff>
      <filename>sandbox/wav2png/wav2png.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>39c42299fbb4a4c93c1cb4c68c3f94710c1559c8</id>
    </parent>
  </parents>
  <author>
    <name>bdejong</name>
    <email>bdejong@8b7dadd3-f59f-4475-adbd-84da9656de16</email>
  </author>
  <url>http://github.com/bram/freesound/commit/ab3d916af9a1210db9556c192ef8c3d6b73c6a87</url>
  <id>ab3d916af9a1210db9556c192ef8c3d6b73c6a87</id>
  <committed-date>2008-05-16T02:03:19-07:00</committed-date>
  <authored-date>2008-05-16T02:03:19-07:00</authored-date>
  <message>added multi-file processing to wav2png.py
moved output filenames to options, rather than arguments
added a LICENSE directory with various license related files + some standard preambles
added licenses to wav2png.py and player.js



git-svn-id: https://iua-share.upf.edu/svn/nightingale/trunk@67 8b7dadd3-f59f-4475-adbd-84da9656de16</message>
  <tree>1cee970cfe0a50d320c5267790da945cbeb0f875</tree>
  <committer>
    <name>bdejong</name>
    <email>bdejong@8b7dadd3-f59f-4475-adbd-84da9656de16</email>
  </committer>
</commit>
