Automate Chord Transcription Using Sonic Annotator and Vamp Plugins on macOS (Terminal)

Automate Chord Transcription Using Sonic Annotator and Vamp Plugins on macOS (Terminal)
Automate Chord Transcription Using Sonic Annotator and Vamp Plugins on macOS (Terminal)

Chord transcription from audio files can be efficiently automated using Sonic Annotator in combination with Vamp plugins, particularly the Chordino plugin. This guide will walk you through the installation process, provide troubleshooting tips, and give you the final commands to extract chords in various formats from your audio files, all from the macOS terminal.

Transcribing chords is essential for musicians, composers, and music enthusiasts who want to analyze songs or create arrangements based on audio recordings. By leveraging powerful tools like Sonic Annotator and Vamp plugins, you can automate the process of chord detection, saving time and increasing accuracy.


Table of Contents


Use Cases for Automating Chord Transcription

1. Music Education and Learning

Automating chord transcription can significantly aid music students and teachers in understanding music theory and ear training. By analyzing audio recordings of songs, students can visualize the chords and progressions being used. This helps in developing a deeper comprehension of musical structures, making it easier to learn how to play instruments or compose music. Teachers can use transcriptions as a tool to demonstrate real-world applications of music theory concepts.

2. Song Arrangement and Composition

Musicians and composers can leverage automated chord transcription to quickly analyze existing songs and derive chord progressions for their own compositions. By extracting chords from audio files, they can create arrangements or adapt songs to different styles. This is particularly useful for cover artists or arrangers looking to reinterpret a song with their own flair, as it provides a clear starting point for modifying harmonic content.

3. Music Production and Sound Design

In the realm of music production, understanding the harmonic content of tracks can influence sound design and mixing decisions. Producers can automate the process of extracting chords from demo tracks, allowing them to identify key changes and harmonic relationships without manually transcribing them. This can streamline the workflow when working with multiple audio sources, making it easier to create cohesive productions that align with the desired musical vision.


Installation Procedure

Step 1: Install Sonic Annotator

Download Sonic Annotator:

Visit the official Sonic Annotator download page.

Choose the appropriate binary file for your macOS system and click the download link to save it to your computer.

Open the Downloaded File:

Once the download is complete, locate the binary file in your Downloads folder or the directory where you saved it.

Move the Binary to a Suitable Directory:

Open the Terminal application on your Mac. You can find it in Applications > Utilities > Terminal.

Navigate to the directory where the binary file was downloaded, for example:

cd ~/Downloads

Move the Sonic Annotator binary to a directory in your system’s PATH for easy access. A common location is /usr/local/bin. Use the following command to move it:

sudo mv sonic-annotator /usr/local/bin/

You may need to enter your administrator password to complete this action.

Make the Binary Executable:

After moving the binary, set the appropriate permissions to make it executable. Run the following command:

sudo chmod +x /usr/local/bin/sonic-annotator

Verify Installation:

To confirm that Sonic Annotator is installed correctly, you can test it by running:

sonic-annotator -h

If the installation was successful, this command should display the help information for Sonic Annotator, indicating that the binary is recognized and executable.

Step 2: Install Vamp Plugins

Download Chordino Plugin:

Go to the NNLS Chroma project page and download the Chordino plugin files.

Vamp plugins

Install Chordino Plugin:

Extract the downloaded files and locate the appropriate plugin files (e.g., nnls-chroma.dylib).

Move the extracted plugin files to the Vamp plugin directory:

sudo mv path_to_extracted_files/nnls-chroma.dylib /usr/local/lib/vamp/

Ensure the correct permissions are set:

sudo chmod 755 /usr/local/lib/vamp/nnls-chroma.dylib

Verify Installation: Run the following command to check if Sonic Annotator recognizes the Vamp plugins:

sonic-annotator -l

Look for outputs related to vamp:nnls-chroma:chordino.


Troubleshooting

If Sonic Annotator doesn’t list the Chordino plugin or if you encounter errors during usage, consider the following steps:

Check Plugin Directory: Ensure that the plugin files are directly located in /usr/local/lib/vamp/ and not in a subfolder.

Set Environment Variable: If plugins are not recognized, set the VAMP_PATH environment variable:bashCopy codeexport VAMP_PATH=/usr/local/lib/vamp

export VAMP_PATH=/usr/local/lib/vamp

To make this permanent, add the above line to your ~/.zshrc file and run:

source ~/.zshrc

Permissions: Ensure that the files in the Vamp directory have the correct permissions:

sudo chmod -R 755 /usr/local/lib/vamp

Test with Sonic Visualiser: If issues persist, test the Chordino plugin using Sonic Visualiser, a GUI application that supports Vamp plugins, to ensure the plugin works properly.

macOS Security Settings: When you run Sonic Annotator for the first time, macOS may prompt you to allow it to run in the Security & Privacy settings since the developer is not known. If this occurs:

Go to System Preferences > Security & Privacy.

In the General tab, you may see a message indicating that Sonic Annotator was blocked. Click on Allow Anyway to enable it.


Extracting Chords in Various Formats

Once everything is installed and configured, you can automate chord extraction from your audio files in different formats using the following commands:

1. Simple Chords

sonic-annotator -d vamp:nnls-chroma:chordino:simplechord your_audio_file.wav -w csv
  • Sample Output:
Time,Chord
0.000,Cmaj
0.500,Dmin
1.000,G7
1.500,Cmaj

2. Chord Notes

sonic-annotator -d vamp:nnls-chroma:chordino:chordnotes your_audio_file.wav -w csv
  • Sample Output:
Time,Chord Notes
0.000,C,E,G
0.500,D,F,A
1.000,G,B,D
1.500,C,E,G

3. Harmonic Changes

sonic-annotator -d vamp:nnls-chroma:chordino:harmonicchange your_audio_file.wav -w csv
  • Sample Output:
Time,Harmonic Change
0.000,0.1
0.500,0.5
1.000,1.0
1.500,0.3

4. Log Likelihood

sonic-annotator -d vamp:nnls-chroma:chordino:loglikelihood your_audio_file.wav -w csv
  • Sample Output:
Time,Log Likelihood
0.000,-2.3
0.500,-1.5
1.000,-3.1
1.500,-2.0

5. Chord Notes with Additional Details

sonic-annotator -d vamp:nnls-chroma:chordino:chordnotes your_audio_file.wav -w csv
  • Sample Output:
Time,Chord,Notes
0.000,Cmaj,C,E,G
0.500,Dmin,D,F,A
1.000,G7,G,B,D,F
1.500,Cmaj,C,E,G

Explanation of the Sample Outputs

  • Simple Chords: Lists the time (in seconds) and the detected chord at that time.
  • Chord Notes: Indicates the individual notes that make up the chord.
  • Harmonic Changes: Shows the intensity or significance of harmonic changes at given timestamps.
  • Log Likelihood: Represents the likelihood of the chord presence based on the analysis.
  • Chord Notes with Additional Details: Combines chord identification with the specific notes that form the chord.

Conclusion

Using Sonic Annotator with Vamp plugins, particularly Chordino, allows you to automate chord transcription from audio files effectively. By following the installation steps, troubleshooting tips, and extraction commands outlined in this guide, you can efficiently analyze and transcribe chords from your music recordings directly from the macOS terminal.

Automating the process of chord transcription enhances your musical understanding and helps you create better arrangements. With the tools and techniques provided here, you can easily convert audio to meaningful chord data, making your music projects more efficient and enjoyable.

Leave a Reply

Your email address will not be published. Required fields are marked *