Skip to content

Commit 82c7cf4

Browse files
committed
cleanup codebase and update README
- partially fixed IMG and spout OSC sync - improved beatprogress display - improved nestdrop settings value sync
1 parent 29fa654 commit 82c7cf4

32 files changed

+711
-1190
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
NESTDROP=~/VJ/NestDropProV2
22
NESTDROP_PROFILE=DefaultUserProfile.xml
3-
SHOW_LOGS=true
3+
DEBUG=false

.github/workflows/build_nightly_distribution.main.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env kotlin
22

33
@file:Repository("https://repo.maven.apache.org/maven2/")
4-
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.0")
4+
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.2")
55

66
@file:Repository("https://bindings.krzeminski.it")
77

@@ -11,9 +11,11 @@
1111
@file:DependsOn("joutvhu:/create-release:v1.0.1")
1212
@file:DependsOn("gradle:actions__setup-gradle:v3")
1313
@file:DependsOn("jimeh:update-tags-action:v1.0.1")
14+
@file:DependsOn("Dylan700:sftp-upload-action:v1.2.3")
1415

1516
import io.github.typesafegithub.workflows.actions.actions.Checkout
1617
import io.github.typesafegithub.workflows.actions.actions.SetupJava
18+
import io.github.typesafegithub.workflows.actions.dylan700.SftpUploadAction_Untyped
1719
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
1820
import io.github.typesafegithub.workflows.actions.jimeh.UpdateTagsAction_Untyped
1921
import io.github.typesafegithub.workflows.actions.softprops.ActionGhRelease

README.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,68 @@
22

33
# setup and building
44

5-
needed: JDK? probably java 19+
5+
needed: JDK/JRE probably java 21+
6+
7+
with https://scoop.sh/
8+
```bash
9+
scoop bucket add java
10+
scoop install openjdk
11+
````
612

713
# required software
814

915
## Nestdrop PRO V2
1016

1117
https://www.nestimmersion.ca/nestdrop.php
1218

13-
tested with `V2.x.0.13`
14-
15-
## Carabiner
16-
17-
https://github.com/Deep-Symmetry/carabiner/releases
18-
19-
tested with `v1.2.0`
20-
21-
launch `Carabiner.exe` in a terminal before running the controlpanel
22-
23-
<!-- no longer necessary?
24-
## xq
19+
tested with `V2.x.0.23`
2520

26-
https://github.com/sibprogrammer/xq/releases
21+
# Nestdrop setup
2722

28-
`xq.exe` need to be in `PATH`
29-
-->
23+
## OSC
3024

31-
# Nestdrop setup
25+
OSC input and output needs to be enabled
26+
input port: `8000`
27+
output ip: `127.0.0.1`
28+
output port: `8001`
3229

3330
## Configuring Nestdrop location
3431

35-
create a `.env` file in the working directory (repo root when running via gradle)
32+
edit `~/.nestctrl/.env` (automatically created when running NESTCTRL the first time)
3633

3734
`~/` is supported as a shorthand for user home path
35+
adjust the `NESTDROP_PATH` as required, for more info see [dotenv keys](#dotenv-keys)
3836
```.env
3937
NESTDROP=~/VJ/NestDropProV2
4038
NESTDROP_PROFILE=DefaultUserProfile.xml
4139
```
40+
4241
## IMG sprites
4342

4443
image sprites are getting loaded by parsing `Plugins\Milkdrop2\Sprites` folder
4544

46-
## SPOUT
45+
## SPOUT sprites
4746

48-
spout sprites are loaded from the first queue with `spout` in its name
47+
spout sprites are loaded from the first queue with `spout` in its name for each deck
4948

5049
... at least until UI gets added to pick them
5150

51+
# dotenv keys
52+
53+
the dotenv file is usually placed
54+
55+
| key | default | notes |
56+
|--------------------------|--------------------------|-------------------------------|
57+
| `NESTDROP_PATH` | `~/VJ/NestDropProV2` | |
58+
| `NESTDROP_PROFILE` | `DefaultUserProfile.xml` | |
59+
| `DEBUG` | `false` | dev-only, reduces performance |
60+
| `NESTCTRL_CONFIG_FOLDER` | `~/.nesctrl` | dev-only, may break things |
61+
5262
# running from source / IDE
5363

64+
a .env file in the working directory (the repository root by default)
65+
can be used to test with a separate nestdrop installation by setting `NESTCTRL_CONFIG_FOLDER`
66+
5467
```bash
5568
./gradlew desktop
5669
```

build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ plugins {
99
kotlin("plugin.serialization")
1010
kotlin("plugin.power-assert")
1111
id("dev.reformator.stacktracedecoroutinator")
12+
id("org.bytedeco.gradle-javacpp-platform") version "1.5.10"
1213
}
1314

1415
repositories {
1516
mavenCentral()
1617
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
17-
// maven("https://oss.sonatype.org/content/repositories/snapshots/") {
18-
// this.mavenContent {
19-
// this.includeGroup("com.ryanharter.kotlinx.serialization")
20-
// }
21-
// }
2218
google()
2319
}
2420

@@ -51,13 +47,19 @@ kotlin {
5147
implementation(Ktor.client.cio)
5248
implementation("io.ktor:ktor-network:_")
5349

54-
implementation("org.deepsymmetry:lib-carabiner:_")
50+
// implementation("org.deepsymmetry:lib-carabiner:_")
5551

5652
implementation("com.illposed.osc:javaosc-core:_")
5753
// implementation("com.illposed.osc:javaosc-java-se-addons:_")
5854

5955
// implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:_")
6056

57+
// MIDI xperiments.. WIP
58+
implementation("dev.atsushieno:ktmidi:_")
59+
implementation("dev.atsushieno:ktmidi-jvm-desktop:_")
60+
api("dev.atsushieno:libremidi-javacpp:_")
61+
api("dev.atsushieno:libremidi-javacpp-platform:_")
62+
6163
implementation("io.github.pdvrieze.xmlutil:serialization:_")
6264
// implementation("com.ryanharter.kotlinx.serialization:kotlinx-serialization-xml:_")
6365
implementation("io.github.xn32:json5k:_")

src/desktopMain/kotlin/Config.kt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ import kotlinx.coroutines.flow.MutableStateFlow
77
import kotlinx.coroutines.flow.launchIn
88
import kotlinx.coroutines.flow.onEach
99
import kotlinx.coroutines.flow.sample
10+
import kotlinx.serialization.SerialName
1011
import kotlinx.serialization.Serializable
12+
import kotlinx.serialization.json.Json
13+
import kotlinx.serialization.json.JsonNamingStrategy
1114
import nestdrop.deck.Deck
1215
import nestdrop.deck.applyConfig
1316
import nestdrop.deck.configFlow
14-
import tags.TagScoreEval
17+
import obs.LOOM
18+
import tags.PresetPlaylist
1519
import ui.screens.customSearches
1620
import utils.prettyPrint
1721
import kotlin.time.Duration.Companion.seconds
@@ -20,8 +24,8 @@ private val logger = KotlinLogging.logger { }
2024

2125
@OptIn(ExperimentalCoroutinesApi::class)
2226
val configScope = CoroutineScope(
23-
Dispatchers.IO
24-
.limitedParallelism(32)
27+
Dispatchers.LOOM
28+
.limitedParallelism(16)
2529
) + CoroutineName("flows")
2630

2731
@Immutable
@@ -40,7 +44,7 @@ data class Config(
4044
val deck4: DeckConfig = DeckConfig(
4145
triggerTime = 0.25f + 0.125f
4246
),
43-
val searches: List<TagScoreEval> = emptyList()
47+
val presetPlaylists: List<PresetPlaylist> = emptyList()
4448
)
4549

4650
@Immutable
@@ -138,6 +142,9 @@ data class DeckConfig(
138142

139143
val config = MutableStateFlow(Config())
140144

145+
//val json = Json {
146+
// namingStrategy = JsonNamingStrategy.SnakeCase
147+
//}
141148
val json5 = Json5 {
142149
prettyPrint = true
143150
encodeDefaults = true
@@ -202,7 +209,7 @@ suspend fun loadConfig() {
202209
logger.info { "loaded config" }
203210
logger.debug { config.prettyPrint() }
204211
beatFrame.value = config.beats
205-
customSearches.value = config.searches
212+
customSearches.value = config.presetPlaylists
206213
decks.forEach { deck ->
207214
when (deck.id) {
208215
1 -> deck.applyConfig(config.deck1)
@@ -225,7 +232,7 @@ suspend fun loadConfig() {
225232

226233
customSearches.onEach { searches ->
227234
updateConfig {
228-
copy(searches = searches)
235+
copy(presetPlaylists = searches)
229236
}
230237
}.launchIn(configScope)
231238
}

src/desktopMain/kotlin/Link.kt

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)