Skip to content

Commit

Permalink
Merge pull request #37 from jamiefaye/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jamiefaye authored Sep 17, 2019
2 parents d207ddc + 0a552e0 commit 0816c93
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
14 changes: 13 additions & 1 deletion xmlView/src/Arranger.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class Instrument extends React.Component {
componentDidMount() {
let inst = this.props.inst;
let instString = inst.trackInstances;
if (!instString) {
instString = inst.clipInstances;
}
if (!instString) return;
let ypos = 2;

Expand Down Expand Up @@ -135,14 +138,23 @@ function showArranger(song, newSynthNames, where) {

function bumpTracks(instrumentEntry) {
let instString = instrumentEntry.trackInstances;
let usingClip = false;
if (!instString) {
instString = instrumentEntry.clipInstances;
usingClip = true;
}
if (!instString) return;
for (var nx = 2; nx < instString.length; nx += 24) {
let trk = parseInt(instString.substring(nx + 16, nx + 24), 16);
trk+= 0x100000001; // Includes hack to gen leading zeros.
let bumphex = trk.toString(16).substring(1).toUpperCase();
instString = instString.substring(0, nx + 16) + bumphex + instString.substring(nx + 24);
}
instrumentEntry.trackInstances = instString;
if (usingClip) {
instrumentEntry.clipInstances = instString;
} else {
instrumentEntry.trackInstances = instString;
}
}


Expand Down
2 changes: 1 addition & 1 deletion xmlView/src/KitList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class KitList extends React.Component {
let suggestion = suggestName(name);
let temp = empty_sound_temp.split('{{fileName}}');
let temp2 = temp.join(name);
let temp3 = temp.split('{{name}}');
let temp3 = temp2.split('{{name}}');
let filledSoundT = temp3.join(suggestion);
let newDrumX = getXmlDOMFromString(filledSoundT);
let newSound = xmlToJson(newDrumX).sound;
Expand Down
6 changes: 5 additions & 1 deletion xmlView/src/SongViewLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,15 @@ function addTrackToSong(pastedIn, songDoc) {
let ko = findKitInstrument(track0, song.instruments);
if (!ko) {
delete track0.kit.trackInstances;
delete track0.kit.clipInstances;
song.instruments.unshift(track0.kit);
}
delete track0.kit;
} else if (tKind === 'sound') {
let so = findSoundInstrument(track0, song.instruments);
if (!so) {
delete track0.sound.trackInstances;
delete track0.sound.clipInstances;
song.instruments.unshift(track0.sound);
}
delete track0.sound;
Expand Down Expand Up @@ -405,7 +407,7 @@ function getTrackText(trackJ, songJ)
if (trackJ.instrument && trackJ.instrument.referToTrackId !== undefined) {
let fromID = Number(trackJ.instrument.referToTrackId);
delete trackD.instrument; // zonk reference
let trackA = forceArray(songJ.tracks.track);
let trackA = forceArray(song.tracks.track);
let sourceT = trackA[fromID];
// patch in data from source (depending on what type).
let kind = trackKind(sourceT);
Expand All @@ -428,6 +430,7 @@ function getTrackText(trackJ, songJ)
} else {
let kd = new Kit(kitI);
delete kd.trackInstances;
delete kd.clioInstances;
trackD['kit'] = kd;

}
Expand All @@ -440,6 +443,7 @@ function getTrackText(trackJ, songJ)
} else {
let sd = new Sound(soundI);
delete sd.trackInstances;
delete sd.clipInstances;
trackD['sound'] = sd;
}
}
Expand Down
4 changes: 0 additions & 4 deletions xmlView/src/js/plugins/wavesurfer.tiledrenderer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions xmlView/src/keyOrderTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@
"presetSlot",
"presetSubSlot",
"trackInstances",
"clipInstances",
"soundSources",
"selectedDrumIndex",
],
"sound": ["presetSlot",
"presetSubSlot",
"trackInstances",
"clipInstances",
"name",
"osc1",
"osc2",
Expand Down

0 comments on commit 0816c93

Please sign in to comment.