Skip to content

Commit 2688029

Browse files
committed
readme update and small fixes
1 parent 717a4e0 commit 2688029

File tree

7 files changed

+38
-6
lines changed

7 files changed

+38
-6
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
# Angular Synthesizer
2-
Modular Synthesizer • Angular • Web Audio API • Web MIDI API
2+
Demo: [synthesizer.petzka.com](http://synthesizer.petzka.com)
3+
4+
Modular Synthesizer • Angular • Web Audio API • Web MIDI API • MIDI Device Detection • Local Storage
35
###### *© 2019 - Moritz Petzka - [petzka.com](https://petzka.com/)*
46
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>.
57

68
| Frameworks | | Links |
79
| ---:| :--- | :--- |
8-
| <img src="https://angular.io/assets/images/logos/angular/angular.svg" height="64" alt="Angular Logo" /> | Integration as Angular Module | [WEBSITE](https://angular.io) <br> [DOCS](https://angular.io/docs)|
10+
| <img src="https://angular.io/assets/images/logos/angular/angular.svg" height="64" alt="Angular Logo" /> Angular | Integration as Angular Module | [WEBSITE](https://angular.io) <br> [DOCS](https://angular.io/docs)|
11+
| <img src="https://material.angular.io/assets/img/angular-material-logo.svg" height="64" alt="Angular Logo" /> Angular Material | Uses Angular Material | [WEBSITE](https://material.angular.io/) <br> [DOCS](https://material.angular.io/guide/getting-started)|
912
| <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/W3C%C2%AE_Icon.svg/1200px-W3C%C2%AE_Icon.svg.png" height="64" alt="Nest Logo" /><br> Web Audio API | Generate and modify audio in browser | [INFOS](https://www.w3.org/TR/webaudio/)|
1013
| <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/W3C%C2%AE_Icon.svg/1200px-W3C%C2%AE_Icon.svg.png" height="64" alt="Nest Logo" /><br> Web MIDI API | Use MIDI devices in browser | [INFOS](https://www.w3.org/TR/webmidi/)|
14+
15+
16+
## Angular integration
17+
To integrate this module in your Angular project:
18+
### Add import to `app/app.module.ts`
19+
20+
```javascript
21+
imports: [
22+
SynthesizerModule
23+
],
24+
```
25+
26+
### Angular Material has to be installed
27+
Install Angular Material in your Project with:
28+
`ng add @angular/material`

midi-controller/midi-controller.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div *ngIf="synthesizer && synthesizer.midi && synthesizer.midi.controllers"
22
class="midi-controllers">
3+
<h2 *ngIf="synthesizer.midi.controllers.length">MIDI devices</h2>
34
<button class="midi-controller" *ngFor="let controller of synthesizer.midi.controllers"
45
(click)="controller.toggleActive()"
56
[ngClass]="{active:(controller.active)}"

midi-controller/midi-controller.component.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55

66
.midi-controller {
77
flex: 1;
8+
cursor: pointer;
9+
10+
&.active {
11+
background: #00c8ff;
12+
}
813
}
914
}

piano-keys/piano-keys.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
</div>
1919
</div>
20-
{{currentNote}} {{currentOctave}}
2120
<div class="piano-keys-keyboard"
2221
(mousedown)="mouseDown = true; onMouseMove(pressedKey, pressedOctave);"
2322
(mouseup)="mouseDown = false; onMouseMove(pressedKey, pressedOctave);"

synthesizer-control/synthesizer-control.component.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,12 @@ $slider_background: #ccc;
246246

247247
}
248248

249+
.hidden {
250+
width: 0;
251+
height: 0;
252+
position: absolute;
253+
opacity: 0;
254+
z-index: -10;
255+
pointer-events: none;
256+
}
257+

synthesizer.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@
6565

6666
}
6767

68+
6869
}

synthesizer.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22
import { LFO, OSC, Synthesizer, SynthesizerService } from './synthesizer.service';
3-
import { AppService } from '../../core/services/app.service';
43

54

65
@Component({
@@ -19,7 +18,7 @@ export class SynthesizerComponent implements OnInit {
1918
octaves = 4;
2019
connectLfo: LFO;
2120

22-
constructor(public app: AppService, public audioEditor: SynthesizerService, private ref: ChangeDetectorRef) {
21+
constructor(public audioEditor: SynthesizerService) {
2322
this.synthesizer = new Synthesizer(3);
2423
if (this.synthesizer.oscs) {
2524
this.currentOsc = this.synthesizer.oscs[0];

0 commit comments

Comments
 (0)