Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions js/js-export/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ class JSInterface {
const instruments = [
"piano",
"harmonuium",
"mandolin",
"violin",
"viola",
"cello",
Expand Down
1 change: 1 addition & 0 deletions js/utils/musicutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ const SELECTORSTRINGS = [
_("guitar"),
_("sitar"),
_("harmoiunm"),
_("mandolin"),
_("acoustic guitar"),
_("flute"),
_("clarinet"),
Expand Down
25 changes: 22 additions & 3 deletions js/utils/synthutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ const VOICENAMES = [
[_("sitar"), "sitar", "images/synth.svg", "string"],
//.TRANS: harmonium musical instrument
[_("harmonium"), "harmonium", "images/voices.svg", "string"],
//.TRANS: mandolin musical instrument
[_("mandolin"), "mandolin", "images/voices.svg", "string"],
//.TRANS: musical instrument
[_("guitar"), "guitar", "images/voices.svg", "string"],
//.TRANS: musical instrument
Expand Down Expand Up @@ -270,7 +272,8 @@ const SOUNDSAMPLESDEFINES = [
"samples/trombone",
"samples/doublebass",
"samples/sitar",
"samples/harmonium"
"samples/harmonium",
"samples/mandolin"
];

// Some samples have a default volume other than 50 (See #1697)
Expand Down Expand Up @@ -308,7 +311,8 @@ const DEFAULTSYNTHVOLUME = {
"xylophone": 100,
"japanese drum": 90,
"sitar": 100,
"harmonium": 100
"harmonium": 100,
"mandolin": 100,
};

/**
Expand Down Expand Up @@ -345,6 +349,15 @@ const SAMPLECENTERNO = {
"harmonium": ["C4", 39] // pitchToNumber('C', 4, 'C Major')]
};

/**
* The sample has multiple pitch which is subsequently transposed.
* This object defines the starting pitch for different samples.
* @constant
* @type {Object.<string, Array<string>>}
*/
const MULTIPITCH = {
"mandolin": ["A4", "A5", "A6"]
};

/**
* Array to store custom samples.
Expand Down Expand Up @@ -839,7 +852,8 @@ function Synth() {
{ name: "vibraphone", data: VIBRAPHONE_SAMPLE },
{ name: "xylophone", data: XYLOPHONE_SAMPLE },
{ name: "sitar", data: SITAR_SAMPLE },
{ name: "harmonium", data: HARMONIUM_SAMPLE }
{ name: "harmonium", data: HARMONIUM_SAMPLE },
{ name: "mandolin", data: MANDOLIN_SAMPLE }
],
drum: [
{ name: "bottle", data: BOTTLE_SAMPLE },
Expand Down Expand Up @@ -1213,6 +1227,11 @@ function Synth() {
const noteDict = {};
if (sourceName in SAMPLECENTERNO) {
noteDict[SAMPLECENTERNO[sourceName][0]] = this.samples.voice[sourceName];
} else if (sourceName in MULTIPITCH) {
for (let i = 0; i < MULTIPITCH[sourceName].length; i++) {
noteDict[MULTIPITCH[sourceName][i]] = this.samples.voice[sourceName][i];
}
tempSynth = new Tone.Sampler(noteDict);
} else {
noteDict["C4"] = this.samples.voice[sourceName];
}
Expand Down
8 changes: 8 additions & 0 deletions sounds/samples/mandolin.js

Large diffs are not rendered by default.

Loading