This repository was archived by the owner on Jun 19, 2025. It is now read-only.
control osc partial count with n #674
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
for any of the simple waveforms, sawtooth, triangle, square (sine), this allows controlling the number of partials with the
ncontrol:This allows creating less harsh waveforms with additive synthesis directly, without needing a filter, which is more to write.
This is actually a breaking change, because
ncould prior be used to control the oscillator pitch, as a synonym fornote.I think this synonym, which only works with oscillators is more confusing than helpful, as it sometimes works ( waveforms ) and sometimes not ( samples: picks another sample ). The behavior of
nto choose partial count for oscillators complements the behavior ofnto pick a sample variant, as it is also timbre related..@yaxu what do you think? I think tidal also has this separation of
nfor samples and synths?If you don't think this is a good idea, I could also add a
partialscontrol instead...edit: the problem with an extra control for this is that you cannot use it with ":" notation, so you'd have to write
s("sawtooth").partials(8)instead ofs("sawtooth:8")because the second item insis always bound ton.Right now, that second item is not really usefull for waveforms
also, it might make sense to limit the number of partials to 64 or something
fixes #191
related: #395