Skip to content
Open
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
24 changes: 24 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 21
- name: Build with Maven
run: mvn -B package --file MpcMaid/pom.xml
17 changes: 17 additions & 0 deletions .github/workflows/mavenpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 21
- name: Publish package
run: mvn -B deploy --file MpcMaid/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
.settings
16 changes: 8 additions & 8 deletions MpcMaid/FileAndTextTransferHandler.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* @See http://www.davidgrant.ca/drag_drop_from_linux_kde_gnome_file_managers_konqueror_nautilus_to_java_applications
*
* @See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4899516
Expand All @@ -21,7 +21,7 @@ public FileAndTextTransferHandler() {
try {
uriListFlavor = new DataFlavor(URI_LIST_MIME_TYPE);
} catch (ClassNotFoundException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}
}

Expand All @@ -33,7 +33,7 @@ public FileAndTextTransferHandler(Utilisateur u) {
try {
uriListFlavor = new DataFlavor(URI_LIST_MIME_TYPE);
} catch (ClassNotFoundException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}

this.user = u;
Expand Down Expand Up @@ -71,14 +71,14 @@ public boolean importData(JComponent c, Transferable t) {

String str = ((String) t.getTransferData(stringFlavor));

System.out.println(str);
logger.log(Level.INFO, str);

return true;
}
} catch (UnsupportedFlavorException ufe) {
System.out.println("importData: unsupported data flavor");
logger.log(Level.ERROR, "importData: unsupported data flavor", ufe);
} catch (IOException ieo) {
System.out.println("importData: I/O exception");
logger.log(Level.ERROR, "importData: I/O exception", ieo);
}
return false;
}
Expand Down Expand Up @@ -140,9 +140,9 @@ private static List<File> textURIListToFileList(String data) {
File file = new File(uri);
list.add(file);
} catch (URISyntaxException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
} catch (IllegalArgumentException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}
}
return list;
Expand Down
2 changes: 1 addition & 1 deletion MpcMaid/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Basic Operations:
Advanced Features:
Slicing tool: Drag and drop your loop file (no longer than 2 bars) to have it chopped into slices based on a beat detection mechanism. Then directly export the chopped slices as multiple .WAV files, one corresponding .PGM program file and one MIDI groove .MID file.
Multisample Creation: On drag and drop of .wav files with a consistent naming (that includes the note name, e-g "C#3", "E5" or "D 4"), you can automatically create Multisample program: MPC Maid calculates the allocation of the samples across pads and the tuning of each pad to reconstitute a complete chromatic scale.
Batch Create Program: Automatically creates a program (.pgm) that lists every .wav sample in each directory and sub-directory, recursively from a given base directory. This allows for instant conversion of any .wav sound library into an MPC-readable library.
Batch Create Program: Automatically creates a program (.pgm) that lists every .wav sample in each directory and subdirectory, recursively from a given base directory. This allows for instant conversion of any .wav sound library into an MPC-readable library.
Copy Settings to All Pads: You want to quickly change parameters for every pad? Set your parameters on one pad, then copy them to every other pad, except of course the sample name, tuning and midi note.


Expand Down
12 changes: 6 additions & 6 deletions MpcMaid/TestDragDropLinux.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ private static List textURIListToFileList(String data) {
File file = new File(uri);
list.add(file);
} catch (URISyntaxException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
} catch (IllegalArgumentException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}
}
return list;
Expand Down Expand Up @@ -78,7 +78,7 @@ public void drop(DropTargetDropEvent event) {
try {
uriListFlavor = new DataFlavor(URI_LIST_MIME_TYPE);
} catch (ClassNotFoundException e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}

try {
Expand All @@ -88,17 +88,17 @@ public void drop(DropTargetDropEvent event) {
for (Object o : data) {
model.addElement(o);
}
System.out.println(data);
logger.log(Level.INFO, data);
} else if (transferable.isDataFlavorSupported(uriListFlavor)) {
String data = (String) transferable.getTransferData(uriListFlavor);
List files = textURIListToFileList(data);
for (Object o : files) {
model.addElement(o);
}
System.out.println(files);
logger.log(Level.INFO, files);
}
} catch (Exception e) {
e.printStackTrace();
logger.log(Level.ERROR, e, e::getMessage);
}

setModel(model);
Expand Down
6 changes: 3 additions & 3 deletions MpcMaid/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Tested on windows
Tested on Microsoft Windows
Automatic assign of samples to pads/sample layers
Improved validation (focus + beep)
Added preferences (MPC500/1000, audition mode)
Expand All @@ -7,12 +7,12 @@ Replaced audio player with a more stable one (sometime crashes when heavily stim
Added automated support for multisamples
Fixed frame height difference between first window and other windows
Added Edit/Remove all samples
Renamed Options to Preferences for non Mac OS platforms
Renamed Options to Preferences for non macOS platforms
Added splash screen and about dialog
Fixed bug one file name on export slices pgm
Fixed tuning reading error
Added protection for multisamples notes that are out of pads range (below B0 or above D6); samples with no note in their name, or outside of this range are not imported
Added Batch Create Program feature, to create default listing programs in each directory and sub-directory from a given base directory.
Added Batch Create Program feature, to create default listing programs in each directory and subdirectory from a given base directory.
Listing program created by Batch Create Program now have a name based on the directory name, shortened to 14 chars plus the page number in case we need more than 1 page to store every sample.
Fixed bug in set sample name (programmatically write)
Fixed bug on Export: files longer than 16 chars with the extensions were shortened incorrectly, hence would not be played by the program
Expand Down
Binary file removed MpcMaid/mpcmaid_beta.jar
Binary file not shown.
185 changes: 185 additions & 0 deletions MpcMaid/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mpcmaid</groupId>
<artifactId>mpcmaid</artifactId>
<version>1.0-RC1</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/malkav30/mpcmaid</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.10</version>
</dependency>
<dependency>
<groupId>com.github.ngeor</groupId>
<artifactId>checkstyle-rules</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>
<configuration>
<configLocation>com/github/ngeor/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>

<!--
You can run jacoco in the default profile with:
mvn jacoco:prepare-agent test jacoco:report
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.mpcmaid.MPCMaid</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>com/github/ngeor/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
</plugin>
</plugins>
</reporting>

<profiles>
<!--
This profile enables jacoco when unit tests are run.
You can run it with mvn -P jacoco test.
It also activates itself on Travis.
-->
<profile>
<id>jacoco</id>
<activation>
<property>
<name>env.TRAVIS</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<phase>validate</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!--
For the Travis profile:
- we want to break the build on any checkstyle violation.
- we want to be able to publish coverage report to coveralls.
-->
<profile>
<id>travis</id>
<activation>
<property>
<name>env.TRAVIS</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>checkstyle</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
35 changes: 0 additions & 35 deletions MpcMaid/src/com/mpcmaid/audio/LocationRange.java

This file was deleted.

Loading