Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selectors mixing id & type don't work #28

Open
billorcutt opened this issue Mar 28, 2016 · 4 comments
Open

selectors mixing id & type don't work #28

billorcutt opened this issue Mar 28, 2016 · 4 comments
Assignees
Labels

Comments

@billorcutt
Copy link
Owner

//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 billorcutt self-assigned this Mar 28, 2016
@billorcutt billorcutt added the bug label Mar 28, 2016
@billorcutt
Copy link
Owner Author

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
Copy link
Owner Author

Will close this when I've done the mappings

@smuuf
Copy link

smuuf commented Apr 24, 2016

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.

@billorcutt
Copy link
Owner Author

billorcutt commented Apr 25, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants