Squeak Class Documentation category index | class index  
 
PianoRollScoreMorph
  category: Sound-Scores
  superclass: RectangleMorph
  subclasses:

A PianoRollScoreMorph displays a score such as a MIDIScore, and will scroll through it tracking the porgress of a ScorePlayerMorph (from which it is usually spawned).

timeScale is in pixels per score tick.

Currently the ambient track (for synchronizing thumbnails, eg) is treated specially here and in the score. This should be cleaned up by adding a trackType or something like it in the score.

instance methods
  accessing
  beatsPerMeasure:
movieClipPlayer
movieClipPlayer:
notePerBeat:
score
scorePlayer
selection
selection:
timeScale
timeSignature:over:

  drawing
  addNotes
drawMeasureLinesOn:
drawOn:
drawStaffOn:
isBlackKey:
rebuildFromScore

  dropping/grabbing
  acceptDroppingMorph:event:

  editing
  appendEvent:fullDuration:
copySelection
cutSelection
deleteSelection
insertSelection
insertTransposed

  event handling
  handlesMouseDown:
mouseDown:
mouseMove:
mouseUp:

  geometry
  contractTime
expandTime
extent:
fullBounds
layoutChanged
midiKeyForY:
tickTimeAtCursor
timeForX:
xForTime:
yForMidiKey:

  initialization
  initialize
on:
updateLowestNote

  menu
  addCustomMenuItems:hand:
addKeyboard
addMovieClipPlayer
beatLinesOnOff
invokeScoreMenu:
measureLinesOnOff

  scrolling
  autoScrollForX:
goToTime:
moveCursorToTime:
notesInRect:

  stepping
  step
stepTime

  submorphs-add/remove
  privateRemoveMorph:

class methods
  no messages
 

instance methods
  accessing top  
 

beatsPerMeasure:


 

movieClipPlayer


 

movieClipPlayer:


 

notePerBeat:


 

score


 

scorePlayer


 

selection

Returns an array of 3 elements:
trackIndex
indexInTrack of first note
indexInTrack of last note


 

selection:


 

timeScale


 

timeSignature:over:


  drawing top  
 

addNotes

Recompute the set of morphs that should be visible at the current scroll position.


 

drawMeasureLinesOn:


 

drawOn:


 

drawStaffOn:


 

isBlackKey:

Answer true if the given MIDI key corresponds to a black key on the piano keyboard.


 

rebuildFromScore

Rebuild my submorphs from the score. This method should be invoked after changing the time scale, the color or visibility of a track, the extent of this morph, etc.


  dropping/grabbing top  
 

acceptDroppingMorph:event:

In addition to placing this morph in the pianoRoll, add a corresponding
event to the score so that it will always appear when played, in addition
to possibly triggering other actions


  editing top  
 

appendEvent:fullDuration:


 

copySelection


 

cutSelection


 

deleteSelection


 

insertSelection


 

insertTransposed


  event handling top  
 

handlesMouseDown:

Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?


 

mouseDown:

Handle a mouse down event. The default response is to let my eventHandler, if any, handle it.


 

mouseMove:

Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.


 

mouseUp:

Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.


  geometry top  
 

contractTime


 

expandTime


 

extent:

Force rebuild when re-sized.


 

fullBounds

Overridden to clip submorph hit detection to my bounds.


 

layoutChanged

Override this to avoid propagating 'layoutChanged' when just adding/removing note objects.


 

midiKeyForY:


 

tickTimeAtCursor


 

timeForX:


 

xForTime:


 

yForMidiKey:


  initialization top  
 

initialize


 

on:


 

updateLowestNote

find the actual lowest note in the score


  menu top  
 

addCustomMenuItems:hand:

Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.


 

addKeyboard


 

addMovieClipPlayer


 

beatLinesOnOff


 

invokeScoreMenu:

Invoke the score's edit menu.


 

measureLinesOnOff


  scrolling top  
 

autoScrollForX:

Scroll by the amount x lies outside of my innerBounds. Return true if this happens.


 

goToTime:


 

moveCursorToTime:


 

notesInRect:


  stepping top  
 

step

Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


  submorphs-add/remove top  
 

privateRemoveMorph:

Private! Should only be used by methods that maintain the ower/submorph invariant.


class methods
  no messages top