This question may be very specific, but I’m new to all this and really need some help.
I’m building an iPhone synth app.
I am using DCSliders an DCKnobs (they look nicer than the standard UISliders).
https://github.com/domesticcatsoftware/DCControls#readme
I am also working with libpd (a Pure Data library) so the audio DSP is handled by an embedded Pure Data patch.
I have got multiple DCSliders and DCKnobs in my interface. I am able to send control values from the sliders/knobs to Pure Data by making a class the delegate of the DCSlider…
- (void)loadView {
[super loadView];
self.mySlider = [[[DCSlider alloc] initWithDelegate:self] autorelease];
self.mySlider.frame = CGRectMake(10.0, 10.0, 20.0, 120.0);
[self.view addSubview:self.mySlider];
}
Then I implement a method to send control values to a receiver in Pure Data…
- (void)controlValueDidChange:(float)value sender:(id)sender {
[PdBase sendFloat:value toReceiver:@"beatvol"];
}
This all works ok.
The problem is that all of the sliders are sending the same control values.
How do I get each of the DCSliders to send independent control values to different receivers in Pure Data?
You need to assign a tag to your sliders. Then in
controlValueDidChange:you need to get that tag and do your actions according to the tags: