{"id":18765722,"url":"https://github.com/cobertos/visualssandbox","last_synced_at":"2025-04-13T05:12:02.505Z","repository":{"id":95200616,"uuid":"189768663","full_name":"Cobertos/VisualsSandbox","owner":"Cobertos","description":"Unity3D tools and experiments with music visuals","archived":false,"fork":false,"pushed_at":"2019-07-11T10:28:51.000Z","size":2174,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T19:53:29.323Z","etag":null,"topics":["unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cobertos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-06-01T19:05:49.000Z","updated_at":"2025-02-24T05:05:42.000Z","dependencies_parsed_at":"2023-04-09T21:02:24.389Z","dependency_job_id":null,"html_url":"https://github.com/Cobertos/VisualsSandbox","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/Cobertos%2FVisualsSandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2FVisualsSandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2FVisualsSandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cobertos%2FVisualsSandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cobertos","download_url":"https://codeload.github.com/Cobertos/VisualsSandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665744,"owners_count":21142123,"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":["unity","unity3d"],"created_at":"2024-11-07T18:35:01.835Z","updated_at":"2025-04-13T05:12:02.487Z","avatar_url":"https://github.com/Cobertos.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://twitter.com/cobertos\" target=\"_blank\"\u003e\u003cimg alt=\"twitter\" src=\"https://img.shields.io/badge/twitter-%40cobertos-0084b4.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://cobertos.com\" target=\"_blank\"\u003e\u003cimg alt=\"twitter\" src=\"https://img.shields.io/badge/website-cobertos.com-888888.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Visuals Sandbox for Unity3D 2019.1+\n\nTools and sandbox environment for making music visuals in Unity3D. Provides nice interfaces and debugging visuals for BPM sources, Time and Frequence space data, etc...\n\nIt requires 2019.1+ to use `VisualElement`s. The code _could_ be backported to 2017.1+ but requires some modification...\n\noriginally based on [my similar experiments/toolkit for THREE.js](https://github.com/Cobertos/MIDI-Experiment)\n\n### Installation\n\n1. Download or clone the repository, `git clone https://github.com/Cobertos/VisualsSandbox`\n2. Open it as a Unity project\n\n### Usage\n\nThere's not much here yet, but below is the list of components that currently exist:\n\n#### `BPMSource`\n\n![Bpm Source gif](./Media/bpmSource.gif)\n\nRepresents a BPM source. The base class requires manually entering the BPMSource, but can be extended to infer BPM from audio intensity data or through a MIDI input from you or your friends DAW. Has a bunch of useful properties\n\n```\n.bpm - The current bpm\n.bpms - The number of beats in a millisecond\n.beat - The current beat of your song, given a proper epoch\n.getLastBeatTime(double frac = 1, double offset = 0) - The last time in milliseconds a beat occured\n.onceEvery(double frac, double offset, OnceEveryFunc func) - Executes a function every beat\n```\n\ncheck out [BPMSource.cs](./Assets/Scripts/VisualsTools/BPMSource.cs) for more info\n\n#### `AudioSourceVisualizer`\n\n![Audio source visualizer, log spectrum](./Media/audioVisualizer.gif)\n\nPlots the spectrum data of an audio source live.\n\n#### `MicrophoneAudioSource`\n\n![Microphone audio source GUI](./Media/MicrophoneAudioSource.png)\n\nWorking with Microphone sound is a massive pain in Unity. This `MonoBehavior` sets up the attached `AudioSource` with Microphone input. Using something like [`Virtual Audio Cable/Voicemeeter`](https://www.vb-audio.com/Cable/index.htm) on Windows, you can pipe music to a Microphone input and do stuff with it in Unity.\n\nTroubleshooting/Notes:\n\n* If the audio is also playing in Unity (it most likely is). Attach your audio source to a mixer (in the Audio Mixer window) and attentuate it down to 0. That's the only way to mute it while still getting the unmodified spectrum data.\n* Latency is very common in Unity with `Microphone.Start()`. To mitigate:\n * Make sure that your DSP Buffer is set to \"Best Latency\" in your project settings\n * Make sure the recording clip size is 1. The larger the size, the more potential for latency\n * The microphone records to an audio clip in a circular buffer, but if you're too far behind where the microphone is writing to in the clip, you'll experience latency as large as the clip size. Use the `AudioSourcePlaybackDebugger` until I figure out an automatic way of doing this\n* If you experience garbage crackling and stuff in your microphone, make sure that your audio source outputs to a mixer. Once you start your game in the editor, edit the pitch of that mixer and set it back to 100.00%, it should go away while the game is still active. The code tries to account for this ([waiting until the microphone position is \u003e 0](https://support.unity3d.com/hc/en-us/articles/206485253-How-do-I-get-Unity-to-playback-a-Microphone-input-in-real-time-)) but it might not work all the time.\n* Using with other audio tools could potentially cause conflicts at least in Windows. [Voicemeeter](https://forum.vb-audio.com/viewtopic.php?t=87#p474) has a good write up here, but Windows audio has potentially multiple interfaces (MME, WASAPI, KS, Direct-X) to access audio devices from and doing so from multiple different ones or if any tool accesses in \"Exclusive\" mode can cause failures. Take care when choosing these settings in your other programs as they could conflict with Unity\n * In the case of Voicemeeter, it defaults to WDM (faster and newer), though you should use MME, otherwise it will cause Unity to hang and/or start leaking memory and requires a Unity restart.\n\n### Contributing\n\nNo specific instructions as of now","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobertos%2Fvisualssandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobertos%2Fvisualssandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobertos%2Fvisualssandbox/lists"}