AudioKit / Keyboard

SwiftUI music keyboard
MIT License
133 stars 25 forks source link

Vertical piano layout #19

Closed josephktcheung closed 1 year ago

josephktcheung commented 1 year ago

Description

I'd like to create a vertical piano layout similar to logic pro, which should be exactly the current piano layout but make it vertical.

Below is snapshot from logic pro. It's using traditional piano layout with raised black keys over white keys, while isomorphic layout places all notes linearly right after one another.

Screenshot 2022-10-22 at 12 24 15 PM

Proposed Solution

Add a new verticalPiano layout which layout piano layout vertically.

Describe Alternatives You've Considered

Fork the library and add the new layout

Additional Context

No response

aure commented 1 year ago

Can you just take the regular piano and apply a rotation?

josephktcheung commented 1 year ago

Can you just take the regular piano and apply a rotation?

Screenshot 2022-10-22 at 12 45 24 PM

This is a snapshot after I rotate the piano by -90 degrees. It's okay but the words are vertically written which is a bit difficult to read.

Below is how I rotate it:

Keyboard(layout: .piano(pitchRange: (Pitch(36)...Pitch(75))))
    .rotationEffect(.degrees(-90))
aure commented 1 year ago

yeah, so constrain its width (or height pre-rotation) and you almost have it. I guess you want the labels to be rotated? I guess a .verticalPiano option is pretty trivial. Want to give it a shot?

josephktcheung commented 1 year ago

BTW I'm using the verticalIsomorphic layout in my project right now which already looks good to me, however there may be users who want to mimic logic pro / vocaloid editor to a T.

Screenshot 2022-10-22 at 12 50 05 PM

Also adding vertical piano layout is not difficult I believe.

josephktcheung commented 1 year ago

yeah, so constrain its width (or height pre-rotation) and you almost have it. I guess you want the labels to be rotated? I guess a .verticalPiano option is pretty trivial. Want to give it a shot?

Sure, will open a PR sometime later.

josephktcheung commented 1 year ago

@aure please review https://github.com/AudioKit/Keyboard/pull/20