Hi! I wasn't having much luck with searching around, so I'm hoping you can clear up some things. I'm trying to figure out how to do more advanced things with audio. I'd like to have low-pass, reverb, EQ, pitch-bending and crossfading filters, and dynamic volume changes across multiple channels for things like sidechain compression. But that's a lot, so let's keep it simple to start with.
I want to apply a low-pass filter to an ambient audio channel live.
A low-pass filter can be used to remove the high-frequency sounds in an audio file, for muffling the sound of rainfall inside a building, or muting conversations through walls or objects.
The lazy option is to make two versions of the audio file in Audacity, and synchronise them on two music channels, but that sucks.
https://www.renpy.org/doc/html/python.h ... d-packages
https://github.com/carlthome/python-audio-effects
I have a very, very low amount of knowledge about python. Apparently, I have to install python modules using something called pip, but I cannot find an explanation for what any of that is or how they work or where I can get them. It's a library loader or organiser? And it needs Anaconda? I read that I can install something called Numpy, somehow. But Renpy only accepts things written using something called pure python, and Numpy has C dependencies, apparently. I don't know what Numpy is or where to get one or how to install it, but everything I've read so far seems to assume I do know. So y'know I've come to terms with the fact that I'm out of my depth, here. But that's okay.
Because I'm on Windows 7, I don't think I have a way to load or install modules or libraries. I also can't install Python3 I don't think, only supports Win10, but I don't think that matters because Renpy is using Python2.
If you can give me a really, absurdly basic idea of what I need to get started, that'd be ideal.
I'm really grateful for your help!
Audio filters in Renpy and Python
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
Pugnippets
- Newbie
- Posts: 2
- Joined: Fri Aug 13, 2021 10:43 pm
- Contact:
- hell_oh_world
- Miko-Class Veteran
- Posts: 777
- Joined: Fri Jul 12, 2019 5:21 am
- Projects: The Button Man
- Organization: NILA
- Github: hell-oh-world
- Location: Philippines
- Contact:
Re: Audio filters in Renpy and Python
the library that you want to use is a bit different, that actually takes an audio file then applies the effects, and saves it as a new audio file. It does not apply those effects while in-game. Besides, renpy handle audios a bit differently so I don't think you can easily integrate python audio libs unless it's specifically made for renpy (correct me if I'm wrong). Your best bet is to stick with your "lazy option".
Anyways, for future reference, here's a step-by-step procedure on how to install any python module on renpy.
The easiest way to install python modules in your game is to use pip, its a package installer used to install python modules in your system/project.
for that, you need to have python installed in your system first since pip is part of the python installation itself.
1. Renpy is based on python 2.7 so you need to have the same version running in your system.
2. While installing python 2.7, make sure that you checked the option that says add to path or something similar to that.
3. Once finished, you can go to your project folder, in your project folder create a folder named python-packages, so you should have something like game/python-packages folder.
4. Inside the python-packages folder, press alt + d then type cmd and press enter.
5. In the new command prompt, you can now use pip to install modules. You just need to type pip install <package_name> --target=./ Wait for it to finish, and by the end, you should see your package inside the python-packages folder.
6. Now you can use it in your game like...
Anyways, for future reference, here's a step-by-step procedure on how to install any python module on renpy.
The easiest way to install python modules in your game is to use pip, its a package installer used to install python modules in your system/project.
for that, you need to have python installed in your system first since pip is part of the python installation itself.
1. Renpy is based on python 2.7 so you need to have the same version running in your system.
2. While installing python 2.7, make sure that you checked the option that says add to path or something similar to that.
3. Once finished, you can go to your project folder, in your project folder create a folder named python-packages, so you should have something like game/python-packages folder.
4. Inside the python-packages folder, press alt + d then type cmd and press enter.
5. In the new command prompt, you can now use pip to install modules. You just need to type pip install <package_name> --target=./ Wait for it to finish, and by the end, you should see your package inside the python-packages folder.
6. Now you can use it in your game like...
Code: Select all
init python:
import <package_name>
-
Pugnippets
- Newbie
- Posts: 2
- Joined: Fri Aug 13, 2021 10:43 pm
- Contact:
Re: Audio filters in Renpy and Python
Brilliant! Thank you very much for the help. I'll update this thread if I make any progress towards my goal.
I'd also like to clear up some things in case other people come across this who are on the same level as me.
Alt+D activates explorer's address bar, and cmd runs command line prompt, with the current folder location. Neat feature, didn't know that! The pip command is smart and downloads files from what I assume is the git repository, which is a place on github. So you don't need an installer. adding --target=./ installs it to the current directory instead of the default location (which would be python27/lib/ or something).
I'd also like to clear up some things in case other people come across this who are on the same level as me.
Alt+D activates explorer's address bar, and cmd runs command line prompt, with the current folder location. Neat feature, didn't know that! The pip command is smart and downloads files from what I assume is the git repository, which is a place on github. So you don't need an installer. adding --target=./ installs it to the current directory instead of the default location (which would be python27/lib/ or something).
Who is online
Users browsing this forum: No registered users