Openframeworks ios

Hello! I’m studying openframeworks in Japan! nice to meet you.

I’m making a step sequencer on the iPhone.
However, the width of the iPhone and the total width of the step sequence do not match exactly and i’m very struggling.

Help me plz!

Hi! You have 1136 pixels available for 32 steps. That’s 35.50 pixels per step. But your stepSize is 35 and you add a gap of 2 pixels to that, which makes it 37 pixels per step. You don’t have enough pixels in the screen if you do 32 steps x 37 pixels.

1136 is not divisible by 32. You could get it working by switching to floats instead of ints. Each cell should be 35.50, including the gap. So maybe 33.50px + 2px for gap? If you want to use integers, you could do cells of 33 pixels, 2px gap, and then some black margin on the edges.

I hope it helps! :slight_smile:

1 Like

Thanks! I found my fault!!!
It was very simple. float -> double…
So sorry and I’m very appreciate your help!