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

Update for accurate initialization and state management. #2

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

mtmccrea
Copy link
Contributor

Great tutorial!

These proposed changes provide fixes and comments regarding handling the state variables, as well as fix the initialization of the UGen.

Some of the more important changes include:

  • making sure the initialization sample is equal to the first sample
  • resetting the state of the UGen in the constructor to make sure the ramp starts at 0.
  • updating a local variable phase in the calculation functions, rather than member variable m_phase
  • initializing the frequency with the user-specified value (it was just 0 before, causing a ramp-up of the frequency from 0 to in0(Frequency) over the first block)
  • the .schelp file was updated to more fully utilize helpdoc syntax, fill out header metadata, and provide more examples that double as examples of snippets useful for testing UGens generally (e.g. checking behavior of different input rates)

The tutorial itself has been updated to reflect these changes, and some elaboration was provided on certain topics, namely documentation, to encourage best practices.

Note: I didn't update the .pdf or .epub files, in case some changes are rejected or further changes are made in response.

+ use a local variable in ramp generator function, not the member variable.
+ set read/write m_phase at head/tail of the block calc.
+ explicitly set current output value, then increment phase.
+ add comments.
and constrain to when UGen runs at *kr
+ includes header tags, example of teletype, complete sentences.
+ examples show a range of code useful for testing a broad scope of usage.
@madskjeldgaard
Copy link
Contributor

Fantastic stuff. Thanks so much!

@madskjeldgaard madskjeldgaard merged commit 6c316fe into notam02:main Jul 28, 2023
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.

2 participants