-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
88 additions
and
23 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...ges/MusicNotation-Editor.package/MNMorphBuilder.class/instance/addRestsForDuration.to..st
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
converting | ||
addRestsForDuration: aDuration to: aMorph | ||
| powerOfTwo remainder | | ||
aDuration strictlyPositive | ||
ifFalse: [ ^ self ]. | ||
|
||
powerOfTwo := Fraction numerator: 8 denominator: 1. | ||
[ powerOfTwo > aDuration ] | ||
whileTrue: [ powerOfTwo := powerOfTwo / 2 ]. | ||
|
||
remainder := aDuration - powerOfTwo. | ||
self addRestsForDuration: remainder to: aMorph. | ||
self add: (MNNote new duration: powerOfTwo) to: aMorph. |
5 changes: 5 additions & 0 deletions
5
...ges/MusicNotation-Editor.package/MNMorphBuilder.class/instance/emptyDurationInMeasure..st
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
converting | ||
emptyDurationInMeasure: aMeasure | ||
| sum | | ||
sum := aMeasure notes detectSum: #duration. | ||
^ (aMeasure time - sum) max: 0 |
5 changes: 4 additions & 1 deletion
5
packages/MusicNotation-Editor.package/MNMorphBuilder.class/instance/visitMeasure..st
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
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/MusicNotation-Scripting.package/MNLengthBuilder.class/class/context..st
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
context: aContext | ||
^ self new | ||
context: aContext; | ||
yourself |
3 changes: 3 additions & 0 deletions
3
packages/MusicNotation-Scripting.package/MNLengthBuilder.class/instance/^slash.st
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
arithmetic | ||
/ aNumber | ||
^ self context addNote: (self createNote: 1 / aNumber) |
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/MusicNotation-Scripting.package/MNLengthBuilder.class/instance/createNote..st
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
createNote: aNumber | ||
^ MNNote new | ||
duration: aNumber |
8 changes: 8 additions & 0 deletions
8
packages/MusicNotation-Scripting.package/MNLengthBuilder.class/methodProperties.json
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"class" : { | ||
"context:" : "fb 6/24/2019 12:19" }, | ||
"instance" : { | ||
"/" : "fb 6/24/2019 12:14", | ||
"context" : "mgjm 6/19/2019 20:59", | ||
"context:" : "mgjm 6/19/2019 20:59", | ||
"createNote:" : "fb 6/24/2019 12:13" } } |
14 changes: 14 additions & 0 deletions
14
packages/MusicNotation-Scripting.package/MNLengthBuilder.class/properties.json
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "MusicNotation-Scripting", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"context" ], | ||
"name" : "MNLengthBuilder", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
4 changes: 2 additions & 2 deletions
4
packages/MusicNotation-Scripting.package/MNPitchBuilder.class/class/context.step..st
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,6 +1,6 @@ | ||
instance creation | ||
context: aContext step: anObject | ||
context: aContext step: aStep | ||
^ self new | ||
context: aContext; | ||
step: anObject; | ||
step: aStep; | ||
yourself |
7 changes: 0 additions & 7 deletions
7
packages/MusicNotation-Scripting.package/MNPitchBuilder.class/instance/^slash.st
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/MusicNotation-Scripting.package/MNPitchBuilder.class/instance/createNote..st
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
createNote: aNumber | ||
^ (super createNote: aNumber) | ||
addPitch: self createPitch; | ||
yourself |
12 changes: 5 additions & 7 deletions
12
packages/MusicNotation-Scripting.package/MNPitchBuilder.class/methodProperties.json
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,10 +1,8 @@ | ||
{ | ||
"class" : { | ||
"context:step:" : "mgjm 6/19/2019 20:59" }, | ||
"context:step:" : "fb 6/24/2019 12:20" }, | ||
"instance" : { | ||
"/" : "mgjm 6/19/2019 21:30", | ||
"context" : "mgjm 6/19/2019 20:59", | ||
"context:" : "mgjm 6/19/2019 20:59", | ||
"createPitch" : "mgjm 6/19/2019 21:27", | ||
"step" : "mgjm 6/19/2019 20:59", | ||
"step:" : "mgjm 6/19/2019 20:59" } } | ||
"createNote:" : "fb 6/24/2019 12:16", | ||
"createPitch" : "fb 6/24/2019 12:14", | ||
"step" : "fb 6/24/2019 12:11", | ||
"step:" : "fb 6/24/2019 12:11" } } |
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
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
packages/MusicNotation-Tests.package/MNLengthBuilderTest.class/instance/testAddRest4.st
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
as yet unclassified | ||
testAddRest4 | ||
| context builder | | ||
context := self createContext. | ||
builder := MNLengthBuilder context: context. | ||
|
||
builder / 4. | ||
|
||
self assert: 1 equals: context measure notes size. | ||
self assert: 1/4 equals: context measure notes first duration. | ||
self assert: context measure notes first pitches isEmpty. |
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