Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

Tags for this mod

About this mod

Provides advanced customization of the game's sound cues. Lets you combine or replace tracks with other cues, indexed sound tracks, or custom audio files; silence sound cues; change pitch and volume or set random pitch and / or volume; and more!

Requirements
Permissions and credits
Changelogs
Donations
This mod is a replacement for my Sound Effect Replacement mod that provides much more flexibility over sound effect and music replacement in Stardew Valley.

An example of a mod using this framework (actually the reason this framework came into existence) is Softer Snow Footstep Sound.


Basic Usage

To use this mod, you will need to create a Content Patcher mod that targets this mod's dictionary.

Cue Paths

A simple content.json file is something like this:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.SoundTweaker/dictionary",
            "Entries": {
                "snowyStep": {
                    "sounds": [
                        {
                            "cuePaths": [
                                "thudStep"
                            ]
                        }
                    ],
                }
            }
        }
    ]
}

This simply replaces the snowyStep sound with the thudStep sound, preserving all parameters of the thudStep sound.

The following page has the names of all the sound cues in the game:

https://stardewvalleywiki.com/Modding:Audio#Track_list


File Paths

Instead of cuePaths, you can direct the mod to play your own list of sound files using filePaths, e.g.:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.SoundTweaker/dictionary",
            "Entries": {
                "snowyStep": {
                    "sounds": [
                        {
                            "filePaths": [
                                "{{InternalAssetKey: sounds/Snowystep_Soft_01.wav}}",
                                "{{InternalAssetKey: sounds/Snowystep_Soft_02.wav}}",
                                "{{InternalAssetKey: sounds/Snowystep_Soft_03.wav}}"
                            ]
                        }
                    ],
                }
            }
        }
    ]
}

These files have to be placed your Content Patcher mod's folder. The sound files above should be in a sounds subfolder.

This method does not automatically preserve any sound parameters (in this case, the snowyStep sound's random pitch). You must add your own sound parameters, as explained below.


Sound Indexes

Finally, you can target specific sound indexes in the sound bank using soundIndexes, e.g.:

{
    "Format": "1.23.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.SoundTweaker/dictionary",
            "Entries": {
                "snowyStep": {
                    "sounds": [
                        {
                            "soundIndexes": [
                                86,
                                87,
                                88,
                                89,
                                90
                            ]
                        }
                    ]
                }
            }
        }
    ]
}

This replaces the snowyStep sound with the four sounds associated with the SpringBirds sound cue.

Use the following page to get the sound indexes for in-game sounds (use the ones under decimal):

https://stardewvalleywiki.com/Modding:Audio#Track_list

Again, this method does not automatically preserve any sound parameters. See below to add your own parameters.


Sound Disabling

If you just want to silence a sound cue entirely, omit the sounds key entirely. E.g.:

{
"Format": "1.23.0",
"Changes": [
  {
"Action": "EditData",
"Target": "aedenthorn.SoundTweaker/dictionary",
"Entries": {
"snowyStep": {
}
}
  }
]
}

This will silence the snowyStep sound cue entirely.


Customization

You can add the following keys to a dictionary entry to customize the sound cue:

  • maxInstances - how many instances of this sound can be playing at once (default 1)
  • limitBehavior - what to do when more than the maxInstances try to play at once.  (default ReplaceOldest)

Possible values for limitBehavior are ReplaceOldest and FailToPlay.

For each entry in the sounds object of a dictionary entry, you can add the following keys to customize the tracks of individual sounds (one sound cue can contain multiple sounds, and one sound can contain multiple tracks):

  • variationType - rule used to select a track to play. One of Ordered, OrderedFromRandom, Random, RandomNoImmediateRepeats, Shuffle.
  • category - which category this sound belongs to. Affects sound volume. See here. One of Music, Sound, Ambient, Footsteps (default is Sound).
  • loop (true or false)
  • reverb (true or false) - I'm not sure this does anything at the moment.
  • pitch - set a custom static pitch (1.0 is normal pitch, I think, or maybe 0)
  • minPitch - set a custom random pitch minimum, must be used with maxPitch
  • maxPitch - set a custom random pitch maximum, must be used with minPitch
  • volume - set a custom static volume (1.0 is 100% volume). This is affected by the sound category.
  • minVolume - set a custom random volume minimum, must be used with maxVolume
  • maxVolume - set a custom random volume maximum, must be used with minVolume
  • minFrequency - custom frequency variable, don't use unless you know what you're doing or like living dangerously
  • maxFrequency - custom frequency variable
  • minQ - custom frequency variable
  • maxQ - custom frequency variable
  • filterMode - one of LowPass, BandPass, HighPass
  • rpcCurves - list of rpc curve indexes. See below.

An example content.json file that uses most of these parameters just to illustrate:

{
 "Format": "1.23.0",
 "Changes": [
 {
"Action": "EditData",
"Target": "aedenthorn.SoundTweaker/dictionary",
"Entries": {
 "snowyStep": {
 "sounds": [
{
 "variationType": "RandomNoImmediateRepeats",
 "category": "Sound",
 "filePaths": [
 "aedenthorn.TestSound/guitar",
 "aedenthorn.TestSound/drum"
 ],
 "cuePaths": [
 "toyPiano",
 "flute"
 ],
 "soundIndexes": [
 257,
 258,
 259
 ],
 "loop": false,
 "reverb": false,
 "pitch": null,
 "minPitch": -1.0,
 "maxPitch": 1.0,
 "volume": null,
 "minVolume": 0.5,
 "maxVolume": 1.0,
 "minFrequency": 0.0,
 "maxFrequency": 1000.0,
 "minQ": 0.0,
 "maxQ": 500.0,
 "filterMode": "HighPass",
 "rpcCurves": [
 0
 ]
}
 ],
 "maxInstances": 1,
 "limitBehavior": 2
 }
}
 }
 ]
}

The above makes snowyStep sound like this:




RPC Curves

I don't even know what an RPC curve is, but I can tell you that Stardew Valley defines 11 of them. Here is the list for you to experiment:

  • 0 - 280,6,Pitch
  • 1 - 303,7,Volume
  • 2 - 335,8,FilterFrequency
  • 3 - 358,9,Pitch
  • 4 - 381,8,FilterFrequency
  • 5 - 404,8,FilterQFactor
  • 6 - 427,7,Volume
  • 7 - 477,8,FilterQFactor
  • 8 - 599,8,FilterFrequency
  • 9 - 658,8,Pitch
  • 10 - 708,7,Volume

The first variable is called Variable and the second variable is called RpcCurve. The third variable is pretty obvious.


Technical

Requires SMAPI.

Compatible with Mod Updater for automatic updates.

Code is at https://github.com/aedenthorn/StardewValleyMods.

If you want to complain or ask for help or help me test my mods, you can visit my Discord server.

A list of all my mods for Stardew Valley is available at https://www.nexusmods.com/stardewvalley/articles/895.