Tutorial 1: Basic audio musaicking with GAMuT
Broadly speaking, the audio musaicking pipeline with GAMuT is quite simple:
Create a
Corpus
from one or more audio sources.Create an
Mosaic
from one or moreCorpus
instances, given a target audio file.Convert
Mosaic
to anAudioBuffer
instance, and write it into disk as a.wav
or.aif
audio file.
Here’s a simple script that demonstrates this basic pipeline in Python:
from gamut.features import Corpus, Mosaic
# 1) create a corpus from source:
corpus = Corpus(source='/path/to/source/audio/folder-or-file.wav')
# 2) create a mosaic for audio target and, based on corpus:
mosaic = Mosaic(target='/path/to/target/audio/file.wav', corpus=corpus)
# 3) convert mosaic to audio buffer and play it:
audio = mosaic.to_audio()
audio.play()
Hint
Doing all these steps in a single script can be computationally inefficient, as it results in
creating the Corpus
and Mosaic
from scratch, everytime the script runs.
Therefore, it’s recommended to take a more modular, divide-and-conquer approach, and write separate scripts for each stage of the process.