This repository has been archived by the owner on May 29, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ng-web-apis/proper-reject
fix(tokens): add Promise rejection for not supporting browsers
- Loading branch information
Showing
9 changed files
with
83 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
<section *ngIf="notes$ | async as notes" class="piano"> | ||
<ng-container | ||
*ngFor="let note of notes | keyvalue; trackBy: noteKey" | ||
waOscillatorNode | ||
type="sawtooth" | ||
autoplay | ||
[frequency]="toFrequency(note.key) | waAudioParam: 0.2" | ||
> | ||
<ng-container waGainNode gain="0" [gain]="note.value | waAudioParam: 0.01"> | ||
<ng-container waAudioDestinationNode></ng-container> | ||
<p *ngIf="!supported"> | ||
Web MIDI API is not supported by your browser | ||
</p> | ||
<button *ngIf="!started; else piano" class="start" (click)="start()"> | ||
Start AudioContext | ||
</button> | ||
<ng-template #piano> | ||
<section *ngIf="notes$ | async as notes" class="piano"> | ||
<ng-container | ||
*ngFor="let note of notes | keyvalue; trackBy: noteKey" | ||
waOscillatorNode | ||
type="sawtooth" | ||
autoplay | ||
[frequency]="toFrequency(note.key)" | ||
> | ||
<ng-container waGainNode gain="0" [gain]="note.value | waAudioParam: 0.01"> | ||
<ng-container waAudioDestinationNode></ng-container> | ||
</ng-container> | ||
</ng-container> | ||
</ng-container> | ||
|
||
<div | ||
*ngFor="let key of octaves" | ||
[class]="getClass(notes, key)" | ||
(mousedown)="onMouseDown(key)" | ||
(touchstart)="onMouseDown(key)" | ||
></div> | ||
</section> | ||
<div | ||
*ngFor="let key of octaves" | ||
[class]="getClass(notes, key)" | ||
(mousedown)="onMouseDown(key)" | ||
(touchstart)="onMouseDown(key)" | ||
></div> | ||
</section> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters