Skip to content

Commit 53e291e

Browse files
authored
Adding SITAR as a new instruments (#4310)
* Adding Sitar as new instrument * Adding Sitar as new instrument
1 parent 46ccbb5 commit 53e291e

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

js/js-export/interface.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ class JSInterface {
523523
"cello",
524524
"bass",
525525
"double bass",
526+
"sitar",
526527
"guitar",
527528
"acoustic guitar",
528529
"flute",

js/utils/musicutils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,7 @@ const SELECTORSTRINGS = [
11091109
_("bass"),
11101110
_("double bass"),
11111111
_("guitar"),
1112+
_("sitar"),
11121113
_("acoustic guitar"),
11131114
_("flute"),
11141115
_("clarinet"),

js/utils/synthutils.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ const VOICENAMES = [
8080
[_("bass"), "bass", "images/voices.svg", "string"],
8181
//.TRANS: viola musical instrument
8282
[_("double bass"), "double bass", "images/voices.svg", "string"],
83+
//.TRANS: sitar musical instrument
84+
[_("sitar"), "sitar", "images/synth.svg", "string"],
8385
//.TRANS: musical instrument
8486
[_("guitar"), "guitar", "images/voices.svg", "string"],
8587
//.TRANS: musical instrument
@@ -264,7 +266,8 @@ const SOUNDSAMPLESDEFINES = [
264266
"samples/viola",
265267
"samples/oboe",
266268
"samples/trombone",
267-
"samples/doublebass" // "samples/japanese_bell",
269+
"samples/doublebass",
270+
"samples/sitar"
268271
];
269272

270273
// Some samples have a default volume other than 50 (See #1697)
@@ -300,7 +303,8 @@ const DEFAULTSYNTHVOLUME = {
300303
"slap": 60,
301304
"vibraphone": 100,
302305
"xylophone": 100,
303-
"japanese drum": 90
306+
"japanese drum": 90,
307+
"sitar": 100
304308
};
305309

306310
/**
@@ -327,12 +331,13 @@ const SAMPLECENTERNO = {
327331
"koto": ["C5", 51], // pitchToNumber('C', 5, 'C Major')],
328332
"dulcimer": ["C4", 39], // pitchToNumber('C', 4, 'C Major')],
329333
"electric guitar": ["C3", 27], // pitchToNumber('C', 3, 'C Major')],
330-
"bassoon": ["D4", 41], // pitchToNumber('C', 5, 'C Major')],
334+
"bassoon": ["D4", 41], // pitchToNumber('D', 4, 'D Major')],
331335
"celeste": ["C3", 27], // pitchToNumber('C', 3, 'C Major')],
332-
"vibraphone": ["C5", 51],
333-
"xylophone": ["C4", 39],
334-
"viola": ["D4", 53],
335-
"double bass": ["C4", 39]
336+
"vibraphone": ["C5", 51], // pitchToNumber('C', 5, 'C Major')],
337+
"xylophone": ["C4", 39], // pitchToNumber('C', 4, 'C Major')],
338+
"viola": ["D4", 53], // pitchToNumber('D', 4, 'D Major')],
339+
"double bass": ["C4", 39], // pitchToNumber('C', 4, 'C Major')],
340+
"sitar": ["C4", 39] // pitchToNumber('C', 4, 'C Major')]
336341
};
337342

338343

@@ -355,7 +360,7 @@ const percussionInstruments = ["koto", "banjo", "dulcimer", "xylophone", "celest
355360
* @constant
356361
* @type {Array<string>}
357362
*/
358-
const stringInstruments = ["piano", "guitar", "acoustic guitar", "electric guitar"];
363+
const stringInstruments = ["piano","sitar", "guitar", "acoustic guitar", "electric guitar"];
359364

360365
/**
361366
* Validates and sets parameters for an instrument.
@@ -828,7 +833,8 @@ function Synth() {
828833
{ name: "bassoon", data: BASSOON_SAMPLE },
829834
{ name: "celeste", data: CELESTE_SAMPLE },
830835
{ name: "vibraphone", data: VIBRAPHONE_SAMPLE },
831-
{ name: "xylophone", data: XYLOPHONE_SAMPLE }
836+
{ name: "xylophone", data: XYLOPHONE_SAMPLE },
837+
{ name: "sitar", data: SITAR_SAMPLE }
832838
],
833839
drum: [
834840
{ name: "bottle", data: BOTTLE_SAMPLE },

sounds/samples/sitar.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)