Tag Archives: audio

Easy Keyboard Looper

Working on the 10-minute play festival that is happening at Civic Theatre of Greater Lafayette this Friday and Saturday (7pm door, 7:30 show, pay what you can [regular tickets are 18. {this is less}]), it occurred to me that the sound software in use is not very friendly or fun.

Simple Keyboard Sampler UI

You also need gate and loop options per key:

Simple Keyboard Sampler UI

I need to find a language that I could easily write this in. Maybe processing.org?  HTML5?

The goals are:

  • Sample Sounds
  • Simple UI
    • Press key, assign sound
    • Per key options
      • Gate
      • Loop
  • Multiple sounds at once
  • Platform independent

Any thoughts, let me know.

Bash Script to Merge WAV Files into a Single MP3

I record audio notes to myself and it can be difficult to go back and listen to them. This is especially frustrating because I have to be at my computer to do so. I needed to be able to take my smaller notes in a single file on my phone and listen to them while I commute to work. After doing some research online, I was able to write the following bash script to do just that:

#!/bin/bash
mkdir temp_mp3
find -size -20000k -name '*.WAV' | \
while read f;
do
  echo "Processing $f"
  lame "$f" "$f.mp3"
  echo "cat $f.mp3 > Combined.mp3"
  cat "$f".mp3 Combined-temp.mp3 > Combined.mp3
  mv Combined.mp3 Combined-temp.mp3
  mv "$f".mp3 ./temp_mp3/
done
mv Combined-temp.mp3 Combined.mp3
mp3val Combined.mp3 -f -nb

The bash script is straight-forward, but for those of you that cannot read the script:

  1. Run this script in your desired directory
  2. A list of all of the WAV files that are less than 20 megabytes is generated (using find)
  3. Each file will be changed into an MP3 (using LAME)
  4. The current MP3 will be concatenated into a single MP3 file, Combined.mp3 (using cat)
  5. After it has been concatenated, the MP3 file is moved to a directory, ./temp_mp3
  6. Once all of the applicable WAV files have been processed, the Combined-temp.mp3 is renamed to Combined.mp3
  7. An mp3val is ran on the newly named Combined.mp3 to clean up some of the ID3 header information
  8. Enjoy listening to your new mp3

This information was gathered from the following sources:

I have no audio when using Flash

One of the first issues I had with running Kubuntu was that I had no audio while playing Flash based applications.  I had installed a SoundBlaster card in my machine, so I was no longer using the onboard sound as my default device.  I had already setup my default audio device in Multimedia System Settings to my new card, but that did not seem to affect the default device in Flash.

After some searches on the Internet, I came across this thread: Changing default ALSA soundcard in Karmic, now with asoundconf gone.  I found some information that allowed me to update the default device for ALSA, which I had read, Flash uses.  These are the steps that I followed:

1.  You need a listing of your current sound devices.  Open up a root terminal window (sudo bash) and type: “cat /proc/asound/modules”

You should get a short list of your sound devices back:

0 snd_hda_intel
1 snd_usb_audio
2 snd_emu10k1

Please note the number preceeding the device you need to make the default.  In my case, I wanted to use the snd_emu101k1 device.

2.  Next, you need to edit your alsa-base.conf file.  In the terminal window type: “nano /etc/modprobe.d/alsa-base.conf”

Hit CTRL+W to search for abnormal in the conf file.  You should now be on this line:

# Prevent abnormal drivers from grabbing index 0

Above this line, add the following, but replace index=2 with the same number you noted above:

#added options to choose sound blaster
options snd_ctxfi index=2
# Prevent abnormal drivers from grabbing index 0

Hit CTRL+O and save the file.  Hit CTRL+X to leave nano.

3.  Now we need to restart the alsa server:

Type: “/sbin/alsa-utils stop” and press Enter.
Type: “alsa force-reload” and press Enter.
Type: “/sbin/alsa-utils start” and press Enter.

4.  Enjoy your sound in your Flash applications!