Python program to render wave files into oscilloscope views, featuring advanced correlation-based triggering algorithm
Go to file
nyanpasu64 6803fa1a11
Remember most recently selected filetype in Render dialog (#493)
* Remember most recently selected filetype in Render dialog

Some users prefer to always render their files as .mkv or another
filetype. This commit changes corrscope's render dialog to remember the
most recently selected filetype, and default to it on next render.

* Don't move render filetype dropdown if user types a different extension

The render dialog has a selected filetype ("filter") dropdown to pick
what format to save to by default. This PR changes the code to remember
the selected filetype between renders.

Previously we changed the selected filetype if the user types an
extension belonging to a different type in the list, even if they didn't
pick an extension in the list. This can be confusing, so I removed the
code responsible (instead only remembering the most recently selected
list item).
2024-12-20 14:41:12 -08:00
.appveyor
.github Add GitHub issue templates (#361) 2020-11-10 20:30:47 -08:00
.idea Change PyCharm inspection profile 2022-03-09 23:43:15 -08:00
corrscope Remember most recently selected filetype in Render dialog (#493) 2024-12-20 14:41:12 -08:00
docs Improve docs on trigger algorithm 2024-03-31 19:53:55 -07:00
tests Add partial tests for renderer color bars 2024-06-06 00:02:49 -07:00
.coveragerc
.gitattributes
.gitignore
.pre-commit-config.yaml 0.8.1 2022-05-24 11:14:27 -07:00
CHANGELOG.md Remember most recently selected filetype in Render dialog (#493) 2024-12-20 14:41:12 -08:00
LICENSE new username uwu 2020-03-20 07:44:07 -07:00
README.md Fix YouTube channel link 2024-07-21 01:56:51 -07:00
appveyor.yml Raise minimum Python version to 3.10 2024-07-13 15:38:27 -07:00
build_pyinstaller.py
corrscope.spec Fix bug where matplotlib would crash on unrecognized fonts 2019-09-11 01:30:23 -07:00
edit-version.sh 0.11.0-pre 2024-09-22 18:52:39 -07:00
poetry.lock Upgrade dependencies to fix compatibility with outside libraries (#490) 2024-11-24 17:13:58 -08:00
pyproject.toml Upgrade dependencies to fix compatibility with outside libraries (#490) 2024-11-24 17:13:58 -08:00
scripts.py Implement parallel renderer, set as default 2023-12-17 23:57:14 -08:00
setup.cfg Disable coverage measurements and codecov.io uploading (#401) 2022-03-09 03:05:00 -08:00

README.md

Corrscope

Appveyor build status Latest release PyPI release

Corrscope renders oscilloscope views of WAV files recorded from chiptune (game music from retro sound chips).

Corrscope uses "waveform correlation" to track complex waves (including SNES and Sega Genesis/FM synthesis) which jump around on other oscilloscope programs.

Sample results can be found on my Youtube channel at https://www.youtube.com/@nyanpasu64/videos.

Documentation is available at https://corrscope.github.io/corrscope/.

Screenshot of Corrscope and video preview

Status

Corrscope is currently in semi-active development. The program basically works and I will fix bugs as they are discovered. Features will be added (and feature requests may be accepted) on a case-by-case basis. For technical support or feedback, contact me at Discord (https://discord.gg/CCJZCjc), or alternatively in the issue tracker (using the "Support/feedback" template). Pull requests may be accepted if they're clean.

Dependencies

  • FFmpeg

Installation

Installing Prebuilt Windows Binaries

On Windows, download Windows binary releases (.7z files) from the Releases page, then double-click corrscope.exe or run corrscope (args) via CLI.

Installing from PyPI via pipx (cross-platform, releases)

pipx creates an isolated environment for each program, and adds their binaries into PATH. I find this most reliable in practice, though it runs into issues after upgrading system Python in-place.

  • Install Python 3.8 or above.
  • Install pipx using either your package manager, pip3 install --user pipx, or pip install --user pipx.
  • Run pipx install "corrscope[qt5]"
    • On Linux, to add support for native Qt themes, instead run pipx install --system-site-packages "corrscope[qt5]"
    • On FreeBSD, install py39-qt5 and py39-ruamel.yaml via pkg or ports tree, then run pipx install --system-site-packages "corrscope[qt5]". To get previews working, install ffmpeg via ports tree with SDL option enabled.
    • On M1 Mac, instead run pipx install "corrscope[qt6]"
  • Open a terminal and run corr (args).

Installing from PyPI via Pip (cross-platform, releases)

pip installs packages into a per-user Python environment. This has the disadvantage that each program you install influences the packages seen by other programs. It might run into issues when upgrading system Python in-place; I haven't tested.

  • Install Python 3.8 or above.
  • If necessary, install pip using your package manager.
  • Run pip3 install --user "corrscope[qt5]"
    • On FreeBSD, install py39-qt5 and py39-ruamel.yaml via pkg or ports tree, then run pip install --user "corrscope[qt5]". To get previews working, install ffmpeg via ports tree with SDL option enabled.
    • On M1 Mac, instead run pip3 install --user "corrscope[qt6]"
  • Open a terminal and run corr (args).

Dev builds (Windows)

Windows dev builds are compiled automatically, and available at https://ci.appveyor.com/project/nyanpasu64/corrscope/history.

Installing dev builds on non-Windows platforms without cloning the repo (eg. Git URLs or .whl files) is not supported yet. Fixes are welcome.

Running from Source Code (cross-platform, dev master)

Install Python 3.8 or above, and Poetry. My preference is to run pipx install poetry. You can alternatively use the Poetry installer via curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python, but in the past, updating via poetry self update has broken and left me with no Poetry at all, requiring reinstalling.

cd path/to/corrscope
poetry install -E qt5  # --develop is implied
# On M1 Mac, instead run `poetry install -E qt6`.
poetry run corr (args)

GUI Tutorial

  1. Open GUI:
    • corrscope.exe to create new project
    • corrscope.exe file.yaml to open existing project
  2. Add audio to play back
    • On the right side of the window, click "Browse" to pick a master audio file.
  3. Add oscilloscope channels
    • On the right side of the window, click "Add" to add WAV files to be viewed.
  4. Edit settings
    • Global settings on the left side of the window
    • Per-channel on the right side
  5. Play or render to MP4/etc. video (requires ffmpeg)
    • Via toolbar or menu

More help is available at the help site.

Command-line Tutorial

  1. Create YAML:

    • corrscope split*.wav --audio master.wav -w
    • Specify all channels on the command line.
    • -a or --audio specifies master audio track.
    • Creates file master.yaml.
  2. Edit master.yaml to change settings.

  3. Play (requires ffmpeg):

    • corrscope master.yaml -p/--play
  4. Render and encode video (requires ffmpeg)

    • corrscope master.yaml -r/--render file.mp4 (other file extensions supported)

Mac-specific Issues

Preview audio cutting out

When you preview a video in Corrscope, it sends video frames to ffplay, which opens a video player window and also plays synchronized audio. On Mac (at least my M1 MacBook Air running macOS 12.3), switching windows can cause ffplay to stutter and temporarily or semi-permanently stop playing audio (until you restart the preview). There is no fix for this issue at the moment.

Rendering does not stutter on M1, since neither corrscope nor ffmpeg are affected by app switching, or App Nap.

Gatekeeper

On Mac, if you render a video file, in some cases (eg. IINA video player) you may not be able to open the resulting files. Gatekeeper will print an error saying '"filename.mp4" cannot be opened because it is from an unidentified developer.'. If you see this message, try opening the file again. Once you silence the error once, it should not reappear.

Contributing

Issues, feature requests, and pull requests are accepted.

This project uses Black code formatting. Either pull request authors can reformat code before creating a PR, or maintainers can reformat code before merging.

You can install a Git pre-commit hook to apply Black formatting before each commit. Open a terminal/cmd in this repository and run:

pip install --user pre-commit
pre-commit install