-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathlogoconstants.js
More file actions
90 lines (82 loc) · 2.67 KB
/
logoconstants.js
File metadata and controls
90 lines (82 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
global
_
*/
/*
exported
DEFAULTVOLUME, PREVIEWVOLUME, DEFAULTDELAY,
OSCVOLUMEADJUSTMENT, TONEBPM, TARGETBPM, TURTLESTEP, NOTEDIV,
MIN_HIGHLIGHT_DURATION_MS,
NOMICERRORMSG, NANERRORMSG, NOSTRINGERRORMSG, NOBOXERRORMSG,
NOACTIONERRORMSG, NOINPUTERRORMSG, NOSQRTERRORMSG,
ZERODIVIDEERRORMSG, EMPTYHEAPERRORMSG, INVALIDPITCH, POSNUMBER,
NOTATIONNOTE, NOTATIONDURATION, NOTATIONDOTCOUNT,
NOTATIONTUPLETVALUE, NOTATIONROUNDDOWN, NOTATIONINSIDECHORD,
NOTATIONSTACCATO
*/
const DEFAULTVOLUME = 50;
const PREVIEWVOLUME = 80;
const DEFAULTDELAY = 500; // milliseconds
// The oscillator runs hot. We must scale back its volume.
const OSCVOLUMEADJUSTMENT = 1.5;
const TONEBPM = 240; // seems to be the default
const TARGETBPM = 90; // what we'd like to use for beats per minute
const TURTLESTEP = -1; // run in step-by-step mode
const NOTEDIV = 8; // number of steps to divide turtle graphics
/** Minimum time (ms) to keep a block highlighted during execution so users can see which block is active. */
const MIN_HIGHLIGHT_DURATION_MS = 400;
// These error messages don't need translation since they are
// converted into artwork w/o text.
const NOMICERRORMSG = "The microphone is not available.";
const NANERRORMSG = "Not a number.";
const NOSTRINGERRORMSG = "Not a string.";
const NOBOXERRORMSG = "Cannot find box";
const NOACTIONERRORMSG = "Cannot find action.";
const NOINPUTERRORMSG = "Missing argument.";
const NOSQRTERRORMSG = "Cannot take square root of negative number.";
const ZERODIVIDEERRORMSG = "Cannot divide by zero.";
const EMPTYHEAPERRORMSG = "empty heap.";
const POSNUMBER = "Argument must be a positive number";
// NOTE: _() must be available globaly (shimmed or loaded)
const INVALIDPITCH = _("Not a valid pitch name");
const NOTATIONNOTE = 0;
const NOTATIONDURATION = 1;
const NOTATIONDOTCOUNT = 2;
const NOTATIONTUPLETVALUE = 3;
const NOTATIONROUNDDOWN = 4;
const NOTATIONINSIDECHORD = 5; // deprecated
const NOTATIONSTACCATO = 6;
const exportsObj = {
DEFAULTVOLUME,
PREVIEWVOLUME,
DEFAULTDELAY,
OSCVOLUMEADJUSTMENT,
TONEBPM,
TARGETBPM,
TURTLESTEP,
NOTEDIV,
MIN_HIGHLIGHT_DURATION_MS,
NOMICERRORMSG,
NANERRORMSG,
NOSTRINGERRORMSG,
NOBOXERRORMSG,
NOACTIONERRORMSG,
NOINPUTERRORMSG,
NOSQRTERRORMSG,
ZERODIVIDEERRORMSG,
EMPTYHEAPERRORMSG,
POSNUMBER,
INVALIDPITCH,
NOTATIONNOTE,
NOTATIONDURATION,
NOTATIONDOTCOUNT,
NOTATIONTUPLETVALUE,
NOTATIONROUNDDOWN,
NOTATIONINSIDECHORD,
NOTATIONSTACCATO
};
if (typeof module !== "undefined" && module.exports) {
module.exports = exportsObj;
} else if (typeof window !== "undefined") {
Object.assign(window, exportsObj);
}