-
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
28 changed files
with
96 additions
and
23 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...ges/MusicNotation-Editor.package/MNMorphBuilder.class/instance/createRestsForDuration..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,14 @@ | ||
converting | ||
createRestsForDuration: aDuration | ||
| powerOfTwo remainder | | ||
aDuration = 0 | ||
ifTrue: [ ^ OrderedCollection new ]. | ||
|
||
powerOfTwo := Fraction numerator: 4 denominator: 1. | ||
[ powerOfTwo > aDuration ] | ||
whileTrue: [ powerOfTwo := powerOfTwo / 2 ]. | ||
|
||
remainder := aDuration - powerOfTwo. | ||
^ (self createRestsForDuration: remainder) | ||
addFirst: (MNNote new duration: powerOfTwo); | ||
yourself |
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: [ :each | each duration ]. | ||
^ (aMeasure time - sum) max: 0 |
6 changes: 5 additions & 1 deletion
6
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" } |
5 changes: 5 additions & 0 deletions
5
packages/MusicNotation-Scripting.package/MNPitchBuilder.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 |
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 |
13 changes: 6 additions & 7 deletions
13
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,9 @@ | ||
{ | ||
"class" : { | ||
"context:step:" : "mgjm 6/19/2019 20:59" }, | ||
"context:" : "fb 6/24/2019 12:19", | ||
"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