Skip to content

Commit 4b11216

Browse files
Merge pull request #55 from matejsemancik/feature/raspberry-pi-standalone
Standalone Raspberry Pi app
2 parents b9e7236 + 23ae496 commit 4b11216

File tree

16 files changed

+478
-6
lines changed

16 files changed

+478
-6
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@ Just some Processing sketches. Source code for visuals we use at [Soul Ex Machin
55

66
![](demo-gif.gif)
77

8-
The project is divided into 3 modules, `:core` module cointains the core stuff like audio processing, tools, remote control handlers, extensions, etc. Then there are two application modules - the `:playground` and `:visuals` module.
8+
The project is divided into multiple modules.
99

10-
The `:playground` module serves as, well... playground. You can quickly create a new sketch and play around. I'm using the [Koin](https://insert-koin.io/) DI framework, so you can inject here whatever is defined in the `CoreModule`. Have a look around.
10+
The `:core` module contains the core stuff like audio processing, tools, remote control handlers, extensions, etc.
11+
12+
The `:playground` module serves as, well... playground. Used to quickly create a new sketch and play around. I'm using the [Koin](https://insert-koin.io/) DI framework, so you can inject here whatever is defined in the `CoreModule`. Have a look around.
1113

1214
The `:visuals` module is meant to be used in live environment at the parties. There is an abstraction layer in form of `Mixer` and `Layer`s, which allows me to blend multiple scenes together. Also, have a look around, proceed at your own risk, ignore `legacy` package 😅 (I like to change things, API is generally unstable).
1315

16+
The `:raspberrypi` module contains standalone RPi application that can be distributed using the [Application Gradle plugin](https://docs.gradle.org/current/userguide/application_plugin.html).
17+
1418
## How to build
1519

1620
This project depends on local [Processing 4](https://processing.org) installation, so go ahead and install it if you haven't already. Then create a `local.properties` file in project's root directory and configure the core library and contributed libraries' paths:
1721

1822
```
19-
processing.core.jars=/path/to/your/processing/libraries/dir
20-
processing.core.natives=/path/to/your/processing/libraries/dir/<os-architecture>
23+
processing.core.jars=/path/to/core/processing/libraries
24+
processing.core.natives=/path/to/core/processing/libraries/<os-architecture>
25+
processing.core.natives.rpi=/path/to/core/processing/libraries/<os-architecture>
2126
processing.libs.jars=/path/to/core/processing/libraries
2227
```
2328

@@ -26,8 +31,11 @@ On macOS it might look like this:
2631
```
2732
processing.core.jars=/Applications/Processing.app/Contents/Java/core/library
2833
processing.core.natives=/Applications/Processing.app/Contents/Java/core/library/macos-x86_64
34+
processing.core.natives.rpi=/Applications/Processing.app/Contents/Java/core/library/linux-aarch64
2935
processing.libs.jars=/Users/matsem/Documents/Processing/libraries
3036
```
37+
Note the difference between `processing.core.natives` and `processing.core.natives.rpi`.
38+
The Raspberry Pi libs have to be configured if you wish to use the `:raspberrypi` module.
3139

3240
The Gradle buildscript will look for Processing dependencies at these two paths. Dependencies are defined in CommonDependencies gradle plugin. Open it up, and you can notice that this project depends on some 3rd party libraries, which need to be installed at `processing.libs.jars` path. Open your Processing library manager (Sketch > Import Library > Add library) and install whatever libraries are specified in the `build.gradle` file.
3341

@@ -49,6 +57,11 @@ val processingLibs = listOf(
4957
)
5058
```
5159

60+
61+
### :raspberrypi module
62+
The Raspberry Pi app can be installed using `./gradlew raspberrypi:installDist` task and zipped using `./gradlew raspberrypi:distZip` task.
63+
See the [Application Plugin](https://docs.gradle.org/current/userguide/application_plugin.html) docs for more info.
64+
5265
## How to run
5366

5467
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.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object ProjectSettings {
2-
const val version = "2.1.0"
2+
const val version = "2.2.0"
33
const val group = "dev.matsem"
44
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal fun Project.configureCommonDependencies() {
4141
fileTree(
4242
mapOf(
4343
"dir" to "$processingLibsDir/$libName/library",
44-
"include" to listOf("*.jar")
44+
"include" to listOf("*.jar", "shader/*.glsl")
4545
)
4646
)
4747
)

data/images/semlogo_bottom.svg

Lines changed: 5 additions & 0 deletions
Loading

data/images/semlogo_top.svg

Lines changed: 5 additions & 0 deletions
Loading

raspberrypi/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build/
2+
out/
3+
*.log

raspberrypi/build.gradle.kts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import java.util.*
2+
3+
plugins {
4+
kotlin("jvm")
5+
application
6+
}
7+
8+
apply<dev.matsem.astral.CommonDependencies>()
9+
10+
application {
11+
val props = Properties().apply {
12+
load(file("${rootDir}/local.properties").inputStream())
13+
}
14+
val nativesDir = props["processing.core.natives.rpi"]
15+
16+
mainClass.set("dev.matsem.astral.raspberrypi.RaspberryApp")
17+
applicationDefaultJvmArgs = listOf(
18+
"-Djava.library.path=$nativesDir"
19+
)
20+
applicationName = "visuals"
21+
}
22+
23+
repositories {
24+
mavenCentral()
25+
jcenter()
26+
}
27+
28+
dependencies {
29+
implementation(project(":core"))
30+
}
31+
32+
group = ProjectSettings.group
33+
version = ProjectSettings.version
34+
35+
tasks {
36+
compileKotlin {
37+
kotlinOptions.jvmTarget = "11"
38+
}
39+
compileTestKotlin {
40+
kotlinOptions.jvmTarget = "11"
41+
}
42+
}
43+
44+
tasks.getByName<Zip>("distZip") {
45+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
46+
}
47+
48+
tasks.getByName<Sync>("installDist") {
49+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
50+
}
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)