Productivity Tool for Your Sound Experiments

Posted by lemur47 on 21 October 2024

This morning, we wrote some Python code for our own productivity and shared it via our GitLab repository for your productivity as well. This little tool helps you calculate the just intonation scale based on your input.

Command-line tool

Before today, we'd manually calculate the frequencies every time we needed them. That means that we had to type at least 8 times to be sure which frequencies we could use in our sound art. That's not productive, even if you're not a programmer or a hacker. It's time to automate what you do.

The important thing is not to spend a lot of time perfecting your tool. You're not writing code to deliver it to your client or the market. It might be dirty or primitive, but that's totally OK.

# Filename = just_intonation.py
import sys
from decimal import Decimal, ROUND_HALF_UP

base_freq = float(sys.argv[1])
decimal_places = ".001"
major_scale = (1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8, 2/1)
minor_scale = (1, 9/8, 6/5, 4/3, 3/2, 8/5, 9/5, 2/1)

print("\nMAJOR SCALE")
for freq in major_scale:
    freq = base_freq * freq
    freq = Decimal(str(freq))
    freq = freq.quantize(Decimal(decimal_places), rounding=ROUND_HALF_UP)
    print(freq)

print("\n\nMINOR SCALE")
for freq in minor_scale:
    freq = base_freq * freq
    freq = Decimal(str(freq))
    freq = freq.quantize(Decimal(decimal_places), rounding=ROUND_HALF_UP)
    print(freq)

print("\n")

Ah yes, this is super dirty code, but it works. This Python script calculates the frequencies and shows them to you in a terminal app. It'll save you time and typing when you're trying to use the just intonation scale.

To use the Python code, you need one more script to wrap it up. This can be a shell script, depending on your terminal environment. In our case, the script looks like this.

#!/bin/zsh
# Filename = jifreq
# Replace "$HOME/YOUR_DIR/scripts" with your directory path
SCRIPT_DIR=$HOME/YOUR-DIR/scripts

if [ $# -eq 1 ]; then
    python $SCRIPT_DIR/just_intonation.py $1
else
    exit 1
fi

After installing these 2 scripts in your environment, you can run the command as follows.

% jifreq 264

While testing the tool, we found something interesting. The relationship between 33 Hz, 66 Hz and 99 Hz. The same thing goes for 333 Hz, 666 Hz and 999 Hz. Usually, the repeated number means the ever-lasting information energy like Pi, and the relationship is octave and 5th.

We still don't know what it really means and how it brings something to you and us, but our intuition says that it's related to the holographic reality created by mind technology in a vibrational fractal and structural topological way.

You can find more tools in our repository, and we'll update the repository when we find new things. And the detail of the just intonation, this page will help you a lot.

Does this help you?

If you feel that this content has changed your mind, please support us with some coffee ☕️