gnosisguild / wand-nft

wand-nft.vercel.app
8 stars 6 forks source link

state.halo.rhythm not correct #104

Closed cedricwaxwing closed 1 year ago

cedricwaxwing commented 1 year ago

Unless I'm not understanding something correctly, I believe the rhythm array is off. For example, here is what it looks like for this UI:

image [false, false, false, true, false, false, false, false, false, false, false, false, true]

And with 0 halo's selected: [false, false, false, true, false, false, false, false, false, false, false, false, false]

jfschwarz commented 1 year ago

The state only represents one half of the circle, including top and bottom segments, since the other half is derived by mirroring. Also there are halos with wide and narrow segments, but we generally represent them in arrays of length 13. When looking at a wide segment halo, the array items at odd indices are to be ignored.

so for wide shape halos the array looks like this:

[
  <top>
  <not used>
  <next to top>
  <not used>
  <second next to top>
  <not used>
  ...
  <next to bottom>
  <not used>
  <bottom>
]

for narrow shape halos, like this:

[
  <top>
  <next to top>
  <second next to top>
  ...
  <next to bottom>
  <bottom>
]

(maybe this function could be helpful: https://github.com/gnosis/wand-nft/blob/master/apps/minting-app/state/transforms/transformRhythm.ts)

cedricwaxwing commented 1 year ago

the array items at odd indices are to be ignored

Ahh ok this makes sense now. 👍 Yes, I'll use the function for the arp melody so that if there are no segments selected, there will be no arp.