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

bugfix: sound select indexes out of bounds #871

Merged
merged 3 commits into from Dec 31, 2023

Conversation

daslyfe
Copy link
Collaborator

@daslyfe daslyfe commented Dec 23, 2023

Round n to the nearest integer for selecting sounds, negative numbers will now select from the end of the sound array.
Examples:

sound("gm_electric_guitar_muted!4").n(saw.range(-2, 12).slow(2))

sound("bd!8").n(saw.range(0, 8).slow(1))

import { getAudioContext, registerSound, getEnvelope } from '@strudel.cycles/webaudio';
import gm from './gm.mjs';
import { getSoundIndex } from '../superdough/util.mjs';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc relative imports from another package might break stuff. to be safe, this should either be importing from @strudel.cycles/superdough (and make sure it's exported)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't get that import to work, so I just added the function to the utils in core

@felixroos felixroos merged commit 3760f51 into tidalcycles:main Dec 31, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants