Skip to content

Commit

Permalink
Merge pull request #44 from ishythefishy/play-scale
Browse files Browse the repository at this point in the history
Scale playback and 12/24 fret toggle
  • Loading branch information
whitep4nth3r authored Jun 17, 2020
2 parents cf96d35 + 3c9fcb6 commit d754db7
Show file tree
Hide file tree
Showing 53 changed files with 1,985 additions and 543 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class="chip"
[class.chip--active]="selected"
[class.chip--round]="rounded"
[class.chip--grey]="selectedColor === SelectedColor.grey"
[class.chip--muted]="selectedColor === SelectedColor.muted"
>
<ng-content></ng-content>
</a>
18 changes: 11 additions & 7 deletions apps/fretonator-web/src/app/common/chips/chip/chip.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
@include chip_button_base()
}

.chip--grey {
border-color: var(--grey);
color: var(--grey);
.chip--muted {
border-color: var(--chip-border-color-muted);
color: var(--chip-foreground-color-muted);
background-color: var(--chip-background-color-muted);
}

.chip--round {
Expand All @@ -25,10 +26,13 @@
}

.chip--active {
background-color: var(--black);
color: var(--white);
background-color: var(--chip-background-color-active);
color: var(--chip-foreground-color-active);
border-color: var(--chip-border-color-active);

&.chip--grey {
background-color: var(--grey);
&.chip--muted {
background-color: var(--chip-background-color-muted-active);
border-color: var(--chip-border-color-muted-active);
color: var(--chip-foreground-color-muted-active);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router';

export enum SelectedColor {
default = 'default',
grey = 'grey',
muted = 'muted',
}

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import {
cIonianChordMap,
cIonianFretMappings,
cIonianMode,
cIonianSimilarModes,
cLydianMode,
cLydianSimilarModes,
cMajorPentatonicChordMap,
cMinorPentatonicChordMap,
cPhrygianMode,
Expand Down Expand Up @@ -1351,3 +1354,70 @@ describe('FretMapService:convertFretMapConfigurationToDisplayString', () => {
expect(result).toBe('A flat Minor Pentatonic');
});
});

describe('FretMapService:getNoteExtenderStringFromNoteObject', () => {
let service: FretMapService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FretMapService);
});

it('returns NoteExtenderString.flat for a flat note', () => {
const result = service.getNoteExtenderStringFromNoteObject({
name: 'b',
flat: true,
sharp: false,
doubleSharp: false,
doubleFlat: false
});
expect(result).toBe('flat');
});


it('returns NoteExtenderString.sharp for a sharp note', () => {
const result = service.getNoteExtenderStringFromNoteObject({
name: 'd',
flat: false,
sharp: true,
doubleSharp: false,
doubleFlat: false
});
expect(result).toBe('sharp');
});

it('returns NoteExtenderString.natural for a natural note', () => {
const result = service.getNoteExtenderStringFromNoteObject({
name: 'd',
flat: false,
sharp: false,
doubleSharp: false,
doubleFlat: false
});
expect(result).toBe('natural');
});
});

describe('FretMapService:getSimilarModes', () => {
let service: FretMapService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FretMapService);
});

it('returns correctly for an input of c natural ionian', () => {
const result = service.getSimilarModes(cIonianMode, Mode.ionian);
expect(result).toEqual(cIonianSimilarModes);
});

it('returns correctly for an input of c natural lydian', () => {
const result = service.getSimilarModes(cLydianMode, Mode.lydian);
expect(result).toEqual(cLydianSimilarModes);
});

it('returns an empty array for a mode not in the StandardModePatterns array', () => {
const result = service.getSimilarModes(fSharpHarmonicMinor, Mode.harmonicMinor);
expect(result).toEqual([]);
});
});
Loading

0 comments on commit d754db7

Please sign in to comment.