Making Music With Your Keyboard

It is extremely easy to get a tiny little keyboard to generate melody in your Linux box. In fact, you can play hundreds of instruments.

Here's how I did it in my Fedora Core 6 and 7 laptops:

Software:
1. timidity++ - This can turn MIDI into audio (a synthesizer)
2. vkeybd - A virtual keyboard for your X desktop.

To install in Fedora Core 6 or 7, just type the following command:

# yum -y install timidity++ vkeybd

Play:
Start timidity (and connect to ALSA). Note that in Fedora 7, I had to type esd in another terminal before the following command:

   1. $ timidity -iA
   2. Start vkeybd:
      $ vkeybd
   3. Join the keyboard output and the synthesizer input together. 
Identify the correct client and port numbers of the keyboard and the synthesizer (TiMidity):
      $ cat /proc/asound/seq/clients
   4. Join them together (arguments should be in correct order - source first).
      $ aconnect 129:0 128:0 

Now you can play. To change the instrument, see the Virtual Keyboard options (View->Program List). If required, increase the volume by using timidity option -An (e.g.: $ timidity -A300 -iA). timidity and vkeybd have many other options to get different behaviors. See the manual pages for details.

This Tech Tip comes from Kamal in Sri Lanka. Thanks, Kamal!

Instant fame is easy at Linux Journal. Just send us your useful Tech Tips to share with the Linux Community, and we'll send you a cool t-shirt for your efforts!

Please note: Tech Tips featured in this specific section of LinuxJournal.com are kindly brought to us by readers and are not necessarily tested by LinuxJournal.com editors.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState