i_dropped_my_phone_the_screen_cracked icon indicating copy to clipboard operation
i_dropped_my_phone_the_screen_cracked copied to clipboard

selectors mixing id & type don't work

Open billorcutt opened this issue 8 years ago • 4 comments

//create a mono synth and connect to output __().monosynth({id:"m1"}).dac()

//change frequency of the lowpass in the mono synth __("monosynth lowpass").frequency(300) //works

//try to change frequency of the lowpass in the mono synth __("#m1 lowpass").frequency(300) //fails

billorcutt avatar Mar 28 '16 16:03 billorcutt

Don't think I'll fix this. Makes more sense to use appropriate mappings in the monosynth

//create a mono synth and connect to output __().monosynth({id:"m1"}).dac()

//change frequency of the lowpass in the mono synth __("#m1").attr({"lowpass_frequency":300});

billorcutt avatar Mar 28 '16 17:03 billorcutt

Will close this when I've done the mappings

billorcutt avatar Mar 28 '16 17:03 billorcutt

I would say the original proposition makes more sense, as it is something many people are familiar with from using CSS selectors and are already used to do such selecting.

Frankly, when I tried to do things the same way as the __("#m1 lowpass").frequency(300)-style way, I was quite sad that it wouldn't work.

smuuf avatar Apr 24 '16 15:04 smuuf

I agree with you, it should work. For the time being, you can use type selectors __("monosynth lowpass").frequency(300) or if that's not possible (because of multiple instances of the same type) you can wrap the code blocks you want to target in macros and then use type selectors on those. If you look at the random_interval demo, you can see an example

billorcutt avatar Apr 25 '16 01:04 billorcutt