Skip to content

Commit

Permalink
improve README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yannick committed Oct 21, 2024
1 parent de095ec commit 62d0ab9
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

This is a simple JVM based MIDI Looper with a text based UI.

[![PsyOps Tool Demo](https://img.youtube.com/vi/zetXwQflREE/0.jpg)](https://www.youtube.com/watch?v=zetXwQflREE)
![Screenshot](demo.png)
[Full Demo on Youtube](https://www.youtube.com/watch?v=zetXwQflREE)

## Features
- External Clock Mode: Sync to the MIDI Clock from an external MIDI device e.g. a Drum Machine.
Expand Down
2 changes: 1 addition & 1 deletion codeAndFix.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./gradlew installDist && build/install/PsyopsTool/bin/PsyopsTool -o Impact -i Impact -c EXTERNAL --blank=4 --noteNameMask=DRUMBRUTE_IMPACT
./gradlew installDist && build/install/PsyopsTool/bin/PsyopsTool -o Impact -i Impact -c EXTERNAL --script=/home/yannick/IdeaProjects/PsyopsTool/src/main/resources/dnb.kts --noteNameMask=DRUMBRUTE_IMPACT
Binary file added demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/kotlin/de/yw/psyops/MidiLoop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ fun fillOneBarMidiLoop(
check(noteCount > 0)
val probabilitys = FloatArray(noteCount)
probabilitys.fill(probability)
return fillOneBarMidiLoopWithProbabilitys(probabilitys, note, length, channel, velocity)
return fillOneBarMidiLoopWithProbabilities(probabilitys, note, length, channel, velocity)
}

/**
* Fills one bar with notes with the given probabilitys.
* The size of the array determines the subdivision of the notes.
*/
fun fillOneBarMidiLoopWithProbabilitys(
fun fillOneBarMidiLoopWithProbabilities(
probabilitys: FloatArray, note: Int, length: Float = 1f, channel: Int = 0, velocity: Int = 127
): MidiLoop {
return fillSteps(probabilitys, probabilitys.size, note, length, channel, velocity)
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/de/yw/psyops/scripting/ScriptHost.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun loadLoopsFromScript(
val compilationConfiguration = createJvmCompilationConfigurationFromTemplate<SimpleScript> {
jvm {
dependenciesFromCurrentContext(wholeClasspath = true)
defaultImports.put(listOf("de.yw.psyops.*", "de.yw.psyops.mappings.*"))
defaultImports.put(listOf("de.yw.psyops.*", "de.yw.psyops.masks.*"))
}
}
val pluginContextImpl = PluginContextImpl()
Expand Down
18 changes: 9 additions & 9 deletions src/test/kotlin/MidiLoopTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class MidiLoopTest {
}

@Test
fun fillOneBarMidiLoopWithChances_quarterNotes() {
val loop = fillOneBarMidiLoopWithChances(floatArrayOf(1f, 1f, 1f, 1f), 36)
fun fillOneBarMidiLoopWithProbablities_quarterNotes() {
val loop = fillOneBarMidiLoopWithProbabilities(floatArrayOf(1f, 1f, 1f, 1f), 36)

repeat(4) {
assertThat(loop.tick()).matches {
Expand All @@ -64,8 +64,8 @@ class MidiLoopTest {
}

@Test
fun fillOneBarMidiLoopWithChances_quarterNotes2() {
val loop = fillOneBarMidiLoopWithChances(floatArrayOf(1f, 0f, 1f, 0f), 36)
fun fillOneBarMidiLoopWithProbablities_quarterNotes2() {
val loop = fillOneBarMidiLoopWithProbabilities(floatArrayOf(1f, 0f, 1f, 0f), 36)

repeat(4) {
assertThat(loop.tick()).matches {
Expand All @@ -89,8 +89,8 @@ class MidiLoopTest {
}

@Test
fun fillOneBarMidiLoopWithChances_8thNotes() {
val loop = fillOneBarMidiLoopWithChances(floatArrayOf(1f, 0f, 1f, 0f, 1f, 0f, 1f, 0f), 36)
fun fillOneBarMidiLoopWithProbablities_8thNotes() {
val loop = fillOneBarMidiLoopWithProbabilities(floatArrayOf(1f, 0f, 1f, 0f, 1f, 0f, 1f, 0f), 36)

repeat(4) {
assertThat(loop.tick()).matches {
Expand All @@ -114,8 +114,8 @@ class MidiLoopTest {
}

@Test
fun fillOneBarMidiLoopWithChances_7thNotes() {
val loop = fillOneBarMidiLoopWithChances(floatArrayOf(1f, 1f, 1f, 1f, 1f, 1f, 1f), 36)
fun fillOneBarMidiLoopWithProbablities_7thNotes() {
val loop = fillOneBarMidiLoopWithProbabilities(floatArrayOf(1f, 1f, 1f, 1f, 1f, 1f, 1f), 36)

// this note takes 13 steps
assertThat(loop.tick()).matches {
Expand Down Expand Up @@ -241,6 +241,6 @@ class MidiLoopTest {
assertThat(loop.nextTick).isEqualTo(1)
assertThat(loop.previousTick).isEqualTo(95)

assertThat(loop.currentNote!!.percentage).isEqualTo(1f)
assertThat(loop.currentNote!!.probability).isEqualTo(1f)
}
}
6 changes: 3 additions & 3 deletions src/test/kotlin/de/yw/psyops/scripting/ScriptHostTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ class ScriptHostTest {
assertThat(midiLoops).satisfiesExactly({ midiLoop ->
assertThat(midiLoop.noteMap.values).satisfiesExactlyInAnyOrder(
{ note ->
assertThat(note.percentage).isEqualTo(1.0f)
assertThat(note.probability).isEqualTo(1.0f)
assertThat(note.midiPitch).isEqualTo(KICK)
},
{ note ->
assertThat(note.percentage).isEqualTo(0.25f)
assertThat(note.probability).isEqualTo(0.25f)
assertThat(note.midiPitch).isEqualTo(KICK)
},
{ note ->
assertThat(note.percentage).isEqualTo(0.25f)
assertThat(note.probability).isEqualTo(0.25f)
assertThat(note.midiPitch).isEqualTo(KICK)
},
)
Expand Down

0 comments on commit 62d0ab9

Please sign in to comment.