lib/score.js
function note (dur, pitch, data) {
  if (arguments.length === 1) return function (p, d) { return note(dur, p, d) }
  return assign({ pitch: pitch, duration: dur || 1 }, data)
}
function note (dur, pitch, data) {
  if (arguments.length === 1) return function (p, d) { return note(dur, p, d) }
  return assign({ pitch: pitch, duration: dur || 1 }, data)
}
function note ( dur , pitch , data ) { if ( arguments . length === 1 ) return function ( p , d ) { return note ( dur , p , d ) } return assign ( { pitch : pitch , duration : dur || 1 } , data ) }
Create a note from duration and pitch. It's a helper function to create
score elements easely.

A note is any object with duration and pitch attributes. The duration
must be a number and the pitch can be any value (but usually expressed by
integers, floats or strings)

If only duration is provided, a partially applied function is returned.

@param {Integer} duration - the note duration
@param {String|Integer} pitch - the note pitch
@param {Hash} data - (Optional) arbitraty note data
@return {Hash} a note

@example
score.note(1, 'A') // => { duration: 1, pitch: 'A' }
score.note(0.5, 'anything') // => { duration: 0.5, pitch: 'anything' }
score.note(2, 'A', 2, { inst: 'piano' }) // => { duration: 2, pitch: 'A', inst: 'piano' }

@example
// partially applied
['C', 'D', 'E'].map(score.note(1)) // => [{ duration: 1, pitch: 'C'},
{ duration: 1, pitch: 'D'}, { duration: 1, pitch: 'E'}]
Create a note from duration and pitch . It s a helper function to create score elements easely .