All Projects → igorski → kosm

igorski / kosm

Licence: other
Kosm for Android source code

Programming Languages

C++
36643 projects - #6 most used programming language
java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to kosm

Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+10930.3%)
Mutual labels:  physics, particles
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (+4990.91%)
Mutual labels:  physics, particles
Specs Physics
nphysics integration for the Specs entity component system
Stars: ✭ 94 (+184.85%)
Mutual labels:  physics, physics-engine
Physics3d
A 3D physics engine
Stars: ✭ 101 (+206.06%)
Mutual labels:  physics, physics-engine
DynamicalBilliards.jl
An easy-to-use, modular, extendable and absurdly fast Julia package for dynamical billiards in two dimensions.
Stars: ✭ 97 (+193.94%)
Mutual labels:  physics, particles
ign-physics
Abstract physics interface designed to support simulation and rapid development of robot applications.
Stars: ✭ 40 (+21.21%)
Mutual labels:  physics, physics-engine
Nphysics
2 and 3-dimensional rigid body physics engine for Rust.
Stars: ✭ 1,530 (+4536.36%)
Mutual labels:  physics, physics-engine
Raymarched-GPU-Particles-with-Screenspace-Physics
Using Grab Passes for VRChat
Stars: ✭ 44 (+33.33%)
Mutual labels:  physics, particles
P2.js
JavaScript 2D physics library
Stars: ✭ 2,367 (+7072.73%)
Mutual labels:  physics, physics-engine
Physac
2D physics header-only library for videogames developed in C using raylib library.
Stars: ✭ 151 (+357.58%)
Mutual labels:  physics, physics-engine
Matter Js
a 2D rigid body physics engine for the web ▲● ■
Stars: ✭ 12,522 (+37845.45%)
Mutual labels:  physics, physics-engine
Legion-Engine
Rythe is a data-oriented C++17 game engine built to make optimal use of modern hardware.
Stars: ✭ 502 (+1421.21%)
Mutual labels:  physics, physics-engine
Py3ODE
Port of PyODE for Python 3
Stars: ✭ 29 (-12.12%)
Mutual labels:  physics, physics-engine
Torque
2d 纯计算高性能刚体物理引擎
Stars: ✭ 62 (+87.88%)
Mutual labels:  physics, physics-engine
fdtd3d
fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x86, arm, arm64 architectures
Stars: ✭ 77 (+133.33%)
Mutual labels:  physics
physics-learning-path
This is my physics learning path. Best courses I've found to learn physics online.
Stars: ✭ 37 (+12.12%)
Mutual labels:  physics
SwiftUI-DesignCode
 SwiftUI-DesignCode is some examples in the process of learning swiftUI 2.0
Stars: ✭ 185 (+460.61%)
Mutual labels:  particles
teilchen
a simple physics library based on particles, forces, constraints and behaviors
Stars: ✭ 22 (-33.33%)
Mutual labels:  particles
lab-dotphy
The Virtual Lab for Physics
Stars: ✭ 14 (-57.58%)
Mutual labels:  physics
harmonica
A simple, physics-based animation library 🎼
Stars: ✭ 571 (+1630.3%)
Mutual labels:  physics

Kosm

an open source abstract audio application for Android. Kosm uses the accelerometer of your device to trigger state changes in its audio engine which in turn responds by synthesizing audio on the fly. In other words : Kosm is a "gravity sequencer", or something.

Keywords : chaos, chance, microtonal.

MWEngine audio engine

Kosm is built on top of MWEngine, an open source audio engine for Android by igorski. MWEngine is written in C++, using OpenSL for low latency performance. The engine has been written for the MikroWave synthesis/sequencing-application and works from API level 9 (Android 2.3/Gingerbread) and up. Though the engine is written in C++ (and can be used solely within this context), the library is built using JNI (Java Native Interface) allowing its methods to be exposed to Java while still executing in a native layer outside of the Dalvik/ART VM. In other words : high performance of the engine is ensured by the native layer operations, while ease of development is ensured by keeping application logic / UI within the realm of the Android Java SDK. For more details and plenty of Wiki documentation you can go to the MWEngine repository :

https://github.com/igorski/MWEngine

Kosm inherits most of the basic MWEngine classes, see the /jni/kosm-folder for the rendering of Kosm-specific "AudioParticleEvents".

APE Physics engine

Kosm relies on the APE physics engine and uses a modified version of the Android version. Sadly, the original Android library doesn't seem to be maintained anymore (the old Subversion repository on Google Code has been migrated to Github though : https://github.com/msoftware/ape-physics-for-android)

Credits for APE go to Alec Cove, Theo Galanakis (Java port) and Michiel van den Anker (Android port).

Build instructions

You will need both the Android SDK and the Android NDK installed. The Android NDK is used to compile the audio engine. All build commands bar the compilation of the audio engine code is done via Gradle.

Compiling the audio engine

The makefile (/jni/Android.mk) will compile the MWEngine audio engine with all available modules.

Those of a Unix-bent can run the build.sh-file in the root folder of the repository whereas Windows users can run the build.bat-file that resides in the same directory, just make sure "ndk-build" and "swig" are globally available through the PATH settings of your system (or adjust the shell scripts accordingly).

After compiling the C++ code, the nl.igorski.lib.audio.nativeaudio-namespace should be available to Java.

Resolving dependencies

Run the Gradle target "externals" to pull all dependent libraries from Github, e.g.:

gradle externals

Building the main application

The usual Gradle suspects such as "clean", "build", etc. are present. To instantly deploy a debug version of the application onto an attached Android device / emulator, run :

gradle installDebug

To create a signed release build, add the following into your Gradle's properties file (~/.gradle/gradle.properties) and replace the values accordingly:

RELEASE_STORE_FILE={path_to_.keystore_file}
RELEASE_STORE_PASSWORD={password_for_.keystore}
RELEASE_KEY_ALIAS={alias_for_.keystore}
RELEASE_KEY_PASSWORD={password_for_.keystore}

you can now build and sign a releasable APK by running:

gradle build

after which the built and signed APK is available in ./build/outputs/apk-kosm-release.apk

Application outline

The main Activity Kosm.java spawns an instance of ParticleSequencer. This is the main class responsible for the applications behaviour.

Inside the ParticleSequencer there are two threads running :

  • ViewRenderer responsible for drawing the "world" and updating the physics engine (physicsWorld)
  • MWEngine responsible for rendering synthesized audio using the native layer engine

The ParticleSequencer listens to touch and sensor change events and delegates actions accordingly (see its "event handlers" section). This is basically what the app boils down to: monitoring sensor changes and synthesizing colliding "particles"; upon touching the screen surface, the ViewRenderer will spawn particles. Depending on the sequencer mode these particles have different behaviours (e.g. are static, respond to gravity, emit clones at a steady rate, etc.), when these particles collide with one another they will synthesize their audio. The "mass" and type of a particle determines the pitch and waveform used for synthesis (see AudioParticle).

Most of the application logic is command-based (using a simplified abstraction of the PureMVC framework, see all Core.notify() invocations) and the code for these commands should be self explanatory; a command basically ties together all actors of the application to execute a state change. E.g. there are commands for creating the effects chain, opening/closing of the submenus, toggling sequencer modes, etc. As such most of the logic is small and self contained.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].