Skip to content

Commit 8576e25

Browse files
Merge pull request #57 from matejsemancik/feature/processing4.2-jdk17
Processing 4.2 support, JDK 17
2 parents 4b11216 + aa3ef52 commit 8576e25

File tree

12 files changed

+36
-30
lines changed

12 files changed

+36
-30
lines changed

.run/PlaygroundApp.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="PlaygroundApp" type="JetRunConfigurationType" nameIsGenerated="true">
3-
<option name="ALTERNATIVE_JRE_PATH" value="azul-11" />
3+
<option name="ALTERNATIVE_JRE_PATH" value="temurin-17" />
44
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
55
<option name="MAIN_CLASS_NAME" value="dev.matsem.astral.playground.PlaygroundApp" />
66
<module name="astral-visuals.playground.main" />
77
<option name="PROGRAM_PARAMETERS" value="--sketch-path=$PROJECT_DIR$" />
88
<shortenClasspath name="NONE" />
9-
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-x86_64" />
9+
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-aarch64" />
1010
<method v="2">
1111
<option name="Make" enabled="true" />
1212
</method>

.run/VisualsApp.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="VisualsApp" type="JetRunConfigurationType" nameIsGenerated="true">
3-
<option name="ALTERNATIVE_JRE_PATH" value="azul-11" />
3+
<option name="ALTERNATIVE_JRE_PATH" value="temurin-17" />
44
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
55
<option name="MAIN_CLASS_NAME" value="dev.matsem.astral.visuals.VisualsApp" />
66
<module name="astral-visuals.visuals.main" />
77
<option name="PROGRAM_PARAMETERS" value="--sketch-path=$PROJECT_DIR$" />
88
<shortenClasspath name="NONE" />
9-
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-x86_64" />
9+
<option name="VM_PARAMETERS" value="-Djava.library.path=/Applications/Processing.app/Contents/Java/core/library/macos-aarch64" />
1010
<method v="2">
1111
<option name="Make" enabled="true" />
1212
</method>

.sdkmanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
3-
java=11.0.11-zulu
3+
java=17.0.6-tem

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ val processingLibs = listOf(
6262
The Raspberry Pi app can be installed using `./gradlew raspberrypi:installDist` task and zipped using `./gradlew raspberrypi:distZip` task.
6363
See the [Application Plugin](https://docs.gradle.org/current/userguide/application_plugin.html) docs for more info.
6464

65+
### JDK
66+
67+
Project must be built using JDK 17. You can use [SDKMAN!](https://sdkman.io/) with provided `.sdkmanrc` file to use correct JDK version.
68+
6569
## How to run
6670

6771
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.
@@ -71,10 +75,7 @@ You can run the project with Gradle `run` task. Be sure to include the `--sketch
7175
./gradlew visuals:run --args='--sketch-path=/path/to/project/'
7276
```
7377

74-
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.
75-
76-
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
77-
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).
78+
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.
7879

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

109110
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.
110111

111-
## Known bugs after Processing4 migration
112-
- movie library does not work (issues with linking native libs)
112+
## Troubleshooting
113+
114+
### App crashes on sketches which are using `movie` library
115+
116+
Movie library stopped working after migration to Processing 4. Related issue: [#56](https://github.com/matejsemancik/astral-visuals/issues/56)
117+
118+
### App crashes with `Instance creation error : could not create instance for [Single:'dev.matsem.astral.core.tools.audio.AudioProcessor']`
119+
120+
It's probably one of these things:
121+
- 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.
122+
- 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.
123+
- 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.

build.gradle.kts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ repositories {
1313
jcenter()
1414
}
1515

16-
dependencies {
17-
implementation(kotlin("stdlib-jdk8"))
18-
}
19-
2016
tasks {
2117
compileKotlin {
22-
kotlinOptions.jvmTarget = "11"
18+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
2319
}
2420
compileTestKotlin {
25-
kotlinOptions.jvmTarget = "11"
21+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
2622
}
2723
}
2824

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
object ProjectSettings {
2-
const val version = "2.2.0"
2+
const val version = "2.2.1"
33
const val group = "dev.matsem"
4+
const val jvmTarget = "17"
45
}

buildSrc/src/main/kotlin/dev/matsem/astral/CommonDependencies.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ internal fun Project.configureCommonDependencies() {
2121
val processingLibsDir = props["processing.libs.jars"]
2222

2323
dependencies {
24-
add("implementation", kotlin("bom"))
25-
add("implementation", kotlin("stdlib-jdk8"))
2624
add("implementation", Dependencies.koin)
2725
add("implementation", Dependencies.coroutines)
2826
add(

core/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ version = ProjectSettings.version
1919

2020
tasks {
2121
compileKotlin {
22-
kotlinOptions.jvmTarget = "11"
22+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
2323
}
2424
compileTestKotlin {
25-
kotlinOptions.jvmTarget = "11"
25+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
2626
}
2727
}

playground/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ version = ProjectSettings.version
3333

3434
tasks {
3535
compileKotlin {
36-
kotlinOptions.jvmTarget = "11"
36+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
3737
}
3838
compileTestKotlin {
39-
kotlinOptions.jvmTarget = "11"
39+
kotlinOptions.jvmTarget = ProjectSettings.jvmTarget
4040
}
4141
}

playground/src/main/kotlin/dev/matsem/astral/playground/PlaygroundApp.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.matsem.astral.playground
22

33
import dev.matsem.astral.core.di.coreModule
4-
import dev.matsem.astral.playground.sketches.Sem008
4+
import dev.matsem.astral.playground.sketches.Blank
55
import org.koin.core.KoinComponent
66
import org.koin.core.context.startKoin
77
import org.koin.core.inject
@@ -27,7 +27,7 @@ class PlaygroundApp : KoinComponent {
2727
fun run(processingArgs: Array<String>) {
2828
startKoin {
2929
printLogger(Level.ERROR)
30-
modules(coreModule + playgroundModule { Sem008() })
30+
modules(coreModule + playgroundModule { Blank() })
3131
}
3232

3333
PApplet.runSketch(processingArgs + arrayOf("ProcessingPlayground"), sketch)

0 commit comments

Comments
 (0)