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
Fabric-Based Computing Enables Optimized Hyperscale Data Centers

Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions