At the Sounding Edge: What's Going On with Csound?

A look at what's changed and what's new in Csound5, the major overhaul to the long-standing Csound software sound synthesis language.
CsoundVST

Although the methods described above are workable, they require separate steps in the workflow. That is, you write the files in your text editor, then you compile them and audition the results, perhaps further editing the audio file in a soundfile editor and then you repeat the process as necessary. It certainly would be nice to have the entire work cycle managed from a single interface, and that is exactly what is provided by CsoundVST.

Figure 1. The CsoundVST GUI

Csound developer Michael Gogins has given us CsoundVST as an integral graphic interface to Csound5 (Figure 1). CsoundVST combines all of the steps in the edit/compile/run cycle and adds a few neat amenities. User-configurable items include VST plugin mode, Csound performance mode and your choice of soundfile editor. Versioning is offered, a nice feature that creates a numbered series of output files. Basic start/stop performance controls also are provided. Figure 2 shows this new Csound GUI in action, running the code from the examples above.

Figure 2. Example CsoundVST Running Code

As you can see in the figures, CsoundVST displays in two sections. The top button bar is fairly self-explanatory, and the tooltips help should clarify any obscure purpose. The tabbed section shown in Figure 1 is in Classic Csound performance mode. When the Python performance mode is selected, the tabbed section changes to the arrangement shown in Figure 3.

Figure 3. CsoundVST in Python Mode

The code in Figure 3 is from Koch.py, a Python script by Michael Gogins and donated to the Csound5 examples directory. The script uses native Python code to create a Csound score generator. It then utilizes a series of imported Csound-related functions to define a Csound orchestra for processing the generated score. The last lines of the script invoke the Csound binary with appropriate options to run in real time. Click the Perform button in the GUI to render the script, the same as you would render a Csound orc/sco or CSD file.

CsoundVST loads individual orc/sco files, and it also loads CSD files, automatically parsing them into the appropriate sections of the GUI--options, instruments, score. The Save button saves your work in CSD format only; that is, it does not save orc and sco files separately.

Csound5 and JACK

The JACK audio server is one of the finest achievements in the open-source audio software world. JACK is designed for robust low-latency and ease of connectivity, and it is no exaggeration to say that support for JACK has become an expected asset to any serious Linux sound program.

Thanks to developer Istvan Varga, Csound5 provides basic support for JACK. At this time, the process of connection is a bit cumbersome, but again the task can be lightened by the use of the .csoundrc file. The following command declares JACK as the audio system of choice and autoconnects Csound's audio output to the first ALSA playback port:

-+rtaudio=jack --expression-opt -b 512 -B 2048 -odac:alsa_pcm:playback_ -d -m0

These settings accommodate my SBLive. The -b software buffer value should equal JACK's buffer size; it must be less than -B, the hardware buffer value, and both buffer flags must be powers of two. Additionally, the JACK sample rate must equal the sample rate of your orchestra. Figure 4 shows how Csound appears as a client in the QJackCtl audio connection tab as a result of these settings.

Figure 4. Csound5 as a JACK Client

Future improvements may include support for the JACK transport control mechanism. But even in its current state, Csound5's JACK support is a wonderful addition to the system.

MIDI Connectivity

Code fixes have repaired and enhanced Csound's MIDI support, greatly improving this aspect of Csound5. Csound5 now relies upon the PortMIDI system for its basic MIDI connectivity. This change is a great improvement for Csound overall and hopefully will provide a common cross-platform layer for MIDI I/O. Linux users now can enjoy connection to any available MIDI port, including ALSA's virtual MIDI ports, allowing multiple connections to a single port.

______________________

Similis sum folio de quo ludunt venti.

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