smoosic 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/build/html/loading-unittest.html +2 -4
  2. package/build/html/smoosic.html +0 -1
  3. package/build/smoosic.js +19 -19
  4. package/package.json +2 -3
  5. package/release/smoosic.js +19 -19
  6. package/src/application/exports.ts +3 -2
  7. package/{build → src/common}/midi-parser.js +1 -1
  8. package/src/render/sui/scoreView.ts +8 -0
  9. package/src/render/vex/vxMeasure.ts +1 -1
  10. package/src/smo/data/measure.ts +8 -3
  11. package/src/smo/data/noteModifiers.ts +3 -3
  12. package/src/smo/data/score.ts +6 -0
  13. package/src/ui/dialogs/fileDialogs.ts +1 -1
  14. package/src/ui/dialogs/preferences.ts +8 -2
  15. package/types/src/application/exports.d.ts +526 -525
  16. package/types/src/application/exports.d.ts.map +1 -1
  17. package/types/src/common/midi-parser.d.ts +39 -0
  18. package/types/src/common/midi-parser.d.ts.map +1 -0
  19. package/types/src/common/vex.d.ts +2 -0
  20. package/types/src/common/vex.d.ts.map +1 -1
  21. package/types/src/render/sui/scoreViewOperations.d.ts +3 -3
  22. package/types/src/render/sui/scoreViewOperations.d.ts.map +1 -1
  23. package/types/src/render/vex/smoAdapter.d.ts +46 -46
  24. package/types/src/render/vex/vxMeasure.d.ts.map +1 -1
  25. package/types/src/smo/data/measure.d.ts +1 -0
  26. package/types/src/smo/data/measure.d.ts.map +1 -1
  27. package/types/src/smo/data/tuplet.d.ts.map +1 -1
  28. package/types/src/smo/xform/copypaste.d.ts.map +1 -1
  29. package/types/src/smo/xform/operations.d.ts +7 -1
  30. package/types/src/smo/xform/operations.d.ts.map +1 -1
  31. package/types/src/smo/xform/tickDuration.d.ts +6 -0
  32. package/types/src/smo/xform/tickDuration.d.ts.map +1 -1
  33. package/types/src/smo/xform/undo.d.ts.map +1 -1
  34. package/types/src/ui/dialogs/components/baseComponent.d.ts +4 -0
  35. package/types/src/ui/dialogs/components/baseComponent.d.ts.map +1 -1
  36. package/types/src/ui/dialogs/components/rocker.d.ts +4 -0
  37. package/types/src/ui/dialogs/components/rocker.d.ts.map +1 -1
  38. package/types/src/ui/dialogs/customTuplets.d.ts +26 -0
  39. package/types/src/ui/dialogs/customTuplets.d.ts.map +1 -0
  40. package/types/src/ui/menus/beams.d.ts.map +1 -1
  41. package/types/src/ui/menus/manager.d.ts.map +1 -1
  42. package/types/src/ui/menus/menu.d.ts +136 -136
  43. package/types/src/ui/menus/tuplets.d.ts +14 -0
  44. package/types/src/ui/menus/tuplets.d.ts.map +1 -0
  45. package/types/src/ui/ribbonLayout/default/defaultRibbon.d.ts.map +1 -1
  46. package/types/tests/file-load.d.ts +1 -1
  47. package/types/tests/file-load.d.ts.map +1 -1
  48. package/build/html/penLoadFile.html +0 -50
  49. package/build/html/penLoadXml.html +0 -51
  50. package/release/html/asyncPen.html +0 -230
  51. package/release/html/penLoadFile.html +0 -50
  52. package/release/html/penLoadXml.html +0 -51
  53. package/release/html/syncPen.html +0 -149
  54. package/tests/file-load.ts +0 -62
  55. package/tests/types/qunit.d.ts +0 -76
@@ -1,137 +1,137 @@
1
- import { SuiTracker } from '../../render/sui/tracker';
2
- import { SmoScore } from '../../smo/data/score';
3
- import { CompleteNotifier } from '../common';
4
- import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
5
- import { BrowserEventSource } from '../eventSource';
6
- import { UndoBuffer } from '../../smo/xform/undo';
7
- /**
8
- * Data for a menu choice. 'value' indicates which options selected
9
- * @category SuiMenu
10
- * @param icon - .icon class will be added to the choice
11
- * @param text - text to describe the choice
12
- * @param value - the value received by the menu loop
13
- * @param hotkey - optional key binding, if not supplied one is selected
14
- */
15
- export interface MenuChoiceDefinition {
16
- icon: string;
17
- text: string;
18
- value: string;
19
- hotkey?: string;
20
- }
21
- /**
22
- * Menu just array of choices
23
- * @category SuiMenu
24
- * @param label - Not currently displayed
25
- * @param menuItems - list of choices
26
- */
27
- export interface MenuDefinition {
28
- label: string;
29
- menuItems: MenuChoiceDefinition[];
30
- }
31
- /**
32
- * @category SuiMenu
33
- */
34
- export interface MenuTranslation {
35
- ctor: string;
36
- label: string;
37
- menuItems: MenuChoiceDefinition[];
38
- }
39
- export declare const MenuTranslations: MenuTranslation[];
40
- export declare const suiMenuTranslation: (menu: MenuDefinition, ctor: string) => {
41
- ctor: string;
42
- label: string;
43
- menuItems: MenuChoiceDefinition[];
44
- };
45
- /**
46
- * All menus take the same options. Menu choices can alter the score
47
- * directly, or call dialogs or even other menus
48
- * @category SuiMenu
49
- * @param ctor dialog constructor
50
- * @param position - menu position
51
- * @param view the MVVM object to change the score
52
- * @param score SmoScore, could also be read from the view
53
- * @param completeNotifier used to take over key/mouse control
54
- * @param closePromise resolved when the menu closes, used to syncronize with other modals
55
- * @param eventSource event source to register for additional events like mouseup
56
- * @param undoBuffer used to create undo
57
- */
58
- export interface SuiMenuParams {
59
- ctor: string;
60
- tracker: SuiTracker;
61
- score: SmoScore;
62
- completeNotifier: CompleteNotifier;
63
- closePromise: Promise<void> | null;
64
- view: SuiScoreViewOperations;
65
- eventSource: BrowserEventSource;
66
- undoBuffer: UndoBuffer;
67
- items?: MenuDefinition;
68
- }
69
- /**
70
- * Base class for menus, mostly for the interface and containing the
71
- * common parameters
72
- * @category SuiMenu
73
- */
74
- export declare abstract class SuiMenuBase {
75
- label: string;
76
- menuItems: MenuChoiceDefinition[];
77
- ctor: string;
78
- completeNotifier: CompleteNotifier;
79
- score: SmoScore;
80
- view: SuiScoreViewOperations;
81
- eventSource: BrowserEventSource;
82
- undoBuffer: UndoBuffer;
83
- focusIndex: number;
84
- closePromise: Promise<void> | null;
85
- tracker: SuiTracker;
86
- constructor(params: SuiMenuParams);
87
- abstract selection(ev: any): Promise<void>;
88
- abstract getDefinition(): MenuDefinition;
89
- /**
90
- * Base class can override this, called before display and event binding to
91
- * add or remove options from the static list
92
- */
93
- preAttach(): void;
94
- complete(): void;
95
- keydown(): void;
96
- }
97
- /**
98
- * Function to handle dislay a menu
99
- * @category SuiMenu
100
- */
101
- export type SuiMenuHandler = (menu: SuiMenuBase) => Promise<void>;
102
- /**
103
- * boolean function to decide to display a dialog, based on selections.
104
- * @category SuiMenu
105
- */
106
- export type SuiMenuShowOption = (menu: SuiMenuBase) => boolean;
107
- /**
108
- * Convenience interface. A menu option can be defined dynamically as a confiugured menu option,
109
- * and placed into an array.
110
- * @category SuiMenu
111
- */
112
- export interface SuiConfiguredMenuOption {
113
- menuChoice: MenuChoiceDefinition;
114
- handler: SuiMenuHandler;
115
- display: SuiMenuShowOption;
116
- }
117
- export declare const suiConfiguredMenuTranslate: (options: SuiConfiguredMenuOption[], label: string, ctor: string) => MenuTranslation;
118
- export type customizeMenuOptionsFcn = (menu: SuiConfiguredMenu) => void;
119
- /**
120
- * A menu of configured options.
121
- * @category SuiMenu
122
- */
123
- export declare class SuiConfiguredMenu extends SuiMenuBase {
124
- static menuCustomizations: Record<string, customizeMenuOptionsFcn | undefined>;
125
- menuOptions: SuiConfiguredMenuOption[];
126
- label: string;
127
- constructor(params: SuiMenuParams, label: string, options: SuiConfiguredMenuOption[]);
128
- selection(ev: any): Promise<void>;
129
- static definitionFromOptions(label: string, options: SuiConfiguredMenuOption[]): {
130
- label: string;
131
- menuItems: MenuChoiceDefinition[];
132
- };
133
- getDefinition(): MenuDefinition;
134
- preAttach(): void;
135
- }
136
- export declare const SuiMenuCustomizer: (fcn: customizeMenuOptionsFcn, ctor: string) => void;
1
+ import { SuiTracker } from '../../render/sui/tracker';
2
+ import { SmoScore } from '../../smo/data/score';
3
+ import { CompleteNotifier } from '../common';
4
+ import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
5
+ import { BrowserEventSource } from '../eventSource';
6
+ import { UndoBuffer } from '../../smo/xform/undo';
7
+ /**
8
+ * Data for a menu choice. 'value' indicates which options selected
9
+ * @category SuiMenu
10
+ * @param icon - .icon class will be added to the choice
11
+ * @param text - text to describe the choice
12
+ * @param value - the value received by the menu loop
13
+ * @param hotkey - optional key binding, if not supplied one is selected
14
+ */
15
+ export interface MenuChoiceDefinition {
16
+ icon: string;
17
+ text: string;
18
+ value: string;
19
+ hotkey?: string;
20
+ }
21
+ /**
22
+ * Menu just array of choices
23
+ * @category SuiMenu
24
+ * @param label - Not currently displayed
25
+ * @param menuItems - list of choices
26
+ */
27
+ export interface MenuDefinition {
28
+ label: string;
29
+ menuItems: MenuChoiceDefinition[];
30
+ }
31
+ /**
32
+ * @category SuiMenu
33
+ */
34
+ export interface MenuTranslation {
35
+ ctor: string;
36
+ label: string;
37
+ menuItems: MenuChoiceDefinition[];
38
+ }
39
+ export declare const MenuTranslations: MenuTranslation[];
40
+ export declare const suiMenuTranslation: (menu: MenuDefinition, ctor: string) => {
41
+ ctor: string;
42
+ label: string;
43
+ menuItems: MenuChoiceDefinition[];
44
+ };
45
+ /**
46
+ * All menus take the same options. Menu choices can alter the score
47
+ * directly, or call dialogs or even other menus
48
+ * @category SuiMenu
49
+ * @param ctor dialog constructor
50
+ * @param position - menu position
51
+ * @param view the MVVM object to change the score
52
+ * @param score SmoScore, could also be read from the view
53
+ * @param completeNotifier used to take over key/mouse control
54
+ * @param closePromise resolved when the menu closes, used to syncronize with other modals
55
+ * @param eventSource event source to register for additional events like mouseup
56
+ * @param undoBuffer used to create undo
57
+ */
58
+ export interface SuiMenuParams {
59
+ ctor: string;
60
+ tracker: SuiTracker;
61
+ score: SmoScore;
62
+ completeNotifier: CompleteNotifier;
63
+ closePromise: Promise<void> | null;
64
+ view: SuiScoreViewOperations;
65
+ eventSource: BrowserEventSource;
66
+ undoBuffer: UndoBuffer;
67
+ items?: MenuDefinition;
68
+ }
69
+ /**
70
+ * Base class for menus, mostly for the interface and containing the
71
+ * common parameters
72
+ * @category SuiMenu
73
+ */
74
+ export declare abstract class SuiMenuBase {
75
+ label: string;
76
+ menuItems: MenuChoiceDefinition[];
77
+ ctor: string;
78
+ completeNotifier: CompleteNotifier;
79
+ score: SmoScore;
80
+ view: SuiScoreViewOperations;
81
+ eventSource: BrowserEventSource;
82
+ undoBuffer: UndoBuffer;
83
+ focusIndex: number;
84
+ closePromise: Promise<void> | null;
85
+ tracker: SuiTracker;
86
+ constructor(params: SuiMenuParams);
87
+ abstract selection(ev: any): Promise<void>;
88
+ abstract getDefinition(): MenuDefinition;
89
+ /**
90
+ * Base class can override this, called before display and event binding to
91
+ * add or remove options from the static list
92
+ */
93
+ preAttach(): void;
94
+ complete(): void;
95
+ keydown(): void;
96
+ }
97
+ /**
98
+ * Function to handle dislay a menu
99
+ * @category SuiMenu
100
+ */
101
+ export type SuiMenuHandler = (menu: SuiMenuBase) => Promise<void>;
102
+ /**
103
+ * boolean function to decide to display a dialog, based on selections.
104
+ * @category SuiMenu
105
+ */
106
+ export type SuiMenuShowOption = (menu: SuiMenuBase) => boolean;
107
+ /**
108
+ * Convenience interface. A menu option can be defined dynamically as a confiugured menu option,
109
+ * and placed into an array.
110
+ * @category SuiMenu
111
+ */
112
+ export interface SuiConfiguredMenuOption {
113
+ menuChoice: MenuChoiceDefinition;
114
+ handler: SuiMenuHandler;
115
+ display: SuiMenuShowOption;
116
+ }
117
+ export declare const suiConfiguredMenuTranslate: (options: SuiConfiguredMenuOption[], label: string, ctor: string) => MenuTranslation;
118
+ export type customizeMenuOptionsFcn = (menu: SuiConfiguredMenu) => void;
119
+ /**
120
+ * A menu of configured options.
121
+ * @category SuiMenu
122
+ */
123
+ export declare class SuiConfiguredMenu extends SuiMenuBase {
124
+ static menuCustomizations: Record<string, customizeMenuOptionsFcn | undefined>;
125
+ menuOptions: SuiConfiguredMenuOption[];
126
+ label: string;
127
+ constructor(params: SuiMenuParams, label: string, options: SuiConfiguredMenuOption[]);
128
+ selection(ev: any): Promise<void>;
129
+ static definitionFromOptions(label: string, options: SuiConfiguredMenuOption[]): {
130
+ label: string;
131
+ menuItems: MenuChoiceDefinition[];
132
+ };
133
+ getDefinition(): MenuDefinition;
134
+ preAttach(): void;
135
+ }
136
+ export declare const SuiMenuCustomizer: (fcn: customizeMenuOptionsFcn, ctor: string) => void;
137
137
  //# sourceMappingURL=menu.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { SuiMenuParams, SuiConfiguredMenuOption, SuiConfiguredMenu } from './menu';
2
+ /**
3
+ * stuff you can do to beams
4
+ * @category SuiMenu
5
+ */
6
+ export declare class SuiTupletMenu extends SuiConfiguredMenu {
7
+ constructor(params: SuiMenuParams);
8
+ }
9
+ /**
10
+ * Stuff you can do to tuplets
11
+ * @category SuiMenu
12
+ */
13
+ export declare const SuiTupletMenuOptions: SuiConfiguredMenuOption[];
14
+ //# sourceMappingURL=tuplets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tuplets.d.ts","sourceRoot":"","sources":["../../../../src/ui/menus/tuplets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAC/B,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAK/D;;;GAGG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;gBACpC,MAAM,EAAE,aAAa;CAGpC;AAyHD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,uBAAuB,EAEzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ribbonLayout/default/defaultRibbon.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,MAAM,KAAK,OAAO,IAAI,YAAY,CAQjC;IAED,MAAM,KAAK,aAAa,IAAI,gBAAgB,EAAE,CAE7C;IAED,MAAM,KAAK,aAAa,aAKvB;IACD,MAAM,KAAK,QAAQ,aAElB;IACD,MAAM,KAAK,UAAU,aAEpB;IACD,MAAM,KAAK,cAAc,IAAI,gBAAgB,EAAE,CAgG9C;IAED,MAAM,KAAK,kBAAkB,IAAI,gBAAgB,EAAE,CAoBlD;IAED,MAAM,KAAK,iBAAiB,IAAI,gBAAgB,EAAE,CA4HjD;CACF"}
1
+ {"version":3,"file":"defaultRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/ribbonLayout/default/defaultRibbon.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,MAAM,KAAK,OAAO,IAAI,YAAY,CAQjC;IAED,MAAM,KAAK,aAAa,IAAI,gBAAgB,EAAE,CAE7C;IAED,MAAM,KAAK,aAAa,aAKvB;IACD,MAAM,KAAK,QAAQ,aAElB;IACD,MAAM,KAAK,UAAU,aAEpB;IACD,MAAM,KAAK,cAAc,IAAI,gBAAgB,EAAE,CAgG9C;IAED,MAAM,KAAK,kBAAkB,IAAI,gBAAgB,EAAE,CAoBlD;IAED,MAAM,KAAK,iBAAiB,IAAI,gBAAgB,EAAE,CAsIjD;CACF"}
@@ -1,2 +1,2 @@
1
- export declare function createLoadTests(): void;
1
+ export declare function createLoadTests(): Promise<void>;
2
2
  //# sourceMappingURL=file-load.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-load.d.ts","sourceRoot":"","sources":["../../tests/file-load.ts"],"names":[],"mappings":"AASA,wBAAgB,eAAe,IAAI,IAAI,CAoDtC"}
1
+ {"version":3,"file":"file-load.d.ts","sourceRoot":"","sources":["../../tests/file-load.ts"],"names":[],"mappings":"AAWA,wBAAsB,eAAe,kBAwEpC"}
@@ -1,50 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <title>Smoosic Editor</title>
7
- <link href="../styles/fonts.css" rel="stylesheet">
8
- <link href="../styles/media.css" rel="stylesheet">
9
- <link href="../styles/ribbon.css" rel="stylesheet">
10
- <link href="../styles/dialogs.css" rel="stylesheet">
11
- <link href="../styles/menus.css" rel="stylesheet">
12
- <link href="../styles/piano.css" rel="stylesheet">
13
- <link href="../styles/tree.css" rel="stylesheet">
14
- <script type="text/javascript"
15
- src="https://aarondavidnewman.github.io/vexflow_smoosic/releases/vexflow-debug.js"></script>
16
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js"
17
- integrity="sha512-uVSVjE7zYsGz4ag0HEzfugJ78oHCI1KhdkivjQro8ABL/PRiEO4ROwvrolYAcZnky0Fl/baWKYilQfWvESliRA=="
18
- crossorigin="anonymous" referrerpolicy="no-referrer"></script>
19
- <!-- script type="text/javascript" src="../../../vex_smoosic/vexflow_smoosic/build/vexflow-debug.js"></script -->
20
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.js"></script>
21
- <script type="text/javascript" src="../smoosic.js"></script>
22
- <script type="text/javascript">
23
- document.addEventListener("DOMContentLoaded", function (event) {
24
- // A simple music program using Smoosic in library mode.
25
- // Load a Smoosic JSON file and render the score
26
- const path = 'https://aarondavidnewman.github.io/Smoosic/release/library/hymns/Precious Lord.json';
27
- Smo.SuiApplication.configure({
28
- mode: 'library',
29
- scoreDomContainer: 'outer-container',
30
- remoteScore: path
31
- }).then((application) => {
32
- console.log('done');
33
- });
34
- });
35
- </script>
36
- </head>
37
-
38
- <body>
39
- <sub id="link-hdr"><a href="https://github.com/Smoosic/smoosic">Github site</a> |
40
- <a href="https://smoosic.github.io/Smoosic/changes.md">change notes</a> |
41
- <a href="https://smoosic.github.io/Smoosic/release/html/smoosic.html">application</a><button class="close-header"><span class="icon icon-cross"></span></button></sub>
42
- <!-- audio crossOrigin="anonymous" id="sample" src="https://aarondavidnewman.github.io/Smoosic/build/sound/piano_middle_C.mp3" / -->
43
- <div id="outer-container" style="overflow:auto">
44
- <div id="container1">
45
-
46
- </div>
47
- </div>
48
- </body>
49
-
50
- </html>
@@ -1,51 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
-
4
- <head>
5
- <meta charset="utf-8">
6
- <title>Smoosic Editor</title>
7
- <link href="../styles/fonts.css" rel="stylesheet">
8
- <link href="../styles/media.css" rel="stylesheet">
9
- <link href="../styles/ribbon.css" rel="stylesheet">
10
- <link href="../styles/dialogs.css" rel="stylesheet">
11
- <link href="../styles/menus.css" rel="stylesheet">
12
- <link href="../styles/piano.css" rel="stylesheet">
13
- <link href="../styles/tree.css" rel="stylesheet">
14
- <script type="text/javascript"
15
- src="https://aarondavidnewman.github.io/vexflow_smoosic/releases/vexflow-debug.js"></script>
16
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js"
17
- integrity="sha512-uVSVjE7zYsGz4ag0HEzfugJ78oHCI1KhdkivjQro8ABL/PRiEO4ROwvrolYAcZnky0Fl/baWKYilQfWvESliRA=="
18
- crossorigin="anonymous" referrerpolicy="no-referrer"></script>
19
- <!-- script type="text/javascript" src="../../../vex_smoosic/vexflow_smoosic/build/vexflow-debug.js"></script -->
20
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.js"></script>
21
- <script type="text/javascript" src="../smoosic.js"></script>
22
- <script type="text/javascript">
23
- document.addEventListener("DOMContentLoaded", function (event) {
24
-
25
- // A simple music program using Smoosic in library mode.
26
- // Load a Music XML file (Finale) and render it
27
- const path = 'https://aarondavidnewman.github.io/Smoosic/release/library/Beethoven_AnDieFerneGeliebte.xml';
28
- Smo.SuiApplication.configure({
29
- mode: 'library',
30
- scoreDomContainer: 'outer-container',
31
- remoteScore: path
32
- }).then((application) => {
33
- console.log('done!');
34
- });
35
- });
36
- </script>
37
- </head>
38
-
39
- <body>
40
- <sub id="link-hdr"><a href="https://github.com/Smoosic/smoosic">Github site</a> |
41
- <a href="https://smoosic.github.io/Smoosic/changes.md">change notes</a> |
42
- <a href="https://smoosic.github.io/Smoosic/release/html/smoosic.html">application</a><button class="close-header"><span class="icon icon-cross"></span></button></sub>
43
- <!-- audio crossOrigin="anonymous" id="sample" src="https://aarondavidnewman.github.io/Smoosic/build/sound/piano_middle_C.mp3" / -->
44
- <div id="outer-container" style="overflow:auto">
45
- <div id="container1">
46
-
47
- </div>
48
- </div>
49
- </body>
50
-
51
- </html>
@@ -1,230 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Smoosic Editor</title>
6
- <link href="../styles/fonts.css" rel="stylesheet">
7
- <link href="../styles/media.css" rel="stylesheet">
8
- <link href="../styles/ribbon.css" rel="stylesheet">
9
- <link href="../styles/dialogs.css" rel="stylesheet">
10
- <link href="../styles/menus.css" rel="stylesheet">
11
- <link href="../styles/piano.css" rel="stylesheet">
12
- <link href="../styles/tree.css" rel="stylesheet">
13
- <script type="text/javascript" src="https://smoosic.github.io/vexflow_smoosic/releases/vexflow-debug.js"></script>
14
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.6.0/jszip.min.js" integrity="sha512-uVSVjE7zYsGz4ag0HEzfugJ78oHCI1KhdkivjQro8ABL/PRiEO4ROwvrolYAcZnky0Fl/baWKYilQfWvESliRA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
15
- <!-- script type="text/javascript" src="../../../vex_smoosic/vexflow_smoosic/build/vexflow-debug.js"></script -->
16
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.js" ></script>
17
- <script type="text/javascript" src="../smoosic.js" ></script>
18
- <script type="text/javascript">
19
- document.addEventListener("DOMContentLoaded", function (event) {
20
- // @@@@@@
21
- // A simple music program using Smoosic in library mode.
22
- //
23
- // Music is rendered in the background, and during the rendering tracker/mapper maps
24
- // the location of the music for the UI. If you don't wait for the music to be rendered, you will end up
25
- // acting on the wrong notes.
26
- //
27
- // If you want to manipulate the music objects directly, check out the syncPen
28
- var app = async (Smo, application) => {
29
- // create the app in library mode (no UI)
30
- // Create an empty score (1 measure rests)
31
- const view = application.view;
32
- const score = Smo.SmoScore.getDefaultScore(Smo.SmoScore.defaults, null);
33
- score.preferences.autoPlay = false; // kind of annoying for this demo
34
- const renderer = view.renderer;
35
- // Create and start the view object.
36
- // The outer container DOM is for scrolling
37
- renderer.stepMode = true;
38
-
39
- // Convienence object that sends a command to the view object, and
40
- // returns a promise that is resolved when the change is rendered
41
- const t = ((action, repetition) => {
42
- return view.waitableAction(action, repetition);
43
- });
44
- // render the initial score (1 empty measure)
45
- await renderer.renderPromise();
46
- await view.changeScore(score);
47
- await renderer.renderPromise();
48
- await view.growSelectionRight();
49
-
50
- // Select 1st 2 quarters and make them into 16ths by 1/2 their duration twice
51
- await view.batchDurationOperation('halveDuration');
52
- await view.batchDurationOperation('halveDuration');
53
- await view.moveSelectionLeft();
54
- await view.moveSelectionRight();
55
-
56
- // Set some pitches. Auto-advance moves the cursor to the left
57
- // SmoScore.preferences can toggle auto-advance and auto-play
58
- // setPitch sets the key-appropriate note for the given letter.
59
- await view.setPitchesPromise('cdefdec');
60
-
61
- // Set the notes we just made down the octave by selecting them
62
- // Transpose works relative to the pitch and does not auto-advance
63
- await view.moveSelectionLeft();
64
- // same as await view.growSelectionLeft() 6 times...
65
- await t(() => view.growSelectionLeft(), 6);
66
- await view.transposeSelections(-12);
67
-
68
- // Create 4 1/8 note at end
69
- await view.moveSelectionRight();
70
- await view.growSelectionRight();
71
- await view.batchDurationOperation('halveDuration');
72
- await view.moveSelectionLeft();
73
- await view.moveSelectionRight();
74
- await view.setPitchesPromise('gcbc');
75
-
76
- await view.moveSelectionLeft();
77
- // Add a turn on the next tick
78
- await view.toggleArticulation('mordent_inverted', 'SmoOrnament');
79
- await view.moveSelectionRight();
80
-
81
- // Beam the 8th notes and the 16th notes
82
- await t(() => view.growSelectionLeft(), 3);
83
- await view.transposeSelections(12);
84
- await view.beamSelections();
85
- await view.moveSelectionLeft();
86
- await t(() => view.growSelectionLeft(), 3);
87
- await view.beamSelections();
88
-
89
- // Add measure after this one
90
- await view.addMeasure(true);
91
- await t(() => view.moveSelectionRight(), 5);
92
- await view.growSelectionRight();
93
- await t(() => view.batchDurationOperation('halveDuration'), 2);
94
- await view.moveSelectionLeft();
95
- await view.moveSelectionRight();
96
- await view.moveSelectionLeft();
97
- await view.moveSelectionRight();
98
- await view.setPitchesPromise('dgabcabg');
99
- await view.growSelectionRight();
100
- await view.batchDurationOperation('halveDuration');
101
- await view.moveSelectionLeft();
102
- await view.moveSelectionRight();
103
- await view.setPitchesPromise('dgfg');
104
-
105
- await view.moveSelectionLeft();
106
- // Add a turn on the next tick
107
- await view.toggleArticulation('mordent_inverted', 'SmoOrnament');
108
- await view.moveSelectionRight();
109
- await t(() => view.growSelectionLeft(), 3);
110
- await t(() => view.beamSelections());
111
- await view.moveSelectionLeft();
112
- await t(() => view.growSelectionLeft(), 6);
113
- await view.transposeSelections(-12);
114
- await view.moveSelectionLeftMeasure();
115
-
116
- // Add the bass cleff staff. It automatically adds
117
- // all the measures
118
- await view.addStaffSimple({
119
- "instrumentName": "Bass Clef Staff",
120
- "keyOffset": 0,
121
- "clef": "bass"
122
-
123
- });
124
- await view.moveSelectionDown();
125
- await view.batchDurationOperation('doubleDuration');
126
- await view.moveSelectionRight();
127
- await view.growSelectionRight();
128
- await t(() => view.batchDurationOperation('halveDuration'), 2);
129
- await view.moveSelectionLeft();
130
- await t(() => view.moveSelectionRight(), 2);
131
- await view.setPitchesPromise('cdefdec');
132
- await view.moveSelectionLeft();
133
- await t(() => view.growSelectionLeft(), 3);
134
- await view.beamSelections();
135
- await view.moveSelectionRight();
136
- await view.batchDurationOperation('halveDuration');
137
- await view.setPitchesPromise('g');
138
- await t(() => view.moveSelectionLeft(), 3);
139
- await view.transposeSelections(12);
140
- await view.moveSelectionRight();
141
- await view.toggleArticulation('staccato','SmoArticulation');
142
- // select notes to slur
143
- await view.growSelectionLeft();
144
- // slur applies to selection
145
- await view.slur();
146
-
147
- await t(() => view.moveSelectionRight(), 2);
148
- await t(() => view.growSelectionRight(), 2);
149
- await t(() => view.batchDurationOperation('halveDuration'), 2);
150
- await view.moveSelectionLeft();
151
- await t(() => view.moveSelectionRight(), 2);
152
- await view.setPitchesPromise('gabcabg');
153
- await t(() => view.growSelectionLeft(), 3);
154
- await view.beamSelections();
155
-
156
- // Add measure after this one. Both staffs get the new measure
157
- // and it is populated with rests
158
- await view.addMeasure(true);
159
- await view.moveSelectionUp();
160
- await view.moveSelectionRightMeasure();
161
- await t(() => view.growSelectionRight(), 3);
162
- await t(() => view.batchDurationOperation('halveDuration'), 2);
163
- await view.moveSelectionLeft();
164
- await view.moveSelectionRight();
165
- await view.setPitchesPromise('eagfegfagfedcedf');
166
- await view.moveSelectionDown();
167
- await t(() => view.growSelectionRight(), 3);
168
- await view.batchDurationOperation('halveDuration');
169
- await view.moveSelectionLeft();
170
- await view.moveSelectionRight();
171
- await view.setPitchesPromise('cbcdegab');
172
- await t(() => view.growSelectionLeft(), 3);
173
- await view.beamSelections();
174
-
175
- await view.moveSelectionLeft();
176
- await t(() => view.growSelectionLeft(), 3);
177
- await view.beamSelections();
178
- await view.moveSelectionRight();
179
- await t(() => view.growSelectionLeft(), 3);
180
- await view.slur();
181
- await view.moveSelectionRight();
182
- await t(() => view.growSelectionRight(), 2);
183
- await view.slur();
184
- await view.transposeSelections(-12);
185
-
186
- // It's starting to get kind of crowded. Set the svgScale to 60%
187
- // to make the notes smaller.
188
- await view.setGlobalLayout({
189
- "leftMargin": 30,
190
- "rightMargin": 30,
191
- "topMargin": 40,
192
- "bottomMargin": 40,
193
- "pageWidth": 816,
194
- "pageHeight": 1056,
195
- "orientation": 0,
196
- "interGap": 30,
197
- "intraGap": 10,
198
- "svgScale": 0.6,
199
- "zoomScale": 2.1,
200
- "zoomMode": 0,
201
- "noteSpacing": 1,
202
- "pages": 1
203
- });
204
-
205
- };
206
- Smo.SuiApplication.configure({
207
- mode: 'library',
208
- idleRedrawTime: 1,
209
- demonPollTime: 1,
210
- initialScore: Smo.emptyScoreJson,
211
- scoreDomContainer: 'outer-container',
212
- }).then((application) => {
213
- app(Smo, application);
214
- });
215
- });
216
- </script>
217
- </head>
218
- <body>
219
- <sub id="link-hdr"><a href="https://github.com/AaronDavidNewman/smoosic">Github site</a> |
220
- <a href="https://aarondavidnewman.github.io/Smoosic/release/docs/modules.html">source documentation</a> |
221
- <a href="https://aarondavidnewman.github.io/Smoosic/changes.html">change notes</a> |
222
- <a href="https://aarondavidnewman.github.io/Smoosic/release/html/smoosic.html">application</a><button class="close-header"><span class="icon icon-cross"></span></button></sub>
223
- <!-- audio crossOrigin="anonymous" id="sample" src="https://aarondavidnewman.github.io/Smoosic/build/sound/piano_middle_C.mp3" / -->
224
- <div id="outer-container" style="overflow:auto">
225
- <div id="container1">
226
-
227
- </div>
228
- </div>
229
- </body>
230
- </html>