Skip to content

Commit

Permalink
merges main into feat_InterpolationExp
Browse files Browse the repository at this point in the history
  • Loading branch information
mcht67 committed Jun 19, 2024
2 parents 8121e5c + 330b156 commit 8d4c18f
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 100 deletions.
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
url = https://github.com/juce-framework/JUCE
[submodule "modules/customlibmysofa"]
path = modules/customlibmysofa
url = https://github.com/vackva/libmysofa
[submodule "modules/libmysofa"]
path = modules/libmysofa
url = https://github.com/vackva/libmysofa.git
url = https://github.com/vackva/libmysofa
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
## Build instruction
# Orbe
![interface](assets/images/orbe-github-header.png)

Dependencies on Linux
```bash
# on Linux install
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev libnetcdff-dev liblapack3 liblapack-dev libopenblas-base libopenblas-dev liblapacke-dev
```
## Overview
Orbe is a real-time audio plugin designed as a binaural spatializer

**Features:**
- **Realistic Binaural Panning:** binaural sound panning in an open field using sophisticated SOFA data handling
- **Flexible Source Positioning:** Control the audio source with precision using both cartesian and spherical coordinates
- **3D Auto-Pan Functionality:** Simplify spatial manipulation with an auto-pan feature controlled by sinusoidal oscillators
- **3D Visualization:** Orbe provides a 3d visual representation of the panning, enhancing the understanding of spatial dynamics

## Build instruction
Build with CMake
```bash
# clone the repository
git clone https://github.com/vackva/SpatialPanner/
cd SpatialPanner/
git clone https://github.com/vackva/Orbe/
cd Orbe/

# initialize and set up submodules
git submodule update --init --recursive
Expand All @@ -29,6 +34,5 @@ cmake --build cmake-build-release --config Release
The primary license for the code of this project is the MIT license, but be aware of the licenses of the submodules:

- The *JUCE* library is licensed under the [JUCE License](https://github.com/juce-framework/JUCE/blob/master/LICENSE.md)
- The *Spatial_Audio_Framework* library is licensed under the [ISC License](https://github.com/leomccormack/Spatial_Audio_Framework/blob/master/LICENSE.md)
- The *OpenBlas* library (Windows & Linux only) is licensed under the [BSD3](https://github.com/OpenMathLib/OpenBLAS/blob/develop/LICENSE)
- The *libmysofa* library is licensed under the [Custom License](https://github.com/hoene/libmysofa/blob/main/LICENSE)
- The HRTF used in this project belong to the *HUTUBS* dataset and is licensed under the [CC BY 4.0 Deed](https://depositonce.tu-berlin.de/items/dc2a3076-a291-417e-97f0-7697e332c960)
Binary file added assets/images/orbe-github-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 0 additions & 45 deletions cmake/openBLAS.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion modules/customlibmysofa
1 change: 0 additions & 1 deletion modules/libmysofa
Submodule libmysofa deleted from b91183
4 changes: 4 additions & 0 deletions source/Constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

constexpr float CUBE_EDGE_LENGTH = 10.0f;
constexpr float HALF_CUBE_EDGE_LENGTH = CUBE_EDGE_LENGTH / 2.0f;
17 changes: 11 additions & 6 deletions source/PluginParameters.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "PluginParameters.h"
#include "Constants.h"

juce::AudioProcessorValueTreeState::ParameterLayout PluginParameters::createParameterLayout() {
std::vector<std::unique_ptr<juce::RangedAudioParameter>> params;
Expand Down Expand Up @@ -33,6 +34,10 @@ juce::AudioProcessorValueTreeState::ParameterLayout PluginParameters::createPara
zRange,
defaultZParam));

params.push_back(std::make_unique<juce::AudioParameterBool>(DOPPLER_ID,
DOPPLER_NAME,
defaultDopplerParam));

params.push_back(std::make_unique<juce::AudioParameterBool>(LFO_START_ID,
LFO_START_NAME,
defaultLFOStartParam));
Expand Down Expand Up @@ -195,9 +200,9 @@ void ParameterListener::boundRadius(float radius) {
float dz = cos(colatitudeRad);

// intersection of the line with the cube boundaries
float tX = (!juce::approximatelyEqual(dx,0.0f)) ? (10.0f / dx) : std::numeric_limits<float>::infinity();
float tY = (!juce::approximatelyEqual(dy,0.0f)) ? (10.0f / dy) : std::numeric_limits<float>::infinity();
float tZ = (!juce::approximatelyEqual(dz,0.0f)) ? (10.0f / dz) : std::numeric_limits<float>::infinity();
float tX = (!juce::approximatelyEqual(dx,0.0f)) ? (HALF_CUBE_EDGE_LENGTH / dx) : std::numeric_limits<float>::infinity();
float tY = (!juce::approximatelyEqual(dy,0.0f)) ? (HALF_CUBE_EDGE_LENGTH / dy) : std::numeric_limits<float>::infinity();
float tZ = (!juce::approximatelyEqual(dz,0.0f)) ? (HALF_CUBE_EDGE_LENGTH / dz) : std::numeric_limits<float>::infinity();

// the intersection point is the closest one to the origin
float tMin = std::min({std::abs(tX), std::abs(tY), std::abs(tZ)});
Expand Down Expand Up @@ -279,9 +284,9 @@ void ParameterListener::updateCartesianCoordinates()
float z = radius * cos(colatitudeRad);

// always limit the values to the room boundaries
x = jlimit(-10.0f, 10.0f, x);
y = jlimit(-10.0f, 10.0f, y);
z = jlimit(-10.0f, 10.0f, z);
x = jlimit(-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, x);
y = jlimit(-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, y);
z = jlimit(-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, z);

float normalizedX = PluginParameters::xRange.convertTo0to1(x);
float normalizedY = PluginParameters::yRange.convertTo0to1(y);
Expand Down
25 changes: 18 additions & 7 deletions source/PluginParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define BINAURALPANNER_PLUGINPARAMETERS_H

#include <JuceHeader.h>
#include "Constants.h"

class PluginParameters {
public:
Expand All @@ -26,8 +27,12 @@ class PluginParameters {
ZLFO_PHASE_ID = {"param_zlfo_phase", 1},
ZLFO_OFFSET_ID = {"param_zlfo_offset", 1},
PRESETS_ID = {"param_presets", 1},
<<<<<<< HEAD
SOFA_CHOICE_ID = {"param_sofa_choices", 1},
INTERP_ID = {"param_nearest_neighbour_interp", 1};
=======
DOPPLER_ID = {"param_doppler", 1};
>>>>>>> main



Expand All @@ -52,9 +57,14 @@ class PluginParameters {
ZLFO_DEPTH_NAME = "Z LFO Depth",
ZLFO_PHASE_NAME = "Z LFO Phase",
ZLFO_OFFSET_NAME = "Z LFO Offset",
<<<<<<< HEAD
PRESETS_NAME = "Presets",
SOFA_CHOICE_NAME = "Sofa Choices",
INTERP_NAME = "Nearest Neighbour Interpolation";
=======
PRESETS_NAME = "Presets",
DOPPLER_NAME = "Doppler Effect Enabled";
>>>>>>> main



Expand All @@ -69,6 +79,7 @@ class PluginParameters {
const inline static float defaultYParam { 0.f };
const inline static float defaultZParam { 0.f };
const inline static bool defaultLFOStartParam { false };
const inline static bool defaultDopplerParam { false };
const inline static float defaultXLFORateParam { 0.f };
const inline static float defaultXLFODepthParam { 0.f };
const inline static float defaultXLFOPhaseParam { 0.f };
Expand All @@ -87,22 +98,22 @@ class PluginParameters {

inline static juce::NormalisableRange<float> azimRange {-180.0f, 180.0f, 0.01f},
elevRange {-90.0f, 90.0f, 0.01f},
distRange {0.0f, 17.4f, 0.1f},
xRange {-10.f, 10.f, 0.1f},
yRange {-10.f, 10.f, 0.1f},
zRange {-10.f, 10.f, 0.1f},
distRange {0.0f, static_cast<float>(sqrt(pow(HALF_CUBE_EDGE_LENGTH, 2) * 3)), 0.01f},
xRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f},
yRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f},
zRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f},
xLFORateRange {0.0f, 1.5f, 0.1f},
xLFODepthRange {0.0f, 100.f, 0.1f},
xLFOPhaseRange {-180.f, 180.f, 1.f},
xLFOOffsetRange {-10.f, 10.f, 0.1f},
xLFOOffsetRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f},
yLFORateRange {0.0f, 1.5f, 0.1f},
yLFODepthRange {0.0f, 100.f, 0.1f},
yLFOPhaseRange {-180.f, 180.f, 1.f},
yLFOOffsetRange {-10.f, 10.f, 0.1f},
yLFOOffsetRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f},
zLFORateRange {0.0f, 1.5f, 0.1f},
zLFODepthRange {0.0f, 100.f, 0.1f},
zLFOPhaseRange {-180.f, 180.f, 1.f},
zLFOOffsetRange {-10.f, 10.f, 0.1f};
zLFOOffsetRange {-HALF_CUBE_EDGE_LENGTH, HALF_CUBE_EDGE_LENGTH, 0.01f};


private:
Expand Down
Loading

0 comments on commit 8d4c18f

Please sign in to comment.