SkillAgentSearch skills...

ADSR

Customizable ADSR Controller

Install / Use

/learn @paoloboschini/ADSR
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

ADSR

Customizable ADSR Controller

alt tag

Features

  • Customizable appearance
  • Customizable value range

Basic Usage

See example project for a demo.

// create an ADSR, set custom value range independent from ADSR frame width
ADSR *adsr = [[ADSR alloc] initWithFrame:NSMakeRect(10, 10, 400, 100)
                         withAttackRange:50
                          withDecayRange:60
                        withSustainRange:70
                        withReleaseRange:80
                               withColor:[NSColor greenColor]
                     withBackgroundColor:[NSColor blackColor]];

// Set the ADSR's delegate (must conform to ADSRProtocol and implement four update methods...)
adsr.delegate = self;
    
// Add ADSR to window
[self.window.contentView addSubview:adsr];

...

// called upon attack update
- (void)attackUpdatedWithValue:(int)value
{
    NSLog(@"Attack: %d", value);
}

// called upon decay update
- (void)decayUpdatedWithValue:(int)value
{
    NSLog(@"Decay: %d", value);
}

// called upon sustain update
- (void)sustainUpdatedWithValue:(int)value
{
    NSLog(@"Sustain: %d", value);
}

// called upon release update
- (void)releaseUpdatedWithValue:(int)value
{
    NSLog(@"Release: %d", value);
}

Related Skills

View on GitHub
GitHub Stars27
CategoryDevelopment
Updated2y ago
Forks5

Languages

Objective-C

Security Score

75/100

Audited on Jan 11, 2024

No findings