Impulse and Python step by step setup.

PRA, BeqMoni, Theremino, Fitzpeaks and beyond!
Post Reply
User avatar
Sesselmann
Posts: 1162
Joined: 27 Apr 2015, 11:40
Location: Sydney
Contact:

Impulse and Python step by step setup.

Post by Sesselmann » 29 Jan 2024, 19:30

Maybe you have seen 👀 Impulse and clicked on the link to Github, seen all the folders and apps and scratched your head 🤔...

Whilst it is possible to compile Impulse into a Windows or Mac executable bundle it is a time consuming process which ends up being a heavy 300 MB file, instead it is in many ways neater and faster to work directly with the Python script. It is a much smaller file and easy to do if you know how, so let me write a step by step instruction.

Step 1 - Install Python
Go to the official web site to download the latest stable version of Python 3.12.1 as I am writing this. Avoid the pre-releases as they may still have some bugs. Unzip the file and install it as you would with any other program. Python by itself doesn't do anything so there is no need to launch it or expect it to do anything fancy, it is essentially a translator between Python and whatever operating system you use.
Download here: https://www.python.org/downloads/

Step 2 - Download Impulse from github
For those of you who are not familiar with coding, github.com is a platform where programmers collaborate on code. You don't need to create an account just for downloading my code.
Download zip file here: https://github.com/ssesselmann/impulse
github
github
Step 3 - Unzip the file and move it to your preferred directory
Once you unzip it you will see a folder called impulse-main, this means it is from the main branch, you can leave the -main extension or remove it if you like.
Unzip the folder directly to your preferred directory or move it there after unzipping. Something like ~/python/impulse/ would be a logical choice.
Once you open the directory you will see a bunch of files like this...
dir
dir
Most of these files you don't never need to worry about.

Step 4 - Open the terminal CMD 😱
For some of you this might be the scariest part, but frankly it's not so scary.
cmd
cmd
When you open the terminal window it usually defaults to the home directory, you can confirm this by typing "dir" on windows or "ls -il" on Mac or Linux.
The only other command you need is "cd" for change directory.

Lets start by checking if Python has been installed correctly.

Code: Select all

C:\Users\user > python --version
response

Code: Select all

python 3.12.1
Great, you are off to a good start...
Now we need to install a directory of all libraries called "pip", we do this with the following command.

Code: Select all

C:\Users\user > python -m pip install --upgrade pip
The last part "--upgrade" is in case you already have an older version installed.
Now use the command prompt "cd" to navigate to the "impulse-main" directory. If impulse-main is in your home folder it should just be..

Code: Select all

C:\Users\user > cd python\impulse-main
You can confirm this by typing "dir" on Windows or "ls" on Mac and Linux.

Code: Select all

C:\Users\user\python\impulse-main > dir
total 168
 59371268 -rw-r--r--@  1 stevensesselmann  staff  35129  5 Jan  2023 LICENSE
124499055 -rw-r--r--   1 stevensesselmann  staff   6252 22 Jan 21:33 README.md
 63713191 drwxr-xr-x  33 stevensesselmann  staff   1056 28 Jan 22:15 code
133678292 -rw-r--r--   1 stevensesselmann  staff    159 25 Jan 18:12 requirements_mac.txt
133678293 -rw-r--r--   1 stevensesselmann  staff    152 25 Jan 18:12 requirements_pc.txt
home/impulse % 
Now we need to install the required libraries for Impulse with the following prompt

Code: Select all

C:\Users\user\python\impulse-main > pip install -r requirements.txt
This might take a few minutes and you will see some activity on the screen as your computer installs the libraries.
Once it has completed, you are ready to launch impulse.
On Windows it's just...

Code: Select all

C:\Users\user\python\impulse-main >  python code/impulse.py
On a mac you need to type

Code: Select all

C:\Users\user\python\impulse-main > python3 code/impulse.py
All things going well impulse should launch and open your default browser. Some operating systems will ask permission to access the microphone, which is required for the gammaspectacular.

Troubleshooting
Sometimes a library or module may not install properly for whatever reason, so read the error messages on the command line and if you don't understand what it means copy it into google and there will usually be a million others with the same error and hopefully a solution.

"pyaudio" is the module most likely to cause a problem, so try installing it manually with;

Code: Select all

pip install pyaudio
Failing that drop me a PM and I am more than happy to help you find a solution.
Baby Pink
Baby Pink
... and if baby pink is not your thing, you can select neutral grey, hippie orange, sunburst or bananas 😂

Happy spectrometising...

Steven

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest