More chorus repetition macros for Audacity

In a previous post I described macros to support certain tasks in generating source material for L2 chorus repetition practice. Today, I’ll describe two other macros that automate this practice by slowing the playback speed of the repetition.

Background

I’ve described the rationale for chorus repetition practice in previous posts. The technique I describe here is to slow the sentence playback speed to give the learner time to build speed by practicing slower repetitions. By applying the Change Tempo... effect^[Change tempo effect in the Audacity manual] in Audacity. In my own practice, I will often begin complex Russian sentences at -50% speed and progress to -25% speed before practicing the pronunciation at native-level speed. By practicing at slow speeds, it gives the learner time to appreciate how syllables are connected to each other. The prosody is more apparent.

Technique

Num Command Explanation
01 SelectAll: Select the entire source sentence
02 ChangeTempo:Percentage="-50" SBSMS=“1” Change the tempo (without altering pitch) by -50%
03 Select:End="-0.65" Mode=“Set” RelativeTo=“SelectionEnd” Start=“0” Create an empty 0.65 second region
04 Silence:Use_Preset=“User Preset:650ms” Add 0.65 seconds of silence
05 SelectAll: Select the original clip + the silence
06 CursSelEnd: Move the cursor to the end of the new selection
07 Repeat:Count=“5” Repeat 5 times for a total of six iterations on the track.

You can see that we’ve just add a single additional step (02) to the previous iteration generator macro - in this case, reducing the tempo by 50%.

If you want to reduce the speed by only 25%, then you just need to alter the corresponding command 02:

Num Command Explanation
02 ChangeTempo:Percentage="-25" SBSMS=“1” Change the tempo (without altering pitch) by -25%

Download the files [Kjellin sentences 50.txt](/attachments/2020/07/16/Kjellin\ sentences\ 50.txt) and [Kjellin sentences 25.txt](/attachments/2020/07/16/Kjellin\ sentences\ 25.txt) and on macOS install them at ~/Library/Application Support/Audacity/Macros.

Audacity macros to support chorus repetition practice

Achieving fluid, native-quality speech in a second language is difficult task for adult learners. For several years, I’ve used Dr. Olle Kjellin’s method of “chorus repetition” for my Russian language study. In this post, I’m presenting a method for scripting Audacity to facilitate the development of audio source material to support his methodology.

Background

For detailed background on the methodology, I refer you to Kjellin’s seminal paper “Quality Practise Pronunciation with Audacity - The Best Method!” on the subject of chorus repetition practice. The first half of the paper outlines the neurophysiologic rational for the method and the second half describes the practical use of the cross-platform tool Audacity to generate source material for this practice.

Rationale for this project

Preparing source material (sentences of about 2 seconds duration) for this method is not difficult, but the steps are repetitive. Fortunately Audacity offers the ability to script its behaviour through macros (Tools → Macros...). Two macros are described here. Neither are complex, but they do chain common commands in Audacity, making it faster to produce material for chorus repetition. The first macro just trims silence from the clip and compresses its dynamic range. The second takes a clip, ideally a single sentence, adds 0.65 seconds of silence at the end, then replicates the clip + the silence 5 times for a total of 6 repetitions.

Macros

Truncate and compress

Num Command Parameters
01 Select All
02 Truncate Silence Action=“Truncate Detected Silence” Compress=“50” Independent=“0” Minimum=“0.5” Threshold="-20" Truncate=“0.5”
03 Compressor AttackTime=“0.2” NoiseFloor="-40" Normalize=“1” Ratio=“2” ReleaseTime=“1” Threshold="-12" UsePeak=“0”

To install this macro, download the file (Download ZIP.) On macOS, you can move the file to ~/Application Support/audacity/Macros. I’m not sure where it goes on other platforms; check the manual.

To use the macro, start with the sentence clip you want to process and invoke Tools → Apply Macro → TruncateAndCompress.

You can play around with different parameters if you need to trim more or less silence or if you want to change the compressor settings.

Kjellin Sentences

This macro will take a prepared clip, ideally a single sentence and create six total iterations with 650 ms of silence between each iteration.

Num Command Explanation
01 SelEnd: Move the selection point to the end
02 Select:End="-0.65" Mode=“Set” RelativeTo=“SelectionEnd” Start=“0” Create an empty 0.65 second region
03 Silence:Use_Preset=“User Preset:650ms” Add 0.65 seconds of silence
04 SelectAll: Select the original clip + the silence
05 CursSelEnd: Move the cursor to the end of the new selection
06 Repeat:Count=“5” Repeat 5 times for a total of six iterations on the track.

To install the macro, download it from the following location using Download ZIP, decompress and place in the Macros directory as above.

You will need one additional step before this is usable. You will need to create a user preset for the Generate silence tool. Navigate to Generate → Silence... and create a preset named “650ms” so that the macro can use it.

Again, to use it, just prepare a track with a single sentence you wish to use and then Tools → Apply Macro → KjellinSentences.

Enjoy and keep practicing!

Scripting Apple Music on macOS for chorus repetition practice

This is an update to my previous post on automating iTunes on macOS to support chorus repetition practice. You can read the original post for the theory behind the idea; but in short, one way of developing prosody and quality pronunciation in a foreign language is to do mass repetitions in chorus with a recording of a native speaker.

Because in macOS 10.15, iTunes is no more, I’ve updated the script to work with the new Music app. It turns out that it’s a lot simpler. No need to dive into the application classes.

A meritocracy reading list

Meritocracy has been on everyone’s minds lately, it seems. Reading Daniel Markovits’ “The Meritocracy Trap,” I was fully ready to condemn the concept completely. I may be still; but I need to take a moment to think about it more fully.

Here’s the problem with condemning meritocracy outright: if we look at ability on a case-by-case basis, would you rather a well-trained, accomplished pilot or a mediocre one? Would you rather go to a concert performed by a scratchy third-rate violinist or someone whose pedigree includes Juilliard, Curtis, or the like? Maybe the problem with meritocracy is simply that it doesn’t scale well in capitalist markets. (Don’t hold me to that idea; I’m not quite ready to embrace it fully.) In the process of scaling to the level of a large society, does any inherent rightness of merit confer a right to so distort the economic life of a country that only narrower and narrower slices of it garner larger and larger portions of the economic output?

A folder-based image gallery for Hugo

Hugo is the platform I use to publish this weblog. Occasionally I have the need to include a collection of images in a post. Mostly this comes up on other sites that I publish. Fancybox can do this; but it wasn’t immediately clear how to direct Fancybox to create a gallery of images in a page based on images in a directory. Previously, I’ve solved this in different ways, but I was anxious to find a simple shortcode-based method.

An alternative method for keyboard input switching on macOS

macOS offers a variety of virtual keyboard layouts which are accessible through System Preferences > Keyboard > Input Sources. Because I spend about half of my time writing in Russian and half in English, rapid switching between keyboard layouts is important. Optionally in the Input Sources preference pane, you can choose to use the Caps lock key to toggle between sources. This almost always works well with the exception of Anki. Presumably Anki’s non-standard text management system thwarts the built-in Caps Lock/toggle mechanism for reasons that are not clear to me. Equally unclear is why this worked previously but now does not. I’ve not updated either Anki or the system software. It’s a mystery. Nonetheless, began to search for an alternative method for switching between keyboard layout switching. What I developed relies on several tools: