Squeak Class Documentation category index | class index  
 
KeyboardMorphForInput
  category: Sound-Scores
  superclass: PianoKeyboardMorph
  subclasses:

This class adds state and controls to the basic PianoKeyboardMorph so that notes of reliable duration can be keyed into a score without the need for a real keyboard.

To try this out, execute...

| n score | n _ 3.
score _ (MIDIScore new tracks: ((1 to: n) collect: [:i | Array new]);
trackInfo: ((1 to: n) collect: [:i | 'Instrument' , i printString]);
tempoMap: nil; ticksPerQuarterNote: 96).
ScorePlayerMorph openOn: score title: 'empty score'

Then open a pianoRoll and, from that, open a keyboard. The rule is that the keyboard will append after the current selection. If the current selection is muted or nil, then input will go to the end of the first non-muted track.

instance methods
  events
  mouseDownPitch:event:noteMorph:
mouseUpPitch:event:noteMorph:
soundForEvent:inTrack:

  initialization
  addRecordingControls
initialize
pianoRoll:

  note controls
  articulation:onOff:
backspaceNote
buildChord:
deleteNotes
durMod:onOff:
duration:onOff:
emitRest
fullDuration
noteDuration
velocity

class methods
  no messages
 

instance methods
  events top  
 

mouseDownPitch:event:noteMorph:


 

mouseUpPitch:event:noteMorph:


 

soundForEvent:inTrack:


  initialization top  
 

addRecordingControls

Add chord, rest and delete buttons


 

initialize


 

pianoRoll:


  note controls top  
 

articulation:onOff:

artic = eg, #legato, #normal, #staccato.


 

backspaceNote


 

buildChord:


 

deleteNotes


 

durMod:onOff:

durMod = eg, #dotted, #normal, #triplets, #quints


 

duration:onOff:

denom = eg, 1, 2, 4, 8, 16


 

emitRest

All this selection logic should be shared with mouseDown...


 

fullDuration


 

noteDuration


 

velocity


class methods
  no messages top