iOS 0.5.0: hand-built editors (Tape Delay, Tape Engine, Mix Tightener, Granular scope, Wavetable tables, Grain Cloud source)
Effect visualisation through the C++ effect, engine and AU; custom wavetables and grain sources load and persist with the song; the app's slot editor hosts the file picker for bespoke views. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3b035d6a7d
commit
435305e42a
@@ -3,8 +3,35 @@
|
||||
|
||||
#import "SizzleSession+Viz.h"
|
||||
#import "SizzleSession+Internal.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
using namespace sizzle;
|
||||
|
||||
static char kVizEngineKey;
|
||||
|
||||
@implementation SizzleSession (Viz)
|
||||
|
||||
/// The engine, without the song lock: polling under it at display rate would make
|
||||
/// the audio thread (which only try-locks) drop a block now and then. The engine is
|
||||
/// created once with the session and lives as long as it, so its address is fetched
|
||||
/// once under the lock and kept; Engine::effectScope / effectPlayhead are lock-free.
|
||||
- (const engine::Engine *)vizEngine {
|
||||
NSValue *v = objc_getAssociatedObject(self, &kVizEngineKey);
|
||||
if (!v) {
|
||||
__block const engine::Engine *e = nullptr;
|
||||
[self read:^(const model::Project &, const engine::Engine &eng) { e = ŋ }];
|
||||
v = [NSValue valueWithPointer:e];
|
||||
objc_setAssociatedObject(self, &kVizEngineKey, v, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||
}
|
||||
return (const engine::Engine *)v.pointerValue;
|
||||
}
|
||||
|
||||
- (NSInteger)copyEffectScopeOfSlot:(NSInteger)slot into:(float *)out capacity:(NSInteger)capacity {
|
||||
return self.vizEngine->effectScope((int)slot, out, (int)capacity);
|
||||
}
|
||||
|
||||
- (float)effectPlayheadOfSlot:(NSInteger)slot {
|
||||
return self.vizEngine->effectPlayhead((int)slot);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user