You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the AudioBuffer Resource class — a multi-channel sample-data Resource for Synth-side recording and playback — as the first concrete consumer of the generic resource system landed in #147. Adds a public C header, a C++ convenience wrapper, a built-in Plugin, and an OSC-driven example.
Public C++ wrapper — include/methcla/plugins/audio_buffer.hpp
A thin wrapper class with static constexpr const char* uri() and using c_type = ::AudioBuffer;, so Methcla::Plugin::ResourceRef<Methcla::Plugin::AudioBuffer> works with the wrappers added in #147. Exposes numChannels(), numFrames(), sampleRate(), channel(i), data(), and zero().
Built-in Plugin — plugins/audio_buffer.cpp
Mutability: kMethcla_Mutable.
Implementation class derives from ::AudioBuffer so a void* instance from construct casts cleanly on the consumer side.
Summary
Implement the
AudioBufferResource class — a multi-channel sample-data Resource for Synth-side recording and playback — as the first concrete consumer of the generic resource system landed in #147. Adds a public C header, a C++ convenience wrapper, a built-in Plugin, and an OSC-driven example.Depends on
perform_with_resources,ResourceRef<T>/ResourceDef<R,O>C++ wrappers). All shipped in Add generic RT/NRT shared resource system (#147) #152.Scope
Public C header —
include/methcla/plugins/audio_buffer.hPublic C++ wrapper —
include/methcla/plugins/audio_buffer.hppA thin wrapper class with
static constexpr const char* uri()andusing c_type = ::AudioBuffer;, soMethcla::Plugin::ResourceRef<Methcla::Plugin::AudioBuffer>works with the wrappers added in #147. ExposesnumChannels(),numFrames(),sampleRate(),channel(i),data(), andzero().Built-in Plugin —
plugins/audio_buffer.cppkMethcla_Mutable.::AudioBufferso avoid*instance fromconstructcasts cleanly on the consumer side.i:num_channels i:num_frames i:sample_rate.AudioBufferstruct + channel-pointer array + SIMD-aligned sample storage viamethcla_host_alloc_aligned. Destructor frees them.Methcla::Plugin::ResourceDef<AudioBufferImpl, AudioBufferOptions>()(host, METHCLA_AUDIO_BUFFER_URI, kMethcla_Mutable).Build wiring
plugins/audio_buffer.cppinclude/methcla/plugins/audio_buffer.hinclude/methcla/plugins/audio_buffer.hpptests/audio_buffer_tests.cppperform_with_resourcesround-tripCMakeLists.txtaudio_buffer.cppto plugin targetsCHANGELOG.md[Unreleased]docs/usage.mdAudioBufferTests
/resource/new METHCLA_AUDIO_BUFFER_URI i:numChannels i:numFrames i:sampleRate, wait for/resource/ready.perform_with_resourcescallback./resource/destroyed./resource/errorwithkMethcla_ArgumentError.Out of scope
kMethcla_ResourcePortintegration — tracked in Synth resource port integration (kMethcla_ResourcePort) #151. Once that lands, the existingdisksampler/samplerPlugins can growAudioBufferinput ports.MultiChannelBufferis engine-internal and unchanged by this issue;AudioBufferis the Plugin-facing ABI contract.Origin
Originally Layer 4 of #147; split into a separate issue so #147 / #152 ship the generic infrastructure alone.