No description
Find a file
Haokun Tian 6795bce6d4
Some checks failed
Python package / build-ubuntu (cp310-manylinux_x86_64, 3.10, /opt/python/cp310-cp310/include/python3.10, /opt/python/cp310-cp310/lib) (push) Has been cancelled
Python package / build-ubuntu (cp311-manylinux_x86_64, 3.11, /opt/python/cp311-cp311/include/python3.11, /opt/python/cp311-cp311/lib) (push) Has been cancelled
Python package / build-ubuntu (cp312-manylinux_x86_64, 3.12, /opt/python/cp312-cp312/include/python3.12, /opt/python/cp312-cp312/lib) (push) Has been cancelled
Python package / build-ubuntu (cp313-manylinux_x86_64, 3.13, /opt/python/cp313-cp313/include/python3.13, /opt/python/cp313-cp313/lib) (push) Has been cancelled
Python package / build-ubuntu (cp39-manylinux_x86_64, 3.9, /opt/python/cp39-cp39/include/python3.9, /opt/python/cp39-cp39/lib) (push) Has been cancelled
Python package / build-macos (arm64, cp310-macosx_arm64, macos-14, 3.10) (push) Has been cancelled
Python package / build-macos (arm64, cp311-macosx_arm64, macos-14, 3.11) (push) Has been cancelled
Python package / build-macos (arm64, cp312-macosx_arm64, macos-14, 3.12) (push) Has been cancelled
Python package / build-macos (arm64, cp313-macosx_arm64, macos-14, 3.13) (push) Has been cancelled
Python package / build-macos (arm64, cp39-macosx_arm64, macos-14, 3.9) (push) Has been cancelled
Python package / build-macos (x86_64, cp310-macosx_x86_64, macos-13, 3.10) (push) Has been cancelled
Python package / build-macos (x86_64, cp311-macosx_x86_64, macos-13, 3.11) (push) Has been cancelled
Python package / build-macos (x86_64, cp312-macosx_x86_64, macos-13, 3.12) (push) Has been cancelled
Python package / build-macos (x86_64, cp313-macosx_x86_64, macos-13, 3.13) (push) Has been cancelled
Python package / build-macos (x86_64, cp39-macosx_x86_64, macos-13, 3.9) (push) Has been cancelled
Python package / build-windows (cp310*, windows-2022, 3.10) (push) Has been cancelled
Python package / build-windows (cp311*, windows-2022, 3.11) (push) Has been cancelled
Python package / build-windows (cp312*, windows-2022, 3.12) (push) Has been cancelled
Python package / build-windows (cp313*, windows-2022, 3.13) (push) Has been cancelled
Python package / build-windows (cp39*, windows-2022, 3.9) (push) Has been cancelled
Python package / build-ubuntu (cp310-manylinux_x86_64, 3.10, /opt/python/cp310-cp310/include/python3.10, /opt/python/cp310-cp310/lib) (release) Has been cancelled
Python package / build-ubuntu (cp311-manylinux_x86_64, 3.11, /opt/python/cp311-cp311/include/python3.11, /opt/python/cp311-cp311/lib) (release) Has been cancelled
Python package / build-ubuntu (cp312-manylinux_x86_64, 3.12, /opt/python/cp312-cp312/include/python3.12, /opt/python/cp312-cp312/lib) (release) Has been cancelled
Python package / build-ubuntu (cp313-manylinux_x86_64, 3.13, /opt/python/cp313-cp313/include/python3.13, /opt/python/cp313-cp313/lib) (release) Has been cancelled
Python package / build-ubuntu (cp39-manylinux_x86_64, 3.9, /opt/python/cp39-cp39/include/python3.9, /opt/python/cp39-cp39/lib) (release) Has been cancelled
Python package / build-macos (arm64, cp310-macosx_arm64, macos-14, 3.10) (release) Has been cancelled
Python package / build-macos (arm64, cp311-macosx_arm64, macos-14, 3.11) (release) Has been cancelled
Python package / build-macos (arm64, cp312-macosx_arm64, macos-14, 3.12) (release) Has been cancelled
Python package / build-macos (arm64, cp313-macosx_arm64, macos-14, 3.13) (release) Has been cancelled
Python package / build-macos (arm64, cp39-macosx_arm64, macos-14, 3.9) (release) Has been cancelled
Python package / build-macos (x86_64, cp310-macosx_x86_64, macos-13, 3.10) (release) Has been cancelled
Python package / build-macos (x86_64, cp311-macosx_x86_64, macos-13, 3.11) (release) Has been cancelled
Python package / build-macos (x86_64, cp312-macosx_x86_64, macos-13, 3.12) (release) Has been cancelled
Python package / build-macos (x86_64, cp313-macosx_x86_64, macos-13, 3.13) (release) Has been cancelled
Python package / build-macos (x86_64, cp39-macosx_x86_64, macos-13, 3.9) (release) Has been cancelled
Python package / build-windows (cp310*, windows-2022, 3.10) (release) Has been cancelled
Python package / build-windows (cp311*, windows-2022, 3.11) (release) Has been cancelled
Python package / build-windows (cp312*, windows-2022, 3.12) (release) Has been cancelled
Python package / build-windows (cp313*, windows-2022, 3.13) (release) Has been cancelled
Python package / build-windows (cp39*, windows-2022, 3.9) (release) Has been cancelled
Python package / Upload wheels to PyPI (push) Has been cancelled
Python package / Upload wheels to PyPI (release) Has been cancelled
make sample rate configurable (#6)
2025-09-10 15:56:21 -04:00
.github/workflows update README 2025-01-09 10:28:11 -05:00
examples Normalized parameters and parameter introspection (#3) 2025-06-03 11:08:12 -04:00
headless Normalized parameters and parameter introspection (#3) 2025-06-03 11:08:12 -04:00
src make sample rate configurable (#6) 2025-09-10 15:56:21 -04:00
tests make sample rate configurable (#6) 2025-09-10 15:56:21 -04:00
third_party Normalized parameters and parameter introspection (#3) 2025-06-03 11:08:12 -04:00
tunings copy from mtytel/Vital 2025-01-08 14:12:44 -05:00
vita Normalized parameters and parameter introspection (#3) 2025-06-03 11:08:12 -04:00
.gitignore add pickle support 2025-02-13 14:21:57 -05:00
.gitmodules add nanobind submodule 2025-01-08 14:22:37 -05:00
build_linux.sh add pickle support 2025-02-13 14:21:57 -05:00
build_macos.sh add Python bindings code 2025-01-08 14:54:55 -05:00
LICENSE Initial commit 2025-01-08 14:04:01 -05:00
Makefile make sample rate configurable (#6) 2025-09-10 15:56:21 -04:00
MANIFEST.in add Python bindings code 2025-01-08 14:54:55 -05:00
pyproject.toml add Python bindings code 2025-01-08 14:54:55 -05:00
README.md make sample rate configurable (#6) 2025-09-10 15:56:21 -04:00
setup.py Normalized parameters and parameter introspection (#3) 2025-06-03 11:08:12 -04:00
test-requirements.txt add Python bindings code 2025-01-08 14:54:55 -05:00

Vita

Vita is a Python module for interacting with the Vital Synthesizer. It is not an official product related to Vital. Vita uses Effort-based versioning.

Installation

Vita is supported on Linux, macOS, and Windows. Install with pip:

pip install vita

Example

from scipy.io import wavfile
import vita

sample_rate = 44100
bpm = 120.0
note_dur = 1.0
render_dur = 3.0
pitch = 36  # integer
velocity = 0.7  # [0.0 to 1.0]

synth = vita.Synth()
# The initial preset is loaded by default.

synth.set_sample_rate(sample_rate)
synth.set_bpm(bpm)

# Let's make a custom modulation using
# the available modulation sources and destinations.
# These lists are constant.
print("potential sources:", vita.get_modulation_sources())
print("potential destinations:", vita.get_modulation_destinations())

# "lfo_1" is a potential source,
# and "filter_1_cutoff" is a potential destination.
assert synth.connect_modulation("lfo_1", "filter_1_cutoff")

controls = synth.get_controls()
controls["modulation_1_amount"].set(1.0)
controls["filter_1_on"].set(1.0)
val = controls["filter_1_on"].value()
controls["lfo_1_tempo"].set(vita.constants.SyncedFrequency.k1_16)

# Use normalized parameter control (0-1 range, VST-style)
controls["filter_1_cutoff"].set_normalized(0.5)  # Set knob to 50%
print(controls["filter_1_cutoff"].get_normalized())  # Get normalized value

# Get parameter details and display text
info = synth.get_control_details("delay_style")
print(f"Options: {info.options}")  # ["Mono", "Stereo", "Ping Pong", "Mid Ping Pong"]
print(f"Current: {synth.get_control_text('delay_style')}")  # e.g., "Stereo"

# Render audio to numpy array shaped (2, NUM_SAMPLES)
audio = synth.render(pitch, velocity, note_dur, render_dur)

wavfile.write("generated_preset.wav", sample_rate, audio.T)

# Dump current state to JSON text
preset_path = "generated_preset.vital"

json_text = synth.to_json()

with open(preset_path, "w") as f:    
    f.write(json_text)

# Load JSON text
with open(preset_path, "r") as f:
    json_text = f.read()

assert synth.load_json(json_text)

# Or load directly from file
assert synth.load_preset(preset_path)

# Load the initial preset, which also clears modulations
synth.load_init_preset()
# Or just clear modulations.
synth.clear_modulations()

Documentation is not yet automated. Please browse bindings.cpp to get a sense of how the code works.

Issues

If you find any issues with the code, report them at https://github.com/DBraun/Vita.

Code Licensing

If you are making a proprietary or closed source app and would like to use Vital's source code, contact licensing@vital.audio for non GPLv3 licensing options.

What can you do with the source

The source code is licensed under the GPLv3. If you download the source or create builds you must comply with that license.

Things you can't do with this source

  • Do not create an app and distribute it on the iOS app store. The app store is not comptabile with GPLv3 and you'll only get an exception for this if you're paying for a GPLv3 exception for Vital's source (see Code Licensing above).
  • Do not use the name "Vital", "Vital Audio", "Tytel" or "Matt Tytel" for marketing or to name any distribution of binaries built with this source. This source code does not give you rights to infringe on trademarks.
  • Do not connect to any web service at https://vital.audio, https://account.vital.audio or https://store.vital.audio from your own builds. This is against the terms of using those sites.
  • Do not distribute the presets that come with the free version of Vital. They're under a separate license that does not allow redistribution.