Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunvox 2.0 file format #71

Merged
merged 150 commits into from
Feb 23, 2025
Merged

Sunvox 2.0 file format #71

merged 150 commits into from
Feb 23, 2025

Conversation

matthewryanscott
Copy link
Contributor

@matthewryanscott matthewryanscott commented Dec 28, 2021

2.0

  • Project: Supertracks
    • Option for turning them on/off
      • Python
      • TS
    • Determining which supertrack a pattern is in.
      • Python
      • TS
  • Modules: Multi-selection
    • Python
    • TS
  • Patterns: Turn off all notes at the end option
    • Python
    • TS
  • Patterns: New effect constants
    • Python
    • TS
  • Fmx custom waveform chunk
    • Python
    • TS
  • Create tests for new modules
    • Fft
      • Python
      • TS
    • Fmx
      • Python
      • TS
  • Finish quoting enum keys in fileformat.yaml
  • Update tests for added controllers/options
    • Amplifier
      • Python
      • TS
    • AnalogGenerator
      • Python
      • TS
    • Delay
      • Python
      • TS
    • Echo
      • Python
      • TS
    • MultiSynth
      • Python
      • TS
    • Sampler
      • Python
      • TS
    • VocalFilter
      • Python
      • TS

2.1

  • Distortion: new type "saturation" (adding odd harmonics) + five of its variations;
    • Python
    • TS
  • MultiSynth: new option "Output port number = random" (three different algorithms are available);
    • Python
    • TS
  • Loop: new controller "Length unit" (line/128;line;line/2;line/3;tick;ms;Hz);
    • Python
    • TS
  • Loop: new controller "Maximum buffer size" (in seconds) to protect against allocating too much memory;
    • Python
    • TS
  • Loop: the maximum of the "Repeat" controller has been increased to 128 (128 = repeat endlessly);
    • Python
    • TS
  • new curve types for ADSR and FMX modules: rect; smooth rect; 2-bit (linear); 3-bit; 4-bit; 5-bit;
    • Python
    • TS
  • new pattern effect (column EE): 35 - bind MIDI OUT message XX (0 - Program Change; 1 - Channel Pressure; 2 - Pitch Bend Change) to controller YY (0 - OFF; 0x80 - MIDI controller 0; 0x81 - MIDI controller 1...); for the specified module only;
    • Python
    • TS
  • new special pattern command: "XX" - stop the module, clear its internal buffers and put it into standby mode;
    • Python
    • TS

2.1b

  • Loop: new controller "On NoteON" (restart with transition to zero iteration (record);restart current iteration); see simple_examples/loop4.sunvox;
    • Python
    • TS
  • pattern effect 34: new value 4 - use Round-robin keyboard track allocation algorithm, instead of default tight packing; may be required for live play on the MultiSynth module with the "trigger" option; but this option may cause the brush to work incorrectly;
    • Python
    • TS

2.1.1

  • Modulator: new controller "Max phase modulation delay";
    • Python
    • TS
  • Vorbis player: new controller "Ignore Note OFF" (play every note endlessly);
    • Python
    • TS
  • MetaModule: new option "Auto BPM/TPL" (synchronize BPM and TPL of the module with BPM and TPL of the parent project);
    • Python
    • TS

2.1.1c

  • Sampler: new controller "Tick length" (affects the duration of the envelopes);
    • Python
    • TS

2.1.2

  • new module Smooth - it attempts to follow the waveform of the incoming signal, smoothing out sharp changes in accordance with the Rise and Fall parameters;
    • Python
    • TS
  • new modulation types in FMX and Analog Generator (Osc2 modes):
    • min abs: if( abs(in2) < abs(in1) ) out = in2; else out = in1;
    • max abs: if( abs(in2) > abs(in1) ) out = in2; else out = in1;
    • Python
    • TS
  • Modulator: additional modulation types (as in FMX and Analog Generator) have been added;
    • Python
    • TS
  • MetaModule: new options: (see simple_examples/metamodule options 78,79.sunvox)
    • 79 - ignore effect 31 (jump to line XXYY) after the last Note OFF; works only if "Play patterns" >= 3;
    • 78 - jump to the "RL" pattern after the last Note OFF; works only if "Play patterns" >= 3;
    • Python
    • TS
  • Filter Pro: max value of the Roll-off controller has been raised to 96dB;
    • Python
    • TS
  • Filter Pro: since version 2.1.2 the Roll-off controller also affects the All-pass filter type; see simple_examples/freq dispersion.sunvox;
    • Python
    • TS
  • Reverb: improved type of all-pass filter has been added to controller 8 - it has almost no effect on the gain of the original signal frequencies;
    • Python
    • TS
  • Delay: new controller "Negative feedback" for changing the sign of feedback;
    • Python
    • TS
  • Delay: new controller "All-pass filter" for switching the module to All-pass mode, where the filter order is the delay length in samples;
    • Python
    • TS
  • Glide: new controllers "Octave", "Frequency multiply" and "Frequency divide";
    • Python
    • TS
  • Pitch Detector: new algorithm - "spectral peak"; it determines the frequency of the loudest harmonic with high accuracy; suitable for signals with pronounced fundamental harmonic;
    • Python
    • TS
  • Sampler: new controller "Record" (stop/pause/start recording); see simple_examples/sampler rec automation.sunvox;
    • Python
    • TS
  • sample editor: new function "Set the start position" (position at which the sample will start playing);
    • Python
    • TS
  • sample editor: new function "Adjust to specified length (without resampling)" (editor menu -> Misc) - allows you to set a note at which the sample will fit exactly into the specified length;
    • Python
    • TS
  • sample editor: view settings (in the menu) allow you to set the units (samples, seconds, ticks, etc.) in which the cursor position and selection size will be displayed;
    • Python
    • TS
  • pattern effect 34: new option 8 has been added - enable it if you need to output 7-bit MIDI controller values, even if the controller is 14-bit (0-31);
    • Python
    • TS

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 21, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.48%.

Quality metrics Before After Change
Complexity 2.68 ⭐ 2.51 ⭐ -0.17 👍
Method Length 66.49 🙂 66.69 🙂 0.20 👎
Working memory 9.84 🙂 10.09 😞 0.25 👎
Quality 69.97% 🙂 69.49% 🙂 -0.48% 👎
Other metrics Before After Change
Lines 8095 8173 78
Changed files Quality Before Quality After Quality Change
src/python/genrv/codegen/python/gen.py 51.21% 🙂 50.69% 🙂 -0.52% 👎
src/python/genrv/tools/generate.py 83.23% ⭐ 83.37% ⭐ 0.14% 👍
src/python/rv/__init__.py 100.00% ⭐ 100.00% ⭐ 0.00%
src/python/rv/api.py 78.32% ⭐ 78.32% ⭐ 0.00%
src/python/rv/controller.py 84.41% ⭐ 85.16% ⭐ 0.75% 👍
src/python/rv/note.py 51.91% 🙂 50.57% 🙂 -1.34% 👎
src/python/rv/pattern.py 78.23% ⭐ 78.08% ⭐ -0.15% 👎
src/python/rv/project.py 52.98% 🙂 52.81% 🙂 -0.17% 👎
src/python/rv/chunks/array.py 84.56% ⭐ 85.35% ⭐ 0.79% 👍
src/python/rv/chunks/chunk.py 95.37% ⭐ 95.37% ⭐ 0.00%
src/python/rv/chunks/drawnwaveform.py 91.21% ⭐ 91.21% ⭐ 0.00%
src/python/rv/lib/iff.py 83.39% ⭐ 83.34% ⭐ -0.05% 👎
src/python/rv/modules/__init__.py 56.19% 🙂 55.30% 🙂 -0.89% 👎
src/python/rv/modules/amplifier.py 88.78% ⭐ 88.78% ⭐ 0.00%
src/python/rv/modules/analoggenerator.py 86.26% ⭐ 86.26% ⭐ 0.00%
src/python/rv/modules/compressor.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/dcblocker.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/delay.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/distortion.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/drumsynth.py 33.37% 😞 33.37% 😞 0.00%
src/python/rv/modules/echo.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/eq.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/feedback.py 88.78% ⭐ 88.78% ⭐ 0.00%
src/python/rv/modules/filter.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/filterpro.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/flanger.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/fm.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/generator.py 87.84% ⭐ 87.84% ⭐ 0.00%
src/python/rv/modules/glide.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/gpio.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/input.py 90.24% ⭐ 90.24% ⭐ 0.00%
src/python/rv/modules/kicker.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/lfo.py 90.24% ⭐ 90.24% ⭐ 0.00%
src/python/rv/modules/loop.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/metamodule.py 78.61% ⭐ 79.11% ⭐ 0.50% 👍
src/python/rv/modules/modulator.py 89.26% ⭐ 89.26% ⭐ 0.00%
src/python/rv/modules/module.py 74.54% 🙂 75.94% ⭐ 1.40% 👍
src/python/rv/modules/multictl.py 51.92% 🙂 51.94% 🙂 0.02% 👍
src/python/rv/modules/multisynth.py 80.56% ⭐ 80.56% ⭐ 0.00%
src/python/rv/modules/pitch2ctl.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/pitchshifter.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/reverb.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/sound2ctl.py 91.55% ⭐ 91.55% ⭐ 0.00%
src/python/rv/modules/spectravoice.py 76.59% ⭐ 76.59% ⭐ 0.00%
src/python/rv/modules/velocity2ctl.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/vibrato.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/vocalfilter.py 89.75% ⭐ 89.75% ⭐ 0.00%
src/python/rv/modules/vorbisplayer.py 92.04% ⭐ 92.04% ⭐ 0.00%
src/python/rv/modules/waveshaper.py 90.51% ⭐ 90.51% ⭐ 0.00%
src/python/rv/modules/base/adsr.py 56.88% 🙂 51.30% 🙂 -5.58% 👎
src/python/rv/modules/base/amplifier.py 88.35% ⭐ 87.19% ⭐ -1.16% 👎
src/python/rv/modules/base/analoggenerator.py 48.06% 😞 47.97% 😞 -0.09% 👎
src/python/rv/modules/base/compressor.py 83.83% ⭐ 83.83% ⭐ 0.00%
src/python/rv/modules/base/ctl2note.py 74.85% 🙂 74.85% 🙂 0.00%
src/python/rv/modules/base/dcblocker.py 91.56% ⭐ 91.56% ⭐ 0.00%
src/python/rv/modules/base/delay.py 62.26% 🙂 59.51% 🙂 -2.75% 👎
src/python/rv/modules/base/distortion.py 83.28% ⭐ 81.67% ⭐ -1.61% 👎
src/python/rv/modules/base/drumsynth.py 80.61% ⭐ 80.61% ⭐ 0.00%
src/python/rv/modules/base/echo.py 67.83% 🙂 65.65% 🙂 -2.18% 👎
src/python/rv/modules/base/eq.py 87.78% ⭐ 87.78% ⭐ 0.00%
src/python/rv/modules/base/feedback.py 90.28% ⭐ 90.28% ⭐ 0.00%
src/python/rv/modules/base/filter.py 60.47% 🙂 60.47% 🙂 0.00%
src/python/rv/modules/base/filterpro.py 59.15% 🙂 58.61% 🙂 -0.54% 👎
src/python/rv/modules/base/flanger.py 75.54% ⭐ 75.54% ⭐ 0.00%
src/python/rv/modules/base/fm.py 74.39% 🙂 74.39% 🙂 0.00%
src/python/rv/modules/base/generator.py 75.10% ⭐ 75.10% ⭐ 0.00%
src/python/rv/modules/base/glide.py 89.83% ⭐ 89.83% ⭐ 0.00%
src/python/rv/modules/base/gpio.py 89.53% ⭐ 89.53% ⭐ 0.00%
src/python/rv/modules/base/input.py 90.28% ⭐ 90.28% ⭐ 0.00%
src/python/rv/modules/base/kicker.py 81.94% ⭐ 81.94% ⭐ 0.00%
src/python/rv/modules/base/lfo.py 51.25% 🙂 48.69% 😞 -2.56% 👎
src/python/rv/modules/base/loop.py 82.62% ⭐ 60.39% 🙂 -22.23% 👎
src/python/rv/modules/base/metamodule.py 65.65% 🙂 65.29% 🙂 -0.36% 👎
src/python/rv/modules/base/modulator.py 84.55% ⭐ 84.55% ⭐ 0.00%
src/python/rv/modules/base/multictl.py 55.56% 🙂 55.56% 🙂 0.00%
src/python/rv/modules/base/multisynth.py 51.81% 🙂 51.81% 🙂 0.00%
src/python/rv/modules/base/output.py 99.00% ⭐ 99.00% ⭐ 0.00%
src/python/rv/modules/base/pitch2ctl.py 79.97% ⭐ 79.97% ⭐ 0.00%
src/python/rv/modules/base/pitchdetector.py 66.91% 🙂 66.91% 🙂 0.00%
src/python/rv/modules/base/pitchshifter.py 79.18% ⭐ 79.18% ⭐ 0.00%
src/python/rv/modules/base/reverb.py 80.78% ⭐ 80.78% ⭐ 0.00%
src/python/rv/modules/base/sampler.py 55.51% 🙂 54.81% 🙂 -0.70% 👎
src/python/rv/modules/base/sound2ctl.py 67.83% 🙂 67.83% 🙂 0.00%
src/python/rv/modules/base/spectravoice.py 94.18% ⭐ 94.18% ⭐ 0.00%
src/python/rv/modules/base/velocity2ctl.py 86.13% ⭐ 86.13% ⭐ 0.00%
src/python/rv/modules/base/vibrato.py 67.27% 🙂 67.27% 🙂 0.00%
src/python/rv/modules/base/vocalfilter.py 79.57% ⭐ 68.94% 🙂 -10.63% 👎
src/python/rv/modules/base/vorbisplayer.py 86.72% ⭐ 86.72% ⭐ 0.00%
src/python/rv/modules/base/waveshaper.py 63.08% 🙂 63.08% 🙂 0.00%
src/python/rv/readers/module.py 85.37% ⭐ 85.39% ⭐ 0.02% 👍
src/python/rv/readers/pattern.py 96.14% ⭐ 96.14% ⭐ 0.00%
src/python/rv/readers/sunvox.py 81.48% ⭐ 81.76% ⭐ 0.28% 👍
src/python/rv/tools/patch_decompiler.py 61.92% 🙂 61.85% 🙂 -0.07% 👎
tests/python/reader/test_empty.py 82.20% ⭐ 81.42% ⭐ -0.78% 👎
tests/python/readwrite/project/test_empty_project.py 86.35% ⭐ 85.53% ⭐ -0.82% 👎
tests/python/readwrite/project/test_single_fm.py 55.57% 🙂 55.57% 🙂 0.00%
tests/python/readwrite/synth/test_amplifier.py 90.14% ⭐ 89.23% ⭐ -0.91% 👎
tests/python/readwrite/synth/test_analog_generator.py 64.99% 🙂 64.05% 🙂 -0.94% 👎
tests/python/readwrite/synth/test_compressor.py 89.99% ⭐ 89.99% ⭐ 0.00%
tests/python/readwrite/synth/test_dc_blocker.py 95.69% ⭐ 95.69% ⭐ 0.00%
tests/python/readwrite/synth/test_delay.py 87.91% ⭐ 86.21% ⭐ -1.70% 👎
tests/python/readwrite/synth/test_distortion.py 90.90% ⭐ 90.90% ⭐ 0.00%
tests/python/readwrite/synth/test_drum_synth.py 84.60% ⭐ 84.60% ⭐ 0.00%
tests/python/readwrite/synth/test_echo.py 90.29% ⭐ 87.62% ⭐ -2.67% 👎
tests/python/readwrite/synth/test_filter.py 82.22% ⭐ 82.22% ⭐ 0.00%
tests/python/readwrite/synth/test_filter_pro.py 80.28% ⭐ 80.28% ⭐ 0.00%
tests/python/readwrite/synth/test_flanger.py 86.77% ⭐ 86.77% ⭐ 0.00%
tests/python/readwrite/synth/test_generator.py 86.47% ⭐ 86.47% ⭐ 0.00%
tests/python/readwrite/synth/test_glide.py 91.21% ⭐ 91.21% ⭐ 0.00%
tests/python/readwrite/synth/test_kicker.py 88.35% ⭐ 88.35% ⭐ 0.00%
tests/python/readwrite/synth/test_loop.py 91.21% ⭐ 87.34% ⭐ -3.87% 👎
tests/python/readwrite/synth/test_metamodule.py 72.22% 🙂 73.80% 🙂 1.58% 👍
tests/python/readwrite/synth/test_multictl.py 80.83% ⭐ 80.83% ⭐ 0.00%
tests/python/readwrite/synth/test_multisynth.py 80.66% ⭐ 83.41% ⭐ 2.75% 👍
tests/python/readwrite/synth/test_pitch2ctl.py 89.38% ⭐ 89.38% ⭐ 0.00%
tests/python/readwrite/synth/test_sampler.py 54.73% 🙂 54.69% 🙂 -0.04% 👎
tests/python/readwrite/synth/test_sound2ctl.py 89.23% ⭐ 89.23% ⭐ 0.00%
tests/python/readwrite/synth/test_spectravoice.py 80.13% ⭐ 80.13% ⭐ 0.00%
tests/python/readwrite/synth/test_vocal_filter.py 89.38% ⭐ 81.17% ⭐ -8.21% 👎
tests/python/readwrite/synth/test_vorbis_player.py 90.90% ⭐ 90.90% ⭐ 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/python/rv/tools/patch_decompiler.py module_layout 21 😞 428 ⛔ 23.60% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
src/python/rv/modules/multictl.py MultiCtl.macro 15 🙂 281 ⛔ 20 ⛔ 27.55% 😞 Try splitting into smaller methods. Extract out complex expressions
src/python/rv/project.py Project.chunks 21 😞 445 ⛔ 9 🙂 34.04% 😞 Refactor to reduce nesting. Try splitting into smaller methods
src/python/rv/note.py Note.tabular_repr 15 🙂 206 ⛔ 15 😞 36.03% 😞 Try splitting into smaller methods. Extract out complex expressions
src/python/rv/project.py Project.connect 24 😞 191 😞 10 😞 38.55% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@TheTechRobo
Copy link

What is rv._vendor supposed to contain and how does its Chunk implementation differ from the chunk module? (Or is it just because the chunk module is deprecated?) It appears to be missing.

@matthewryanscott
Copy link
Contributor Author

What is rv._vendor supposed to contain and how does its Chunk implementation differ from the chunk module? (Or is it just because the chunk module is deprecated?) It appears to be missing.

@TheTechRobo The chunk module is being removed in Python 3.13 which is why it was vendorized in this branch. That was an oversight on my part, forgetting to add the file to the commit. If you copy the stdlib's chunk module to src/python/rv/_vendor it should work fine.

Please note: This repo is unmaintained nowadays due to lack of opportunities to work on it consistently, so I won't be fixing this any time soon. I haven't yet archived it on GitHub but I did just update the description to warn future readers.

@matthewryanscott matthewryanscott force-pushed the sunvox-2.0-file-format branch 2 times, most recently from 5a13707 to 1de780b Compare December 7, 2024 05:22
@matthewryanscott matthewryanscott marked this pull request as ready for review February 23, 2025 21:12
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request #71 has too many files changed.

We can only review pull requests with up to 300 changed files, and this pull request has 386.

@matthewryanscott
Copy link
Contributor Author

Merging this, as we want to release version 2.0.0, and we will make more frequent patch releases going forward.

@matthewryanscott matthewryanscott merged commit a99acda into master Feb 23, 2025
4 checks passed
@matthewryanscott matthewryanscott deleted the sunvox-2.0-file-format branch February 23, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants