added a ternary operator to make sure note is not below MIDI 12