{"id":36259961,"url":"https://github.com/anokta/barelymusician","last_synced_at":"2026-06-11T02:03:06.201Z","repository":{"id":6856660,"uuid":"117650333","full_name":"anokta/barelymusician","owner":"anokta","description":"a real-time music engine.","archived":false,"fork":false,"pushed_at":"2026-04-01T23:59:15.000Z","size":11695,"stargazers_count":39,"open_issues_count":4,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-04-02T09:41:43.204Z","etag":null,"topics":["daisy","game-audio","game-development","gamedev","gdextension","generative-music","godot","interactive-music","livecoding","unity","webaudio"],"latest_commit_sha":null,"homepage":"http://www.barelymusician.com","language":"C++","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/anokta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"anokta"}},"created_at":"2018-01-16T07:40:31.000Z","updated_at":"2026-04-02T00:17:14.000Z","dependencies_parsed_at":"2025-12-26T04:05:44.825Z","dependency_job_id":null,"html_url":"https://github.com/anokta/barelymusician","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/anokta/barelymusician","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anokta%2Fbarelymusician","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anokta%2Fbarelymusician/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anokta%2Fbarelymusician/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anokta%2Fbarelymusician/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anokta","download_url":"https://codeload.github.com/anokta/barelymusician/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anokta%2Fbarelymusician/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31389583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["daisy","game-audio","game-development","gamedev","gdextension","generative-music","godot","interactive-music","livecoding","unity","webaudio"],"created_at":"2026-01-11T07:47:49.980Z","updated_at":"2026-06-11T02:03:06.195Z","avatar_url":"https://github.com/anokta.png","language":"C++","funding_links":["https://github.com/sponsors/anokta"],"categories":[],"sub_categories":[],"readme":"barelymusician\n[![ci](https://github.com/anokta/barelymusician/actions/workflows/ci.yml/badge.svg)](https://github.com/anokta/barelymusician/actions/workflows/ci.yml)\n[![sponsor](https://img.shields.io/static/v1?label=sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026color=%23fe8e86)](https://github.com/sponsors/anokta)\n==============\n\nbarelymusician is a real-time music engine for interactive systems.\n\nIt provides a modern C/C++ API to generate and perform musical sounds from scratch with sample\naccurate timing.\n\nThis repository includes build targets for Windows, macOS, Linux, Android, WebAssembly, and Daisy,\nas well as a Godot GDExtension, a native Unity plugin, and a VST instrument plugin.\n\nTo use in a project, simply include [barelymusician.h](include/barelymusician.h).\n\nTo use in Godot, download the latest version of\n[barelymusiciangodot.zip](https://github.com/anokta/barelymusician/releases/latest/download/barelymusiciangodot.zip).\n\nTo use in Unity, download the latest version of\n[barelymusician.unitypackage](https://github.com/anokta/barelymusician/releases/latest/download/barelymusician.unitypackage).\n\nJust curious? Try the experimental web toy at [barelymusician.com](http://www.barelymusician.com).\n\nFor background about this project, see the original research paper\n[here](http://www.aes.org/e-lib/browse.cfm?elib=17598), and the legacy Unity implementation\n[here](https://github.com/anokta/barelyMusicianLegacy).\n\nExample usage\n-------------\n\n```cpp\n#include \u003cbarelymusician.h\u003e\n\n// Create the engine.\nbarely::Engine engine(/*sample_rate=*/48000);\n\n// Set the global tempo.\nengine.SetTempo(/*tempo=*/124.0);\n\n// Create a new instrument.\nauto instrument = engine.CreateInstrument();\n\n// Set the instrument to use full oscillator mix.\ninstrument.SetControl(barely::InstrumentControlType::kOscMix, /*value=*/1.0f);\n\n// Set an instrument note on.\n//\n// Notes are expressed in octaves relative to middle C as the center frequency. Fractional note\n// values adjust the frequency logarithmically to ensure equally perceived pitch intervals within\n// each octave.\nconstexpr float kC4Pitch = 0.0f;\ninstrument.SetNoteOn(kC4Pitch);\n\n// Create a new performer.\nauto performer = engine.CreatePerformer();\n\n// Set the performer to looping.\nperformer.SetLooping(/*is_looping=*/true);\n\n// Create a new task that plays an instrument note every beat.\nauto task = performer.CreateTask(/*position=*/0.0, /*duration=*/1.0, /*priority=*/0,\n                                 [\u0026](barely::TaskEventType type) {\n                                   constexpr float kC3Pitch = -1.0f;\n                                   if (type == barely::TaskEventType::kBegin) {\n                                     instrument.SetNoteOn(kC3Pitch);\n                                   } else if (type == barely::TaskEventType::kEnd) {\n                                     instrument.SetNoteOff(kC3Pitch);\n                                   }\n                                 });\n\n// Start the performer playback.\nperformer.Start();\n\n// Update the engine timestamp.\n//\n// Timestamp updates must occur before processing the engine with the respective timestamps.\n// Otherwise, `Process` calls may be *late* in receiving relevant changes to the engine. To address\n// this, `Update` should typically be called from the main thread update callback using a lookahead\n// to prevent potential thread synchronization issues in real-time audio applications.\nconstexpr double kLookahead = 0.1;\ndouble timestamp = 0.0;\nengine.Update(timestamp + kLookahead);\n\n// Process the next output samples of the engine.\n//\n// The engine processes output samples synchronously. Therefore, `Process` should typically be\n// called from an audio thread process callback in real-time audio applications.\nconstexpr int kChannelCount = 2;\nconstexpr int kFrameCount = 512;\nfloat output_samples[kChannelCount * kFrameCount];\nengine.Process(output_samples, kChannelCount, kFrameCount, timestamp);\n```\n\nFurther examples can be found in [examples/demo](examples/demo), e.g. to run the\n[instrument_demo.cpp](examples/demo/instrument_demo.cpp):\n\n```sh\npython build.py --run_demo instrument_demo\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanokta%2Fbarelymusician","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanokta%2Fbarelymusician","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanokta%2Fbarelymusician/lists"}