Skip to content

Commit

Permalink
* New: Writing of samples can now be cancelled as well.
Browse files Browse the repository at this point in the history
* Fixed: Logger text is now cleared regularily to prevent a crash. To have the log still available, all messages are now logged into a file ConvertWithMoss.log which is created in the output directory.
* Kontakt
  * Fixed: Regression: Reading Kontakt 5-7 file lists were broken.
  * Fixed: NCW files are now only read when needed for writing and the memory is freed up directly afterwards to support NKIs which reference a very large amounts of NCW files.
* Korg KMP
  * New: KSF files which reference another KSF file are now read properly.
  * New: Reading: Applied +12dB option.
  * New: KMP/KSF files which contain SKIPPEDSAMPLE as a filename are now ignored (conversion was canceled previously).
* Sample Files
  * New: Notify about the number of sample files found in a folder before the mapping starts.
  • Loading branch information
git-moss committed Jan 3, 2025
1 parent 116ea53 commit 5696019
Show file tree
Hide file tree
Showing 39 changed files with 962 additions and 152 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changes

## 11.7.0

* New: Writing of samples can now be cancelled as well.
* Fixed: Logger text is now cleared regularily to prevent a crash. To have the log still available, all messages are now logged into a file ConvertWithMoss.log which is created in the output directory.
* Kontakt
* Fixed: Regression: Reading Kontakt 5-7 file lists were broken.
* Fixed: NCW files are now only read when needed for writing and the memory is freed up directly afterwards to support NKIs which reference a very large amounts of NCW files.
* Korg KMP
* New: KSF files which reference another KSF file are now read properly.
* New: Reading: Applied +12dB option.
* New: KMP/KSF files which contain SKIPPEDSAMPLE as a filename are now ignored (conversion was canceled previously).
* Sample Files
* New: Notify about the number of sample files found in a folder before the mapping starts.

## 11.6.0

* EXS24
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
972610b7530023e1a5b75b8e6b46fe6a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
677ce031293c57c3229b55c17ad498490d7251a2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>de.mossgrabers</groupId>
<packaging>jar</packaging>
<name>UiTools</name>
<version>1.5.2</version>
<version>1.5.3</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -32,15 +32,10 @@
<artifactId>javafx-web</artifactId>
<version>23.0.1</version>
</dependency>
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>0.11.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.3</version>
<version>5.11.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f9aa23a4bdeb813432459f86bcdedadc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2ebe38dea9dd275dacf8d264cab4fecb9474fd6b
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<groupId>de.mossgrabers</groupId>
<artifactId>uitools</artifactId>
<versioning>
<release>1.5.2</release>
<release>1.5.3</release>
<versions>
<version>1.5.2</version>
<version>1.5.3</version>
</versions>
<lastUpdated>20241118164256</lastUpdated>
<lastUpdated>20250103142649</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ad0ddfd3b1da31526f04a4f60f100e6e
99fe126702a5f194ca99e9925f671db9
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5bf395d679ed1decc83d2c358543f9ee768a839f
a981d4efab038fc6a085c8a661aa0a2098d032e1
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.mossgrabers</groupId>
<artifactId>convertwithmoss</artifactId>
<version>11.6.0</version>
<version>11.7.0</version>
<packaging>jar</packaging>
<name>ConvertWithMoss</name>
<organization>
Expand Down Expand Up @@ -49,7 +49,7 @@
<dependency>
<artifactId>uitools</artifactId>
<groupId>de.mossgrabers</groupId>
<version>1.5.2</version>
<version>1.5.3</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ public void shutdown ()
}


/** {@inheritDoc} */
@Override
public void cancel ()
protected void notifyProgress ()
{
// Intentionally empty
this.notifier.log ("IDS_NOTIFY_PROGRESS");
}


protected void notifyNewline ()
{
this.notifier.log ("IDS_NOTIFY_LINE_FEED");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public abstract class AbstractCreator extends AbstractCoreTask implements ICreat
private boolean updateSampleChunk = false;
private boolean removeJunkChunks = false;

protected boolean isCancelled = false;

// Combine into library options
protected CheckBox combineIntoOneLibrary = null;
protected TextField combinationFilename = null;
Expand Down Expand Up @@ -126,6 +128,22 @@ public boolean wantsMultipleFiles ()
}


/** {@inheritDoc} */
@Override
public void cancel ()
{
this.isCancelled = true;
}


/** {@inheritDoc} */
@Override
public void clearCancelled ()
{
this.isCancelled = false;
}


/**
* Add the UI elements for the combination of several multi-sample source into 1 library.
*
Expand Down Expand Up @@ -579,6 +597,9 @@ protected List<File> writeSamples (final File sampleFolder, final IMultisampleSo
final List<ISampleZone> sampleZones = group.getSampleZones ();
for (int zoneIndex = 0; zoneIndex < sampleZones.size (); zoneIndex++)
{
if (this.isCancelled)
return writtenFiles;

final ISampleZone zone = sampleZones.get (zoneIndex);

final File file = new File (sampleFolder, this.createSampleFilename (zone, zoneIndex, fileEnding));
Expand Down Expand Up @@ -644,6 +665,9 @@ protected List<File> writeSamples (final File sampleFolder, final IMultisampleSo
final List<ISampleZone> sampleZones = group.getSampleZones ();
for (int zoneIndex = 0; zoneIndex < sampleZones.size (); zoneIndex++)
{
if (this.isCancelled)
return writtenFiles;

final ISampleZone zone = sampleZones.get (zoneIndex);

final File file = new File (sampleFolder, this.createSampleFilename (zone, zoneIndex, extension));
Expand Down Expand Up @@ -929,18 +953,6 @@ private static void putUncompressedEntry (final ZipOutputStream zipOutputStream,
}


private void notifyProgress ()
{
this.notifier.log ("IDS_NOTIFY_PROGRESS");
}


private void notifyNewline ()
{
this.notifier.log ("IDS_NOTIFY_LINE_FEED");
}


/**
* Adds options add or update certain WAV chunks.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ public interface ICreator extends ICoreTask
* @return Returns true if the creator wants to combine several files
*/
boolean wantsMultipleFiles ();


/**
* Clears the cancelled state. Call before each run.
*/
void clearCancelled ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected Boolean call () throws Exception


/**
* Wait a bit.
* Check for task cancellation.
*
* @return The thread was cancelled if true
*/
Expand Down Expand Up @@ -636,4 +636,16 @@ private File findSampleFileRecursively (final File folder, final String fileName

return null;
}


protected void notifyProgress ()
{
this.notifier.log ("IDS_NOTIFY_PROGRESS");
}


protected void notifyNewline ()
{
this.notifier.log ("IDS_NOTIFY_LINE_FEED");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public void setVelocityCrossfadeHigh (final int crossfadeHigh)
@Override
public void setGain (final double gain)
{
this.gain = Math.clamp (gain, -12.0, 12.0);
this.gain = Math.clamp (gain, 0.125, 24.0);
}


Expand Down
32 changes: 32 additions & 0 deletions src/main/java/de/mossgrabers/convertwithmoss/file/StreamUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,38 @@ public static void padBytes (final OutputStream out, final int numBytes, final i
}


/**
* Reads a certain number of bytes from the input stream. The number of bytes is determined from
* the first 4 bytes (32-bit value).
*
* @param in The input stream to read from
* @param isBigEndian True if bytes are stored big-endian otherwise little-endian
* @return The data block without the size bytes
* @throws IOException Could not read
*/
public static byte [] readDataBlock (final InputStream in, final boolean isBigEndian) throws IOException
{
final int size = (int) StreamUtils.readUnsigned32 (in, isBigEndian);
return in.readNBytes (size);
}


/**
* Reads a certain number of bytes from the input stream. The number of bytes is determined from
* the first 4 bytes (32-bit value).
*
* @param out The output stream to write to
* @param data The data block without the size bytes
* @param isBigEndian True if bytes are stored big-endian otherwise little-endian
* @throws IOException Could not read
*/
public static void writeDataBlock (final OutputStream out, final byte [] data, final boolean isBigEndian) throws IOException
{
StreamUtils.writeUnsigned32 (out, data.length, isBigEndian);
out.write (data);
}


/**
* Skip exactly N bytes.
*
Expand Down
Loading

0 comments on commit 5696019

Please sign in to comment.