garynewby / pianokeyboard Goto Github PK
View Code? Open in Web Editor NEWPiano keyboard view for iOS, in Swift
License: MIT License
Piano keyboard view for iOS, in Swift
License: MIT License
I see that currently labels for black keys aren't drawn. It'll help greatly if this feature exists.
Aloha!
Great library btw. Thanks!
I'd like to set only a few labels. the remaining show up as gray circles. If a label is "", perhaps remove the background circle?
With Xcode 9.4.1, attempting to read or modify the octave property on GNLPianoView gives the error: 'octave' is inaccessible due to 'internal' protection level.
Because octave is defined with var
it defaults to internal access level. I think the intended code is public var
as this accessor provides a way to change the keyboard octave.
For example:
I would like to be able to :
I suggest:
pianoView.setKeyLabels(labels: [Int:String])
Where labels
is a dictionary of [MidiNote : Label]
Alternatively, labels
could be a simple array of a fixed size of 128, to set ALL labels.
Like the AudioKit synth One, i'd love for a way to have a key pressed down and not released if a "hold" flag is set.
Sometimes if I play chords or move fast on the keyboard keys get stuck.
I think it has to do with the "touchUpOutside" gesture.
Or in your UIGestureRecognizer implementation you should implement the ".canceled" state.
I'll have a look in your code.
Otherwise, thanks, it's an awesome drop in keyboard.
Thanks for adding the latch feature.
can you make it so that in latch mode, the keys become more like toggle buttons? So in latch mode key 'K' is pressed, it stays pressed. But pressing it again should release it.
Thanks!
Also, making the latch variable inspectable will help identify which state the keyboard is in for showing UI etc.
Thanks!
For visually impaired users,
From documentation, it seems that element.accessibilityTraits = .allowsDirectInteraction seems to be the way to go?
setting the property on the keboardView doesn't seem to work. I tried with the imageLayer -- same thing - no go.
This will be a very useful feature from an accessibility perspective.
Hello, I am trying to run your demo but it will not play any sound? My device is in ring mode i cross check all things. what will be the issue ?
This worked great before. I have a keyboard that changes number of keys based on screen size. If numberOfKeys change, the keyboard layout is off, till a key is pressed and it redraws.
Sorry for the newbie question, but is it possible to use this component in a swiftui contentview e.g. something like
import SwiftUI
import PianoKeyboard
struct ContentView: View {
var body: some View {
VStack {
PianoKeyboard()
Text("Hello, world!")
.padding()
}
}
}
In the above I get the error Static method 'buildBlock' requires that 'PianoKeyboard' conform to 'View'
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.