Skip to content

Conversation

SpruceCloud
Copy link

The change creates files that can be imported by Yamaha MOXF.

Not the cleanest code. I tried to shoehorn the changes to appropriate places and to not change too much of the code.

Copy link
Author

@SpruceCloud SpruceCloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments for the code.

Feel free to modify what is necessary.

@@ -0,0 +1,37 @@
package de.mossgrabers.convertwithmoss.format.yamaha.ysfc;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To not pollute the main code with changes to this block, the entry for the section was subclassed.

Not an ideal solution from theoretical point of view, but works.

@@ -0,0 +1,45 @@
package de.mossgrabers.convertwithmoss.format.yamaha.ysfc;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: To not pollute the main code with changes to this block, the entry for the section was subclassed.

Not an ideal solution from theoretical point of view, but works.

if (!outputFormat.equals(OutputFormat.MOXF_LIBRARY)) {
ysfcFile = YsfcFile.withChunks ("EWFM", "DWFM", "EWIM", "DWIM");
} else {
ysfcFile = YsfcFile.withChunks ("EWFM", "DWFM", "EWIM", "DWIM", "EARP", "DARP", "EVCE", "DVCE");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure if the chunks in X3A file can be skipped, so added all of them and left them empty.

for (int channel = 0; channel < numberOfChannels; channel++)
{
keybankList.add (createKeybank (sampleNumber, zone, formatChunk, numSamples));
keybankList.add(createKeybank(moxfData, sampleNumber, zone, formatChunk, numSamples));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at this change.

To my understanding, the keygroup in MOXF can contain stereo files.

for (int channel = 0; channel < numberOfChannels; channel++) {
final YamahaYsfcWaveData waveData = new YamahaYsfcWaveData();
waveDataList.add(waveData);
waveData.setData(isStereo ? getChannelData(channel, data) : data);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review closely as well. Not sure if this handles stereo files correctly. On my testing material, it seems to sound okay (definitely not missing a channel).

n = categoryID.toString () + ":" + n;
}
keyBankEntry.setItemName (n);
if (outputFormat.equals(OutputFormat.MOXF_LIBRARY)) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Item titles need to be present for MOXF.

final double panorama = zone.getPanorama ();
keybank.setPanorama ((int) (panorama < 0 ? panorama * 64 : panorama * 63));
}
// if (numberOfChannels == 1)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review closely. I hope this should work for stereo samples as well. Hopefully for Montage as well.

private int correspondingDataOffset = 0;
private int specificValue = 0;
private int entryID = 0xFFFFFFFF;
protected int length;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the fields to protected in order to subclass this class for MOXF-specific entries.

The other approach would be making this entry class aware if it is for MOXF or not. Subclassing seemed to introduce less changes to the code.

@git-moss
Copy link
Owner

Sorry for the long silence. I have now a bit of time to look into this. Could you be so kind and adapt it to the current source code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants