{"id":15736117,"url":"https://github.com/tristancacqueray/demo-code","last_synced_at":"2025-10-29T04:11:47.373Z","repository":{"id":138665248,"uuid":"59922478","full_name":"TristanCacqueray/demo-code","owner":"TristanCacqueray","description":"Small computer code to render maths equations","archived":false,"fork":false,"pushed_at":"2020-05-19T12:12:20.000Z","size":1915,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T04:07:40.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TristanCacqueray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2016-05-29T02:10:44.000Z","updated_at":"2020-05-19T12:12:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccf46354-a4f2-45c6-8314-8a297b569690","html_url":"https://github.com/TristanCacqueray/demo-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TristanCacqueray%2Fdemo-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TristanCacqueray%2Fdemo-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TristanCacqueray%2Fdemo-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TristanCacqueray%2Fdemo-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TristanCacqueray","download_url":"https://codeload.github.com/TristanCacqueray/demo-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413241,"owners_count":20773054,"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":[],"created_at":"2024-10-04T01:21:08.182Z","updated_at":"2025-10-29T04:11:42.329Z","avatar_url":"https://github.com/TristanCacqueray.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository is a collection of code to create visualisation.\n\nCheck [demo-render](https://github.com/TristanCacqueray/demo-render) for the result.\n\n# Setup\n\nTo run the code, you need to:\n\n```bash\n$ python3 -mvenv ~/demo-code-venv\n$ . ~/demo-code-venv/bin/activate\n(venv) $ pip3 install hy2glsl pyyaml scipy soundfile sounddevice image pyopengl pyopencl Cython scipy pygame numpy hy\n# Glumpy needs to be install separately\n(venv) $ pip3 install glumpy\n# Ensure glfw-dev package is installed\n(venv) $ pkg-config --libs glfw3\n[Print -lglfw]\n# Ensure tkinter binding is working\n(venv) $ python3 -m \"tkinter\"\n[Show a tk window]\n```\n\nCheck audio input from alsa:\n\n```bash\n$ ./explorer_audio_mod.py --help\n$ ./explorer_audio_mod.py --list-sound-devices\n   0 HDA Intel PCH: ALC285 Analog (hw:0,0), ALSA (2 in, 2 out)\n   1 Sennheiser USB headset: Audio (hw:1,0), ALSA (1 in, 2 out)\n   ...\n$ ./explorer_audio_mode.py --sound-device 1\n[show spectrometer from audio mic]\n```\n\nCheck audio output to alsa:\n\n```bash\n$ ./explorer_audio_mod.py --sound-device 1 --wav WAV_FILE_44100.wav\n[play wav file and show spectrometer]\n```\n\nCheck video encoding:\n\n```bash\n$ ./explorer_shader.py --max-frame 25 --record /tmp/demo-code-output/\n[show window for a second and output files in /tmp]\n$ mplayer /tmp/demo-code-output/render.mp4\n[show recorded clip]\n```\n\nYou have a working setup!\n\n# Usage\n\nRun the examples using this environment variable:\n\n```bash\n$ export PYTHONPATH=$(pwd)\n```\n\n## Simple\n\nUse the `./examples/julia.hy` to try animation and exploration works.\nStart the script using `./examples/julia.hy --pause --sound-device NR` using the sound device index of your audio hardware\n\nThis will display 3 windows:\n\n* A big one with a dendrite like shape\n* A smaller one with a mandelbrot map\n* A controller with 2 sliders: `color_power` and `max_iter`\n\nInstructions:\n\n* Press `space` on the bigger window to un-pause the animation.\n* The graphic window support `mouse-click` to re-center and `mouse-wheel` to zoom/dezoom.\n* The map window support `middle-click` to update the seed of the rendering.\n* The controller's sliders can adjust the rendering.\n\n\u003e Try to zoom to a blurry area and increase the `max_iter` to make the rendering sharp.\n\nIf you unpause, sending low-frequency in the microphone should make the dentrite move.\nEnsure input is working by using the `explorer_audio_mod.py` script first.\n\n\n## Orbit\n\nThe `./examples/orbit.hy` shows another formula.\n\n\n## 3d\n\nThe `./examples/underwater-fractal-creature.py --pause` demonstrates a 3d formula.\n\nUse a `--wav file` for better result. Otherwise, press `space`, use the mouse and try one of the slider!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristancacqueray%2Fdemo-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftristancacqueray%2Fdemo-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristancacqueray%2Fdemo-code/lists"}