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

v0.5.2 (BitHammer, Function): huge voltages issues. #14

Open
DomiKamu opened this issue Jan 30, 2018 · 5 comments
Open

v0.5.2 (BitHammer, Function): huge voltages issues. #14

DomiKamu opened this issue Jan 30, 2018 · 5 comments

Comments

@DomiKamu
Copy link

DomiKamu commented Jan 30, 2018

Platform: Windows 7 Pro SP1 x64 (French localized).
VCV Rack v0.5.1 (not dev).
NauModular v0.5.2.

Hello, firstly, thank you very much about your NauModular modules. ;)

However, I report huge voltages issues, concerning BitHammer and Function modules.

I've recorder & posted a (non-indexed) video on YouTube (2 min), showing the voltage issues on these modules. Also, I precise the oscillators I've used, TinySine and TinySawish (both by AS) deliver voltages into range -/+5 V.

Of course it's possible I'm wrong somewhere about voltage measurements, by using Fundamental's Scope.

Perhaps you'll must add a "voltage limitation" in code (for future release) to stay in range -/+12 V (in my opinion).

Link to YT video: here
(please advise me when you have seen it, btw I'll remove it, thanks in advance).

Regards.
Dominique Camus.

@naus3a
Copy link
Owner

naus3a commented Jan 30, 2018

Yes, I observed similar big peaks too and wondered if I should just let them "clip naturally" or add some kind of limitation.

Probably a limiter is a good idea. Will look into it.

@DomiKamu
Copy link
Author

Can I delete the YT video?

@naus3a
Copy link
Owner

naus3a commented Jan 30, 2018

Sure thanks!

@DomiKamu
Copy link
Author

Was done! ;)

@neoh4x0r
Copy link

neoh4x0r commented Jun 28, 2019

@naus3a
I just discovered this module a few days ago because I was looking for a way to do bitwise-math to check if a certain CV voltage was present (ie binary bit flags), but the BitHammer module does not do this in a predictable way.

I believe the issue with large voltages is due to the nature of how floating-point values are stored as binary (IEEE 745 format).

I can see that that you are using a union to convert back-and-forth between floats and ints.

Under this implementation the float is in unpacked format, whereas, the int is the 32-bit single precision representation (ie packed binary) and results in very large integral values.

As it stands doing a left shift will result in the output being zero (regardless of what is given for the inputs -- because you are shifting inA by a very large amount which always results in zero).

Where as the right shift's output will always be equal the value of input A.

Performing bitwise operations really only make sense when they are done on an unpacked binary representation (ie integral data types, 0, 1, 2, 3, 4, etc [ 0000, 0001, 0010, 0011, 0100, etc) [or even negative values which will be two's complemented, eg -2 = 11111110 ].

You should really cast the inputs to integers (chopping-off the decimal part) and then the bitwise operations would perform as expected, and in a predictable way (finite values).

PS: I'm sorry for necro-ing this issue (more than a year later), but I has just discovered VCV rack and all of the possibilities with the plugins about a month ago.

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

No branches or pull requests

3 participants