-
Notifications
You must be signed in to change notification settings - Fork 22
Adding support for Yamaha MOXF - X3A files #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
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? |
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.