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
n
control: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
n
could 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
n
to choose partial count for oscillators complements the behavior ofn
to pick a sample variant, as it is also timbre related..@yaxu what do you think? I think tidal also has this separation of
n
for samples and synths?If you don't think this is a good idea, I could also add a
partials
control 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 ins
is 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