import { PianoSampler } from "./PianoSampler" ; import * as Tone from "tone/tone" ; /**
 * Play the piano sound of the notes
 */ export class PianoSound { _lowest : number ; _highest : number ; _piano : PianoSampler ; param lowest param highest constructor ( lowest , highest ) { this . _lowest = lowest ; this . _highest = highest ; this . _piano = new PianoSampler ( "./audio/" , this . _lowest , this . _highest ) ; } return { Promise < [ ] > } load ( ) { return Promise . all ( [ this . _piano . load ( ) ] ) ; } param notes keyDown ( notes ) { this . _piano . keyDown ( notes ) ; } param notes param time keyUp ( notes , time = Tone . now ( ) ) { time += .5 ; this . _piano . keyUp ( notes , time ) ; } param notes param duration param time keyDownUp ( notes , duration = "2n" , time = Tone . now ( ) ) { this . _piano . keyDownUp ( notes , duration , time ) ; } }