Logo
v1.2.0

Table of contents:

  • Installation
  • Getting started
  • Command-line interface
    • Quickstart
      • Option 1: Direct input arguments
      • Option 2: GAMuT workspace
  • Graphical user interface
  • Reference
GAMuT
  • Command-line interface
  • Option 2: GAMuT workspace (recommended)
  • View page source

Option 2: GAMuT workspace (recommended)

A more convenient way to start working with GAMuT is by creating a workspace folder. Navigate to where you would want your workplace folder to be, and run:

gamut --init my-gamut-workspace

You may choose to name your workspace folder differently, instead of my-gamut-workspace. In this case, a folder named my-gamut-workspace will automatically be created, and will contain some boilerplate files and folders to help you get started. We can go into the directory and the current folder structure:

cd ./my-gamut-workspace
ls

The workspace should look something like this:

my-gamut-workspace
   ├── audio
   │   ├── source.mp3
   │   └── target.mp3
   ├── corpora
   ├── mosaics
   └── scripts
       └── test.json

As you can see, it includes 4 folders and 3 different files. These files are:

  • source.mp3 and target.mp3: Two default audio samples that we can use to test GAMuT.

  • test.json: A JSON file containing boiler-plate information we can use to generate an audio mosaic. This is what we’ll be modifying and feeding GAMuT to create new sounds.

We can now create our first audio mosaic. Let’s run the test.json script:

gamut --script ./scripts/test.json --play

Let’s understand what this does:

  • --script specifies we want gamut to run a script. We can optionally type -s instead of --script to make it shorter.

  • ./scripts/test.json is the location of the script we want to run. We’ll take a loot at this file soon and understand its main components.

  • --play tells gamut to play the resulting audio at the end of the process. If absent, it won’t play it automatically, but the file will still be created.

After running this, we should find a newly created files:

  • ./corpora/test-corpus.gamut: A binary file that represents a corpus built from source.wav,

  • ./mosaics/test-mosaic.gamut: A binary file that represents a mosaic built from the audio target target.wav, and the corpus test-corpus.gamut.

  • ./audio/test-audio.wav: The resulting audio mosaic in .wav format.

Now let’s open scripts/test.json and look what’s inside:

Boiler-plate content in scripts/test.json
 1{
 2    "corpus": {
 3        "name": "test-corpus",
 4        "source": [
 5            "/Users/felipe-tovar-henao/Documents/gamut/audio/source.wav"
 6        ],
 7        "features": [
 8            "timbre"
 9        ]
10    },
11    "mosaic": {
12        "name": "test-mosaic",
13        "target": "/Users/felipe-tovar-henao/Documents/gamut/audio/target.wav",
14        "corpus": [
15            "test-corpus"
16        ]
17    },
18    "audio": {
19        "name": "test-audio",
20        "mosaic": "test-mosaic",
21        "fidelity": 1.0,
22        "grain_dur": 0.1,
23        "grain_env": "cosine",
24        "corpus_weights": 1.0,
25        "stretch_factor": 1.0,
26        "pan_depth": 3,
27        "onset_var": 0,
28        "n_chans": 2,
29        "sr": 44100
30    }
31}

This JSON file consists of three blocks that represent the basic audio musaicking pipeline in GAMuT — it essentially says create a corpus, then a mosaic, and then an audio file. We can think of this file as containing all the different settings that GAMuT can use to do its job.

Highlighted, are the two lines that you should start to experiment with:

  • corpus::source: This line specifies the path to an audio file, folder directory, or list thereof, you want to use as a corpus.

  • mosaic::target: This line specifies the path to an audio file you want to use as a target.

Hint

To avoid re-building corpus and/or audio everytime you run the script, you can use the --skip <block> argument to skip blocks you don’t want to run. For instance, this runs the test.json script, but only the audio block:

gamut -s ./scripts/test.json --skip corpus mosaic

Note

Script block names must start with either corpus, audio, or mosaic. This makes it possible to include, for instance, more than one corpus in the same script:

{
   "corpus_1": {
      ...
   },
   "corpus_2": {
      ...
   }
}

Inside each block, you have other parameter fields that you can change. Aside from name, which specifies the name of the output file for each block, you can learn about what each of these parameters controls through these links:

  • corpus

  • mosaic

  • audio

Note

Once you feel more comfortable working with the GAMuT command-line interface, you may want to go through the Python tutorials to have more control over your workflow.

Previous Next

© Copyright 2023, Felipe Tovar-Henao.

Built with Sphinx using a theme provided by Read the Docs.