-
Notifications
You must be signed in to change notification settings - Fork 190
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
Specializations of Mozzi classes for U/SFix #236
Merged
Merged
Changes from 10 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
285795e
Added specializations to Line for U/SFix
tomcombriat 59b1778
Added U/SFix specialization to Smooth.h
tomcombriat ebca5ab
Added an example of FM synthesis with FixMath
tomcombriat 9e1c4ad
Removed volatile in Line.h
tomcombriat 8d69afc
Made a more specific template in Oscil for FixMath
tomcombriat 5f2f36e
Added Difference_Tone adapted to FixMath
tomcombriat b088666
Adapted Detuned_Beats_Wash example
tomcombriat cfe7973
Merge branch 'devel/Mozzi2' into devel/mozziClass_FixMath
tomcombriat 05ef0f1
Added outputs from SFix for MonoOutput and StereoOutput
tomcombriat dbed60a
Added automatic scaling to DBW example
tomcombriat 672ce21
More specific templates for Oscil and mozzi_midi
tomcombriat 4b483dd
SFix actual number of bits is one extra compared to said size (which
tomcombriat a52b44e
Adapted AMSynth example to FixMath
tomcombriat 1730643
Adapted Waveshapper_Difference_Tone with FixMath
tomcombriat 5a121db
Waveshapper_difference_tone to Mozzi2.0 standard
tomcombriat 75ad03d
Corrected Line with FixMath
tomcombriat be74b3b
Changed Line_vs_Smooth example to FixMath
tomcombriat 7b2b1d3
Modified Waveshaper example to FixMath
tomcombriat 8b760a6
Put FM_synth_FixMath to Mozzi2.0
tomcombriat 57f94f4
Modified FMSynth_32k to FixMath
tomcombriat be0a9b0
Attempt to fix the actions
tomcombriat f7a40f2
Adapted AMsynth_HIFI to FixMath
tomcombriat 74ef271
Updated Shepard tones to FixMath
tomcombriat 273f2c0
Corrected Line_vs_Smooth example
tomcombriat e8376db
Changed Detuned beats examples to Mozzi2
tomcombriat 574fb90
Optimization of mtof for non fractionnal FixMath midi values.
tomcombriat 4f00936
Merge branch 'devel/Mozzi2' into devel/mozziClass_FixMath
tomcombriat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a somewhat general note, I wonder, whether we can still avoid a hard dependency on the - now external - FixMath. Sure, installing it via the library manager should be a breeze, but at least when installing from git, that may be a small bonus.
The trick would be to never have a full specialization. Due to the RANGE parameter, I think that requirement is actually easy to meet. Pseudocode:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And to clarify, FixMath.h would then have to be included, manually, in sketches that actually use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I did not think of it. My only concern would be that the dependency is less clear (ie, the error message would be something like:
SFix is declared but never defined
and notFile FixMath.h not found
). But at the same time, the error message for the examples would be clear. Will try to see how that goes!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be overlooking something, but I am not sure this is always simple. Let's take this line from Oscil.h:
with the forward declaration
setFreq(UFix<NI,NF,RANGE> frequency)
is correctly resolved by the compiler butUFix<16,16>(frequency)
is not as it does not have the correct number of arguments. Adding another argument, say_RANGE
, is not straightforward because we would need to add in Mozzi the macros to compute the default range here (hence negating a bit the advantage of having it with a default value in FixMath.Did I overlooked something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the fact that I tend to comment before testing... It may or may not be possible to weasle our way out of this particular problem using something like
But I'm not sure, where the next problem of this type pops up, and I'll admit, I'm not totally convinced, myself.