Skip to content

Commit

Permalink
Added bass boost effect
Browse files Browse the repository at this point in the history
  • Loading branch information
rnnh committed Mar 15, 2022
1 parent cf11c52 commit ec49a71
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ $ python vaporiser.py --help

```
usage: vaporiser.py [-h] [-o OUTPUT_NAME] -a AUDIO_INPUT [-s SPEED_RATIO]
[-p PITCH_SHIFT] [-l LOWPASS_CUTOFF] [-tr] [-ph]
[-ga GAIN_DB] [-co] [-g GIF_FILE] [-sb]
[-p PITCH_SHIFT] [-l LOWPASS_CUTOFF] [-b BASS]
[-ga GAIN_DB] [-tr] [-ph] [-co] [-g GIF_FILE] [-sb]
Creates a vaporwave (slowed, with reverb) remix of a given MP3 file, with the
option of playing over a looped GIF as a video.
Expand Down Expand Up @@ -125,10 +125,12 @@ audio arguments:
extra audio arguments:
these arguments control extra, optional audio effects
-tr, --tremolo Enable tremolo effect. (default: False)
-ph, --phaser Enable phaser effect. (default: False)
-b BASS, --bass BASS Add a bass boost effect (e.g. --bass 3). (default:
None)
-ga GAIN_DB, --gain GAIN_DB
Applies gain (dB). (default: None)
-tr, --tremolo Enable tremolo effect. (default: False)
-ph, --phaser Enable phaser effect. (default: False)
-co, --compand Enable compand, which compresses the dynamic range of
the audio. (default: False)
Expand Down
38 changes: 27 additions & 11 deletions vaporiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ def main():
"extra audio arguments", "these arguments control extra, optional audio effects"
)

audio_arguments_optional.add_argument(
"-b",
"--bass",
dest="bass",
help="Add a bass boost effect (e.g. --bass 3).",
type=int,
default=None,
)

audio_arguments_optional.add_argument(
"-ga",
"--gain",
dest="gain_db",
help="Applies gain (dB).",
type=int,
default=None,
)

audio_arguments_optional.add_argument(
"-tr",
"--tremolo",
Expand All @@ -94,15 +112,6 @@ def main():
action="store_true",
)

audio_arguments_optional.add_argument(
"-ga",
"--gain",
dest="gain_db",
help="Applies gain (dB).",
type=int,
default=None,
)

audio_arguments_optional.add_argument(
"-co",
"--compand",
Expand Down Expand Up @@ -154,8 +163,15 @@ def main():
print("ERROR: Input and output name are identical")
sys.exit()

# Creating audio effects chain function
fx = AudioEffectsChain().pitch(args.pitch_shift)
# Creating an audio effects chain, beginning with...
if args.bass:
# ...bass boost effect
bass_boost = f'{"bass "}{args.bass}'
fx = AudioEffectsChain().custom(bass_boost)
fx = fx.pitch(args.pitch_shift)
else:
# ...pitch shift
fx = AudioEffectsChain().pitch(args.pitch_shift)

# Adds tremolo effect to the audio effects chain
if args.tremolo:
Expand Down

0 comments on commit ec49a71

Please sign in to comment.