{"id":15142075,"url":"https://github.com/cedargrovestudios/circuitpython_waveviz","last_synced_at":"2026-01-20T21:02:29.983Z","repository":{"id":216387165,"uuid":"740771995","full_name":"CedarGroveStudios/CircuitPython_WaveViz","owner":"CedarGroveStudios","description":"A CircuitPython class to create a positionable displayio.TileGrid object from a synthio.waveform wave table or synthio.Envelope object.","archived":false,"fork":false,"pushed_at":"2024-02-17T19:52:43.000Z","size":4281,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T15:17:34.067Z","etag":null,"topics":["circuitpython","circuitpython-community-bundle","synthesizer","wavetable","wavetable-visualizer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CedarGroveStudios.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-09T03:06:21.000Z","updated_at":"2024-12-12T23:31:38.000Z","dependencies_parsed_at":"2024-02-17T07:30:03.317Z","dependency_job_id":"8280e059-fbfe-474a-9d6c-d033c6693fd0","html_url":"https://github.com/CedarGroveStudios/CircuitPython_WaveViz","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"12a3264a70cd54b649a12fbd1064aeb8adc919d5"},"previous_names":["cedargrovestudios/circuitpython_waveviz"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_WaveViz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_WaveViz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_WaveViz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CedarGroveStudios%2FCircuitPython_WaveViz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CedarGroveStudios","download_url":"https://codeload.github.com/CedarGroveStudios/CircuitPython_WaveViz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500464,"owners_count":20948881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","circuitpython-community-bundle","synthesizer","wavetable","wavetable-visualizer"],"created_at":"2024-09-26T09:22:24.545Z","updated_at":"2026-01-20T21:02:29.963Z","avatar_url":"https://github.com/CedarGroveStudios.png","language":"Python","readme":"Introduction\n============\n\n.. image:: https://github.com/CedarGroveStudios/CircuitPython_WaveViz/blob/main/media/harmonica_wave_TFT.jpeg\n    :width: 400\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n\n.. image:: https://github.com/CedarGroveStudios/Cedargrove_CircuitPython_WaveViz/workflows/Build%20CI/badge.svg\n    :target: https://github.com/CedarGroveStudios/Cedargrove_CircuitPython_WaveViz/actions\n    :alt: Build Status\n\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code Style: Black\n\nA CircuitPython class to create a positionable ``displayio.TileGrid`` object\nfrom a ``synthio.waveform`` wave table or ``synthio.Envelope`` object.\nThe class inherits the properties of a ``TileGrid`` object including ``bitmap``,\n``pixel_shader``, ``width``, ``height``, ``x``, ``y``.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://circuitpython.org/libraries\u003e`_\nor individual libraries can be installed using\n`circup \u003chttps://github.com/adafruit/circup\u003e`_.\n\n\nInstalling to a Connected CircuitPython Device with Circup\n==========================================================\n\nMake sure that you have ``circup`` installed in your Python environment.\nInstall it with the following command if necessary:\n\n.. code-block:: shell\n\n    pip3 install circup\n\nWith ``circup`` installed and your CircuitPython device connected use the\nfollowing command to install:\n\n.. code-block:: shell\n\n    circup install cedargrove_waveviz\n\nOr the following command to update an existing version:\n\n.. code-block:: shell\n\n    circup update\n\nUsage Example\n=============\n\n.. image:: https://github.com/CedarGroveStudios/CircuitPython_WaveViz/blob/main/media/waveviz_simpletest.jpeg\n    :width: 400\n\n.. code-block:: python\n\n\n    import board\n    import displayio\n    import synthio\n    import adafruit_ili9341\n    from cedargrove_wavebuilder import WaveBuilder, WaveShape\n    from cedargrove_waveviz import WaveViz\n\n    # Define wave table parameters\n    WAVE_TABLE_LENGTH = 512  # The wave table length in samples\n    SAMPLE_MAXIMUM = 32700  # The maximum value of a sample\n\n    # Instantiate a built-in display\n    # display = board.DISPLAY\n\n    # Instantiate the FeatherS2 with 2.4-inch TFT FeatherWing display\n    displayio.release_displays()  # Release display resources\n    display_bus = displayio.FourWire(\n        board.SPI(), command=board.D6, chip_select=board.D5, reset=None\n    )\n    display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)\n    display.rotation = 0\n\n    splash = displayio.Group()\n    display.root_group = splash\n\n    # Define the Harmonica wave shape, overtone ratio, and amplitude\n    tone = [\n        (WaveShape.Sine, 1.00, 0.10),\n        (WaveShape.Sine, 2.00, 0.48),\n        (WaveShape.Sine, 3.00, 0.28),\n        (WaveShape.Sine, 4.00, 0.02),\n        (WaveShape.Sine, 5.00, 0.12),\n    ]\n\n    # Create the wave table (wave.wave_table)\n    wave = WaveBuilder(\n        oscillators=tone,\n        table_length=WAVE_TABLE_LENGTH,\n        sample_max=SAMPLE_MAXIMUM,\n        lambda_factor=1.0,\n        loop_smoothing=True,\n        debug=False,\n    )\n\n    # Create a synthio.Envelope object\n    env = synthio.Envelope(\n        attack_time=0.05,\n        attack_level=1.0,\n        decay_time=0.1,\n        release_time=0.1,\n        sustain_level=0.5,\n    )\n\n\n    # Display a small version on the bottom layer\n    splash.append(\n        WaveViz(wave.wave_table, x=20, y=80, width=25, height=25, back_color=0x0000A0)\n    )\n\n    # Display a full-sized version on the middle layer\n    splash.append(\n        WaveViz(wave.wave_table, x=0, y=0, width=300, height=240, back_color=None)\n    )\n\n    # Display the envelope object on the top layer\n    splash.append(\n        WaveViz(\n            env,\n            x=150,\n            y=170,\n            width=80,\n            height=40,\n            plot_color=0xFFFFFF,\n            back_color=0x800080,\n        )\n    )\n\n    while True:\n        pass\n\n\n\n\nDocumentation\n=============\nAPI documentation for this library can be found in `Cedargrove_WaveViz \u003chttps://github.com/CedarGroveStudios/CircuitPython_WaveViz/blob/main/media/pseudo_rtd_cedargrove_waveviz.pdf\u003e`_.\n\n.. image:: https://github.com/CedarGroveStudios/CircuitPython_WaveViz/blob/main/media/waveviz_api_page1a.png\n\nFor additional detail about ``WaveViz``, see `WaveViz: Plot a synthio Wave Table or Envelope \u003chttps://adafruit-playground.com/u/CGrover/pages/waveviz-plot-a-synthio-wave-table-or-envelope/edit\u003e`_\n\nPlanned Updates\n===============\n* Use a .wav file as input.\n* Design a scrolling window for visualizing long waveform arrays and files.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_waveviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_waveviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedargrovestudios%2Fcircuitpython_waveviz/lists"}