Most Linux distributions have switched over to using LibreOffice in recent years for an office productivity suite on the Linux desktop after disturbances resulting in LibreOffice being forked from OpenOffice.org following Oracle’s acquisition of Sun Microsystems. While Fedora is one of the distributions that has been living with LibreOffice, OpenOffice may come back as an option in Fedora 19…
Professional Audio Production on Linux
And now we come to my favorite part of this series, high-end Linux audio production. Linux is a superior platform for professional audio production: stable, efficient, and you don’t get gouged for software licenses. You have to be careful to select audio hardware that is well-supported on Linux, but this is less of a problem than it used to be. Look for USB audio interfaces that don’t need custom proprietary drivers, but stick to the USB spec like they’re supposed to. The hardy FFADO developers toil away developing and improving drivers for Firewire audio interfaces. No, Firewire is not dead, and you can easily add a Firewire card to almost any PC if it doesn’t already have one. I use FFADO for my cherished old Saffire Pro 26 I/O, and neither have let me down.
MobilePre USB, Saffire Pro 26 I/O, cherished old Pioneer stereo amp
Visit Linux Musicians and LinuxAudio.org to stay current on Linux audio, hardware, and to hang out with other musicians and studio nerds.
Making Good Recordings
I think the most important thing to keep in mind is giant bundles of special effects do not equal good audio software. Special effects are cheap and easy; they’re the Allen wrenches of audio software. You know those mechanic’s toolkits that boast of their hundreds of tools, and then most of them are Allen wrenches? It’s the same deal with special effects in audio. If you enjoy playing around with special effects, then enjoy the abundance and have a great time.
Hundreds of these may or may not be useful
But that’s not what makes great audio software. Great software is clean, and does not introduce noise or distortion, or add its own color. It is stable and fault-tolerant, so you don’t lose your hard work to a crash. It integrates nicely with other applications and audio routers like JACK. It does not introduce excess latency, or suck up too many CPU cycles. There is a reason professional recording studios are soundproofed and record multiple takes: it’s best to start with the most high-quality, faithful recording you can make. And there is one more factor, which is probably the most important one: your own skill and taste.
Your recordings are as good as the weakest link in your audio chain: microphones, instruments, mixers, analog-to-digital converters, and whatever else you like to use. Your recording studio can be as simple as a laptop and a good microphone, to a room full of fun electronics. Using a PC as the heart of your recording setup opens a world of possibilities for a low price. Me, I’d rather edit digital files on a computer than go back to the bad old days of faffing around with tape; it’s easier, a lot faster, and a lot more flexible.
Well that’s enough rambling on about hardware, so let’s take a look at some of the best audio software Linux has to offer.
Recording, Editing, Mastering
The Ardour digital audio workstation is a beautiful creation. You can group tracks arbitrarily (great for streamlining editing), it supports unlimited tracks (until your computer keels over), it has a soundcard picker if you have more than one, processes at 32-bits internally, supports very flexible signal routing, support networked audio, and a way lot more. It’s a bit of a learning curve, and it requires the JACK low-latency sound server and audio router on Linux, so this Crash Course in Audio Recording With Ardour DAW should help you get started.
The Audacity WAV recorder and editor is probably the most popular higher-end audio software for Linux. Audacity is easy to learn and chock-full of great features, and it is JACK-aware so you can combine it other audio software and hardware. It supports unlimited tracks, a multitude of effects and filters, and exports to a wide range of audio formats and quality levels. You can make your raw recordings in Audacity and then mix and edit them in Ardour, if Audacity doesn’t have the tools to do what you want. (If you buy my fabulous Audacity book from this link the Audacity team gets a percentage of the sale.)
Multitrack recording in Audacity
MIDI and Synthesizer
The world of synthesizers is vast and fun, and MIDI (Musical Instrument Digital Interface) is the universal communications standard that lets MIDI hardware and software talk to each other. Rosegarden is an excellent MIDI sequencer, and it is also a composer and score editor. It is easy to learn, and full of advanced features.
FluidSynth is a great real-time software synthesizer and virtual MIDI device that doesn’t need a SoundFont-compatible soundcard, so all you need to be a literal one-person orchestra is FluidSynth and a Linux computer. If you want a prettier graphical interface get QSynth, a nice Qt front-end for FluidSynth. FluidSynth is the backend of a lot of other applications, for example VLC and MuseScore.
Score Writing
MuseScore is a sophisticated WYSIWYG music notation editor for writing and printing scores. It includes a mixer and synthesizer for instant previews of your work. It creates attractive-looking scores, and has extensive documentation.
What if you just want to create some nice sheet music with guitar chords and tablature? Then you want Chordii. It includes a database of nearly 400 chords, and of course you can add your own. It is fast to learn: your source files are plain text with the simple Chordii markup, and these are converted to nice-looking sheet music.
Drum Kit
The Hydrogen Drum Machine is still my favorite drum synth. It integrates nicely with Ardour, Audacity, and Rosegarden, it comes with a big batch of demos, and it will do whatever you want it to do because it is incredibly flexible. Check out More Cowbell with Hydrogen Drum Machine on Linux for a quick start with this excellent software.
Be a Radio Station
We still call it radio even though no radio waves are involved. Though they are, if you use a wireless Internet connection. At any rate, you can set up your own Internet broadcast with the excellent Airtime radio station management and automation software. You can schedule programming to run unattended, do live broadcasts, stream to Shoutcast and Icecast, and display program information for your eager listeners.
This is just a bare introduction to the wide world of Linux audio. Check out part 1 of this series for advice on best Linux distributions for multimedia production and best graphics software, and part 2 for a look at my favorite video production software.
Programming Android Motion Sensors
One of the really neat features of coding for a portable platform like a phone is that you can use its motion sensors to control the UI. How useful this is in a particular app varies from “neat gimmick” to “UI perfection” — admittedly the example here is more on the “gimmick” end of the spectrum, but it’ll get you started with using the Android motion sensors. We’ll carry on using the code from the previous three tutorials, but this time, we’re going to add a detector which enables you to start the timer by shaking the phone.
Accelerating…
Android has a whole raft of sensors, which are listed in the SensorEvent API, and which include the accelerometer, gyroscope, orientation, and some others. Not all devices will support all sensors. You can use SensorManager.getSensorList(Sensor.TYPE_ALL) to see a list of the available sensors.
However, all devices should include an accelerometer, and that’s what we’re going to use here. The regular accelerometer includes a contribution from gravity; so to establish the true acceleration of the device you need to apply a high-pass filter to the values returned (as described in the SensorEvent API docs). However, as of API level 9 (Android 2.3), there is also a linear accelerometer sensor type which has done this for you, and which just measures the acceleration of the device along each axis. We’re going to use this to save doing the hard work ourselves. (A gravity sensor type was also added in API level 9, should you happen to find yourself somewhere where gravity is non-Earth-standard.)
Android axes
A quick note about axes. The sensor X axis runs left-right across the screen (in its default orientation, so held in portrait mode for the average phone), the Y axis runs upwards along the screen, and the Z axis runs outwards from the screen (see the diagram in the SensorEvent API). These axes do NOT change direction when the device orientation changes, and more importantly, they are NOT the same as the co-ordinate system used by the Android 2D screen drawing APIs. We won’t need to deal with this issue in this code, but if you’re using the sensors for gameplay UI, it can be a bit of a headache, especially as the 3D co-ordinates are different again. Drawing things out on scraps of paper usually helps.
Sensing events
So, how do we set up our code to sense an accelerometer event? Easy: just make your Activity implement SensorEventListener:
public class CountdownActivity extends ListActivity
implements SensorEventListener {
...
}
To implement SensorEventListener, we’ll need to override onAccuracyChanged() and onSensorChanged(), but first, let’s get a SensorManager and Sensor set up:
public class CountdownActivity extends ListActivity
implements SensorEventListener {
private SensorManager manager;
private Sensor accel;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
manager = (SensorManager)getSystemService(SENSOR_SERVICE);
accel = manager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);
// rest of onCreate code; see previous tutorials
}
}
We now have an acceleration sensor to use, but currently it’s not actually been turned on. To do that, we need to implement onResume() and onPause():
protected void onResume() {
super.onResume();
manager.registerListener(this, accel, SensorManager.SENSOR_DELAY_GAME);
}
public void onPause() {
super.onPause();
manager.unregisterListener(this);
}
The EventListener will listen for events in the given sensor, with the given sensitivity. We’re using the GAME value for the sensor delay, which is sensitive enough for most games; you also have NORMAL, UI, and FASTEST. We can use this as the SensorEventListener to be registered, because we’ve implemented SensorEventListener in this Activity. Otherwise we’d have to write another class to handle this.
Note that we only have to register the Listener in onResume(); this is because onResume() is always run when onCreate() runs, so any code here will be run when the Activity is created, not just when it’s resumed. (There’s a diagram of the Android Activity lifecycle in the docs). It’s very important to remember to unregister your Listener when your Activity is paused. The system won’t do it automatically for you, and listening for events uses up a lot of battery. Draining the battery in the background tends to make you unpopular with users.
Android activity lifecycle
Having set everything up and registered the Listener, we need to write the methods that define what happens if a SensorEvent is detected:
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// not going to do anything with this.
}
public void onSensorChanged(SensorEvent event) {
showTimer(countdownSeconds * MILLIS_PER_SECOND);
}
We’re not going to bother doing anything in particular if the sensor accuracy changes, as it doesn’t really interest us here. However, if the sensor changes at all, we’re going to interpret that as a shake, and show the timer (remember from previous tutorials that showTimer()also starts it; you might want to improve the code by breaking different parts of this out into different methods).
Compile it, run it (you’ll need to run it on a phone, not on the emulator, as described in previous tutorials), and you should be able to start the timer by shaking the phone. However, you’ll notice that only a very tiny movement restarts the timer — this is a bit more sensitive than we want. To improve this, we can get the actual values of the sensor event and only act if they are above a certain amount. I found that a threshold of 3 worked well, and this code doesn’t distinguish between the direction of the shake:
public void onSensorChanged(SensorEvent event) {
int xValue = event.values[0];
int yValue = event.values[1];
int zValue = event.values[2];
if (xValue + yValue + zValue > 3 ) {
showTimer(countdownSeconds * MILLIS_PER_SECOND);
}
This code now provides a basic interaction between the accelerometer and the timer, but there’s plenty more you could do to improve it. For example, you could write a method to stop the timer if the phone is shaken again. In general, adding some more detailed stop/start/reset code is probably useful as the app becomes more complicated. You can also play around with the sensor code a bit to get a better grasp of how the sensor works — you could for example use log output to find out what the values look like, or try varying them in different directions and acting differently on a sideways shake than an up and down shake. The best way to get to grips with the options and to improve your Android coding chops is to get experimenting and rewriting!
Image Credits
Axis Image and Activity lifecyle diagram: Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Seigo: Plasma.next()?
Aaron Seigo describes the development plans for the Plasma framework. “However, in Plasma Active we’ve made two purposeful decisions: do not expose the hierarchical file system (unless the use case dictates that as a requirement) and do not expose details that are not relevant to the usage of the device (e.g. I care that I can open that spreadsheet, it’s less important at that moment that the application is Calligra Sheets). Thus to open a spreadsheet one opens the file manager and goes to Documents, or simply searches for the document from the Launch area directly. No file system, no application launchers.“
Google offers exploit bounties for Pwn2Own and Pwnium
At the CanSecWest conference, Google is sponsoring the Pwn2Own challenge as well as putting up $3.14159 million for hackers who find exploits in Chrome OS for its own Pwnium competitionGoo
Schulz: The meaning of the 4.0
Charles H. Schulz Looks forward to the LibreOffice 4.0 release, currently planned for early February. “On a more abstract level, these changes also mark a more radical departure from the OpenOffice.org codebase, and it is now becoming quite difficult to just assume that because OpenOffice.org, Apache OpenOffice behave in one specific way LibreOffice would do just the same. Of course the API changes do not make the whole work themselves, but the work we started with the 3.4 branch is paying off: LibreOffice 4.0 is becoming a different animal, and that comes with its own distinct advantages while clearly showing our ability as a community to innovate and move forward.” Read more at LWN
House panel demands answers regarding Swartz prosecution
Saying they had “many questions” about the prosecution of Internet activist Aaron Swartz, who committed suicide earlier this month, two key members of the House Oversight and Government Reform Committee have requested a briefing with the Justice Department.
Committee Chairman Darrell Issa (R-Calif.) and ranking member Elijah Cummings (D-Md.) sent a letter (see below) today to Attorney General Eric Holder that outlines seven questions the lawmakers have for prosecutors concerning their prosecution of Swartz…Read more at CNET News
ITU signs off on H.265 video standard
High Efficiency Video Coding said to need half the bit rate of H.264 The International Telecommunications Union (ITU) has signed off on High Efficiency Video Coding (HEVC), a video compression standard expected to succeed the wildly popular H.264.……
The International Telecommunications Union (ITU) has signed off on High Efficiency Video Coding (HEVC), a video compression standard expected to succeed the wildly popular H.264.
ITU-T H.265 / ISO/IEC 23008-2 HEVC, to give the new standard its full name, is seen by the ITU as “designed to take account of advancing screen resolutions” and “is expected to be phased in as high-end products and services outgrow the limits of current network and display technology.”
HEVC can handle resolutions up to 7680×4320…Read more at The Register
Development Release: Linux Deepin 12.12 Alpha
A preview version of Linux Deepin 12.12, a popular Chinese community distribution, has been unleashed for testing. This is the first version that ships with the brand new Deepin Desktop Environment (DDE), which replaces GNOME Shell as the default desktop. DDE along with its Deepin System Settings (DSS)….Read more at DistroWatch
QEMU 1.3.1 Brings In A Bunch Of Fixes
The first (and only planned) point release to QEMU 1.3 is now available. The QEMU 1.3.1 release fixes just over two dozen bugs, including critical issues for OpenBSD guests…