# Song and mix files

When you save a song called **mySong**, JJazzLab actually saves 2 different files:

* **mySong.sng**: contains everything except the mix information, i.e. the leadsheet, the song structure, the reference to the rhythm used (e.g. "16beat.s456.sty").
* **mySong.mix**: contains only the mix information, i.e. which instrument is used by each track, and with which configuration (volume, reverb, pan, ...).

Why using 2 different files ?

Because the mix information is specific to your output synth ([FluidSynth ](https://jjazzlab.gitbook.io/user-guide/sounds/using-fluidsynth)or a [custom synth](https://jjazzlab.gitbook.io/user-guide/sounds/other-synths)). Integrating the mix data in the .sng file would make .sng files not portable between users, since users have different output synths.

When you open **mySong.sng**, JJazzLab tries to open **mySong.mix** in the same directory. If **mySong.mix** does not exist then JJazzLab creates the mix using the [default rhythm mix](#default-rhythm-mix) file if it's present, otherwise it uses the **rhythm's builtin mix** (see [below](#default-rhythm-mix)).

{% hint style="warning" %}
When loading a song file (.sng), if the rhythm reference (e.g. "MediumJazz.s637.sst") used by this song is not available, JJazzLab substitutes another rhythm available on the system. JJazzLab tries its best to find a "similar" rhythm based on the name (another "jazz" rhythm in the example above). If it can't find a suitable rhythm, it just uses the default rhythm for the time signature.
{% endhint %}

## Default rhythm mix

{% hint style="info" %}
If you often use a certain rhythm, adjust its mix and save it as a **default rhythm mix file**, so that each time you'll use that rhythm in a song, it will sound optimally for your output synth.
{% endhint %}

#### How it works

When you create a song and select a new rhythm (e.g. `MediumJazz.s637.sst`), JJazzLab looks for a **default rhythm mix** file (`MediumJazz.s637.mix`) to initialize the song mix for this rhythm.

The default rhythm mix lets you define **an optimized rhythm mix adapted to your output synth** ([FluidSynth ](https://jjazzlab.gitbook.io/user-guide/sounds/using-fluidsynth)or a [custom synth](https://jjazzlab.gitbook.io/user-guide/sounds/other-synths)): for example with`MediumJazz.s637.sst` you can make the electric guitar quieter, replace the default GM bass instrument by a better one available on your synth, and mute that flute you don't like.

{% hint style="warning" %}
**If the default rhythm mix file is not present**, JJazzLab uses the **rhythm's** **builtin mix**. The rhythm's builtin mix is infered from the rhythm data and from your output synth capabilities. With FluidSynth the resulting mix should be OK with a few manual adjusments. With a custom synth, it might need more fixes.
{% endhint %}

#### Adjusting and saving a default rhythm mix

* In the Midi options select your preferred output synth, e.g. [FluidSynth](https://jjazzlab.gitbook.io/user-guide/sounds/using-fluidsynth).
* Load a song which uses your favorite rhythm and play it\
  (song mix is initialized with the **rhythm's builtin mix** if no default rhythm mix is defined)
* Adjust the mix until you're satisfied with the song rendering
* Use **Save as default rhythm mix** from the **Mix Console File menu**, as shown below.

<figure><img src="https://1057949908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQE7B7yjVY3xzlsorS4-887967055%2Fuploads%2FDLC4tCIzYQ9QBzvqK6Fw%2F2024-09-30%2022_55_58-JJazzLab%20%204.1.2-SNAPSHOT.png?alt=media&#x26;token=87d7f53c-2d23-4da9-ae42-b053edb5cb0c" alt=""><figcaption></figcaption></figure>

The default rhythm mix file is saved **in the same directory than the rhythm file**.

{% hint style="success" %}
JJazzLab will now automatically use this **default rhythm mix** each time you select the corresponding rhythm in a song.
{% endhint %}

If it's defined, you can always reapply a default rhythm mix using **Load default rhythm mix** from the **Mix console menu File**.

If you want to reset the song mix to the **rhythm's builtin mix** (see above), use **Reset channels** from the **Mix Console Edit menu**, as shown below.

<figure><img src="https://1057949908-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQE7B7yjVY3xzlsorS4-887967055%2Fuploads%2FqWzSJFwototLYB79IYg7%2F2024-09-30%2022_26_48-JJazzLab%20%204.1.2-SNAPSHOT.png?alt=media&#x26;token=46a0667a-80f2-4447-a4b0-7d6e2c93015e" alt=""><figcaption></figcaption></figure>

## Mix file lookup order

Combining the 2 paragraphs above, below is how JJazzLab looks for mix information when you load **myDir/mySong.sng** and this songs uses rhythm **16BeatRock** :

1. use **myDir/mySong.mix** if present<br>
2. use **defaultRhythmMixDir/16BeatRock.mix** if present<br>
3. use **16BeatRock** builtin default mix

Steps 2. and 3. are also used when you add a new rhythm in a song.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jjazzlab.gitbook.io/user-guide/songs/song-and-mix-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
