Skip to content

Commit

Permalink
Merge pull request #57 from matejsemancik/feature/processing4.2-jdk17
Browse files Browse the repository at this point in the history
Processing 4.2 support, JDK 17
  • Loading branch information
matejsemancik committed Apr 14, 2023
2 parents 4b11216 + aa3ef52 commit 8576e25
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .run/PlaygroundApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="PlaygroundApp" type="JetRunConfigurationType" nameIsGenerated="true">
<option name="ALTERNATIVE_JRE_PATH" value="azul-11" />
<option name="ALTERNATIVE_JRE_PATH" value="temurin-17" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="dev.matsem.astral.playground.PlaygroundApp" />
<module name="astral-visuals.playground.main" />
<option name="PROGRAM_PARAMETERS" value="--sketch-path=$PROJECT_DIR$" />
<shortenClasspath name="NONE" />
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-x86_64" />
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-aarch64" />
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
4 changes: 2 additions & 2 deletions .run/VisualsApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="VisualsApp" type="JetRunConfigurationType" nameIsGenerated="true">
<option name="ALTERNATIVE_JRE_PATH" value="azul-11" />
<option name="ALTERNATIVE_JRE_PATH" value="temurin-17" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="dev.matsem.astral.visuals.VisualsApp" />
<module name="astral-visuals.visuals.main" />
<option name="PROGRAM_PARAMETERS" value="--sketch-path=$PROJECT_DIR$" />
<shortenClasspath name="NONE" />
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-x86_64" />
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-aarch64" />
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=11.0.11-zulu
java=17.0.6-tem
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ val processingLibs = listOf(
The Raspberry Pi app can be installed using `./gradlew raspberrypi:installDist` task and zipped using `./gradlew raspberrypi:distZip` task.
See the [Application Plugin](https://docs.gradle.org/current/userguide/application_plugin.html) docs for more info.

### JDK

Project must be built using JDK 17. You can use [SDKMAN!](https://sdkman.io/) with provided `.sdkmanrc` file to use correct JDK version.

## How to run

You can run the project with Gradle `run` task. Be sure to include the `--sketch-path` argument so sketches can properly resolve the data folder containing resources needed by some Sketches.
Expand All @@ -71,10 +75,7 @@ You can run the project with Gradle `run` task. Be sure to include the `--sketch
./gradlew visuals:run --args='--sketch-path=/path/to/project/'
```

There are also IntelliJ Run configurations in `.run` folder which you can use to run the app from IDE. Just be sure to edit their configuration to match your setup.

Note: Due to the fragileness of Processing dependencies (namely JogAmp), the project currently works only with some JDK versions, specifically `11.0.11-zulu`. You can find `.sdkmanrc` file in project folder
that sets up the current SDK for you if you use [SDKMAN!](https://sdkman.io/). (`11.0.12` does not work yet, causing [this](https://github.com/processing/processing4/issues/249) issue).
There are also IntelliJ Run configurations in `.run` folder which you can use to run the app from IDE. Just be sure to edit their configuration to match your setup.

## Remote control
Currently, the project supports 3 remote control options:
Expand Down Expand Up @@ -108,5 +109,15 @@ private var fader1: Float by oscFaderDelegate("/1/fader1", defaultValue = 0.5f)

Most of the delegated properties support value assign, so, if for example you create the fader variable and at some point in time you assign the value into it, the corresponding control in TouchOSC app will reflect that change.

## Known bugs after Processing4 migration
- movie library does not work (issues with linking native libs)
## Troubleshooting

### App crashes on sketches which are using `movie` library

Movie library stopped working after migration to Processing 4. Related issue: [#56](https://github.com/matejsemancik/astral-visuals/issues/56)

### App crashes with `Instance creation error : could not create instance for [Single:'dev.matsem.astral.core.tools.audio.AudioProcessor']`

It's probably one of these things:
- Your system has no audio input devices. Make sure to have at least one audio input device, as it's required by audio processing toolchain.
- Your system has no audio input devices compatible with `minim` library. (Might happen on newer macOS versions). Happens on my M2 Pro Mac. You can use a virtual audio input device to mitigate this.
- If you're on macOS, make sure to grant microphone permissions for your Processing installation. The simplest way to do this is to run some Processing sample from `sound` library. The system will ask you to grant microphone permission.
8 changes: 2 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ repositories {
jcenter()
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
}

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
}

Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/ProjectSettings.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
object ProjectSettings {
const val version = "2.2.0"
const val version = "2.2.1"
const val group = "dev.matsem"
const val jvmTarget = "17"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ internal fun Project.configureCommonDependencies() {
val processingLibsDir = props["processing.libs.jars"]

dependencies {
add("implementation", kotlin("bom"))
add("implementation", kotlin("stdlib-jdk8"))
add("implementation", Dependencies.koin)
add("implementation", Dependencies.coroutines)
add(
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ version = ProjectSettings.version

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
}
4 changes: 2 additions & 2 deletions playground/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ version = ProjectSettings.version

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.matsem.astral.playground

import dev.matsem.astral.core.di.coreModule
import dev.matsem.astral.playground.sketches.Sem008
import dev.matsem.astral.playground.sketches.Blank
import org.koin.core.KoinComponent
import org.koin.core.context.startKoin
import org.koin.core.inject
Expand All @@ -27,7 +27,7 @@ class PlaygroundApp : KoinComponent {
fun run(processingArgs: Array<String>) {
startKoin {
printLogger(Level.ERROR)
modules(coreModule + playgroundModule { Sem008() })
modules(coreModule + playgroundModule { Blank() })
}

PApplet.runSketch(processingArgs + arrayOf("ProcessingPlayground"), sketch)
Expand Down
4 changes: 2 additions & 2 deletions raspberrypi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ version = ProjectSettings.version

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
}

Expand Down
4 changes: 2 additions & 2 deletions visuals/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ version = ProjectSettings.version

tasks {
compileKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
compileTestKotlin {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
}
}

0 comments on commit 8576e25

Please sign in to comment.