Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeySignature - port to TypeScript #22

Merged
merged 5 commits into from
Mar 27, 2021
Merged

Conversation

ksraj123
Copy link
Member

@ksraj123 ksraj123 commented Mar 16, 2021

Reference #18
Ports keysignature.py to typescript.

Copy link
Member Author

@ksraj123 ksraj123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meganindya Currently, this PR ports only a part of the file, so that its easier to go through line by line. Please have a look at the ported and original code and share your insights. I have also highlighted some points I was curious about. Thanks

src/.prototype/musicutils/abstract/AKeySignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/KeySignature.ts Outdated Show resolved Hide resolved
@ksraj123 ksraj123 changed the base branch from develop to musicutils March 22, 2021 03:44
@ksraj123
Copy link
Member Author

Entire file ported, all the test cases are passing. Thanks

Screenshot 2021-03-22 at 9 10 54 AM

@meganindya
Copy link
Member

This is taking a while. I'm making a few changes on top. Converting to draft for now.

@meganindya meganindya marked this pull request as draft March 24, 2021 16:32
Improve on the documentation (plus cosmetic changes) extensively. Add minor code improvements and corrections sparingly.
@meganindya meganindya changed the title KeySingature - port to typescript - Discussion KeySignature - port to TypeScript Mar 24, 2021
Copy link
Member

@meganindya meganindya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@walterbender need some inputs.

Documentation required at some more places. I've marked the areas with a 'docs' comment.

On another note, there are 16 print statements in the Python code. I was thinking if we should use throw-try-catch error handling for those cases instead?

'ajam maqam': 'bb'
};

static readonly MODE_MAPPER: { [key: string]: string } = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs

Comment on lines 198 to 205
key: string;
mode: string;
scale: string[];
halfSteps: number[];
keySignature: string;
genericScale: string[];
scalarModeNumbers: string[];
eastIndianSolfegeNotes: string[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which of these should we expect to be directly accessed through the instance, and which are private?

Also need docs.

Comment on lines 207 to 212
private _scale: Scale;
private _noteNames: string[];
private _fixedSolfege: boolean;
private _solfegeNotes: string[];
private _customNoteNames: string[];
private _numberOfSemitones: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs

src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
src/.prototype/musicutils/ts/keysignature.ts Outdated Show resolved Hide resolved
@meganindya meganindya added this to the Alpha Release milestone Mar 27, 2021
Add getters for public instance variables, add missing documentation, and make cosmetic improvements.
Copy link
Member

@meganindya meganindya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me forever to finish this up. Great job on your part though.

@meganindya meganindya marked this pull request as ready for review March 27, 2021 19:58
@meganindya meganindya merged commit c04fd38 into sugarlabs:musicutils Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants