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

Fluid.waveform incorrectly displaying first sample #26

Closed
MattS6464 opened this issue Aug 10, 2023 · 4 comments
Closed

Fluid.waveform incorrectly displaying first sample #26

MattS6464 opened this issue Aug 10, 2023 · 4 comments

Comments

@MattS6464
Copy link

fluid.waveform appears to add an extra sample at the start and cuts off the last sample. This happens on both the audiobuffer layer and the featuresbuffer layer.
fluid waveform bug

@tremblap
Copy link
Member

tremblap commented Aug 13, 2023

Sharing the code to reproduce would be great next time @MattS6464 :) especially since it is sooooo clean, I love your Max style.

Here it is re-coded and dirty and without comments


----------begin_max5_patcher----------
663.3ocwWssbaBCD8Y3qPCO65Aws.8o7ezoiGAHbkGtMRBGmISx2dkVANtw1
XEWZyCfrDKb3b1ytH+hqiWd2ApvC8czOPNNu353.KoWvYbtiWC4PQMQ.g40P
EBxVp2Jy0jzCRX8hZJguBQJKqIOS4nJJQNvoh7gpJ0TIUHQbZ4z80qtDsURj
rt1M0rVZQ2PK7jBFincnoaPVSk.t3wUYk.Zc469FNX5gYhS9bO0vDOOzOmvg
HK9Eqc6FNsPZtZDNas+JTTBLD3+.LDr1+3Mofl0NgbfdsWcc0mVYoHsSLv7r
lGgGEEBmzPkT9FZKIuFXi+s4XEqVEeCbAup5AV45mH6oUc7l2VuS3caoHKTO
DGAyB0CWVKv2gVXqggLTx5NwsXu9g+q7Aow5y3GB9hsAoe0t.re1+NWvwWkK
qGImqGOb0rZUcGQYOl8G0LALNqCHCCteL39ChSzCIQmPaic7np9Aa46JR7cn
HszmTz7rxBCjuYZX9nfzzKPwWVzBNWzRtsnkSZ2NqpfwPGwPsRnbEg9yWXfW
NtKQ4nbq4Z7U4JPQqnZropOCnZXv+MlZpO0lz.UBG8XoJayZguF94Z9EccQ.
LRyS+.CiifTLNIc44+0596i7WGnNhTGIpiTqYb380sGO1jy7U+r3kua+UR0p
5tRigz1umMuudVR5axj9.8h+D4SHBO8Fw9vtAATzq+mLWzMvKlduFqFQuiyI
94ShQuiMcPWTbsEnoGx7HEtDHgs.ozE.Hs1guEivK.PQVPn3E.mPKvIZIxPV
fy4NAiWmz2umxEiACPnpm20w0SSWASYslowvTNcOaJdyJDtpBTpJ+T+SGn98
PhogrWSWoZiCps+YpyTjSAIzqPuaBQOwvCnkh6qt+F.TmTi4
-----------end_max5_patcher-----------

@tremblap
Copy link
Member

investigation results:

  1. adding at line 666 of waveform.js ld.data.forEach(function(s){post(s.data + '\n');}); shows that the array passed to fav is the right one...

  2. pinging around line 767 of the generated fav-max.js, which is line 239 of the src/display-jsui.js, I can see that the error is in the resampling. desc[0] and desc[1] are right when printed, but the resampling is not right.

I now need to learn how to find out which definition of the sample method is used as I cannot find it anywhere to fix it...

@tremblap
Copy link
Member

using this streamlined patch where the waveform object has 20 pixel wide for a 5 sample-long buffer makes the resampling data obvious. Printing desc[1] and its resampling max is good to understand the issue.

@tremblap
Copy link
Member

found it. a fav.js issue. PR made there and here.

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

2 participants