Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -66,7 +65,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -98,7 +96,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure
run: |
cmake ${{ github.workspace }} -G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/ios.cmake \
Expand All @@ -57,7 +56,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -78,7 +76,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -99,7 +96,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Configure
Expand All @@ -63,7 +62,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand All @@ -84,7 +82,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand All @@ -105,7 +102,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand All @@ -125,7 +121,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand All @@ -145,7 +140,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand All @@ -165,7 +159,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- uses: actions/cache/restore@v4
id: cache-restore
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- name: Build SDL2
Expand All @@ -54,7 +53,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -74,7 +72,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -94,7 +91,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -113,7 +109,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -132,7 +127,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand All @@ -151,7 +145,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions/cache/restore@v4
id: cache-restore
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
Expand All @@ -57,7 +56,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
Expand All @@ -75,7 +73,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
Expand All @@ -92,7 +89,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
Expand All @@ -109,7 +105,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: seanmiddleditch/gha-setup-ninja@master
- run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y ${INSTALL_DEPS}
- name: Configure CMake with Coverage
Expand Down
22 changes: 19 additions & 3 deletions cmake/yup_generate_java_header.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,25 @@ file (READ "${INPUT_FILE}" hex_content HEX)
get_filename_component (INPUT_FILE_NAME "${INPUT_FILE}" NAME)

# Convert hex string to C++ array format
string (REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" separated_hex ${hex_content})
list (JOIN separated_hex ", 0x" formatted_hex)
string (PREPEND formatted_hex "0x")
set (count 0)
set (wrapped_hex "")
string (REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" separated_hex "${hex_content}")
foreach (byte IN LISTS separated_hex)
if (count EQUAL 0)
set (current_line "0x${byte}")
else()
set (current_line "${current_line},0x${byte}")
endif()
math (EXPR count "${count} + 1")
if (count EQUAL 60)
list (APPEND wrapped_hex "${current_line}")
set (count 0)
endif()
endforeach()
if (count GREATER 0)
list(APPEND wrapped_hex "${current_line}")
endif()
string (JOIN "\n" formatted_hex ${wrapped_hex})

# Generate timestamp
string (TIMESTAMP current_time "%Y-%m-%d %H:%M:%S UTC" UTC)
Expand Down
1 change: 0 additions & 1 deletion cmake/yup_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ function (yup_prepare_python_stdlib target_name python_tools_path output_variabl
"${Python_EXECUTABLE}" "${python_tools_path}/ArchivePythonStdlib.py"
-r "${python_root_path}" -o "${CMAKE_CURRENT_BINARY_DIR}" -M "${Python_VERSION_MAJOR}" -m "${Python_VERSION_MINOR}"
-x "\"${ignored_library_patterns}\""
COMMAND_ECHO STDOUT
COMMAND_ERROR_IS_FATAL ANY)

set (${output_variable} ${python_standard_library} PARENT_SCOPE)
Expand Down
4 changes: 2 additions & 2 deletions modules/yup_audio_basics/synthesisers/yup_Synthesiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Synthesiser::~Synthesiser()
}

//==============================================================================
SynthesiserVoice* Synthesiser::getVoice (const int index) const
SynthesiserVoice::Ptr Synthesiser::getVoice (const int index) const
{
const ScopedLock sl (lock);
return voices[index];
Expand All @@ -118,7 +118,7 @@ void Synthesiser::clearVoices()
voices.clear();
}

SynthesiserVoice* Synthesiser::addVoice (SynthesiserVoice* const newVoice)
SynthesiserVoice* Synthesiser::addVoice (const SynthesiserVoice::Ptr newVoice)
{
SynthesiserVoice* voice;

Expand Down
38 changes: 15 additions & 23 deletions modules/yup_audio_basics/synthesisers/yup_Synthesiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class YUP_API SynthesiserSound : public ReferenceCountedObject

@tags{Audio}
*/
class YUP_API SynthesiserVoice
class YUP_API SynthesiserVoice : public ReferenceCountedObject
{
public:
//==============================================================================
Expand Down Expand Up @@ -261,6 +261,9 @@ class YUP_API SynthesiserVoice
/** Returns true if this voice started playing its current note before the other voice did. */
bool wasStartedBefore (const SynthesiserVoice& other) const noexcept;

/** The class is reference-counted, so this is a handy pointer class for it. */
using Ptr = ReferenceCountedObjectPtr<SynthesiserVoice>;

protected:
/** Resets the state of this voice after a sound has finished playing.

Expand Down Expand Up @@ -337,17 +340,16 @@ class YUP_API Synthesiser
int getNumVoices() const noexcept { return voices.size(); }

/** Returns one of the voices that have been added. */
SynthesiserVoice* getVoice (int index) const;
SynthesiserVoice::Ptr getVoice (int index) const;

/** Adds a new voice to the synth.

All the voices should be the same class of object and are treated equally.

The object passed in will be managed by the synthesiser, which will delete
it later on when no longer needed. The caller should not retain a pointer to the
voice.
The object passed in is reference counted, so will be deleted when the
synthesiser and all voices are no longer using it.
*/
SynthesiserVoice* addVoice (SynthesiserVoice* newVoice);
SynthesiserVoice* addVoice (SynthesiserVoice::Ptr newVoice);

/** Deletes one of the voices. */
void removeVoice (int index);
Expand Down Expand Up @@ -400,9 +402,7 @@ class YUP_API Synthesiser

The midiChannel parameter is the channel, between 1 and 16 inclusive.
*/
virtual void noteOn (int midiChannel,
int midiNoteNumber,
float velocity);
virtual void noteOn (int midiChannel, int midiNoteNumber, float velocity);

/** Triggers a note-off event.

Expand All @@ -416,10 +416,7 @@ class YUP_API Synthesiser

The midiChannel parameter is the channel, between 1 and 16 inclusive.
*/
virtual void noteOff (int midiChannel,
int midiNoteNumber,
float velocity,
bool allowTailOff);
virtual void noteOff (int midiChannel, int midiNoteNumber, float velocity, bool allowTailOff);

/** Turns off all notes.

Expand All @@ -435,8 +432,7 @@ class YUP_API Synthesiser
This method will be called automatically according to the midi data passed into
renderNextBlock(), but may be called explicitly too.
*/
virtual void allNotesOff (int midiChannel,
bool allowTailOff);
virtual void allNotesOff (int midiChannel, bool allowTailOff);

/** Sends a pitch-wheel message to any active voices.

Expand All @@ -449,8 +445,7 @@ class YUP_API Synthesiser
@param midiChannel the midi channel, from 1 to 16 inclusive
@param wheelValue the wheel position, from 0 to 0x3fff, as returned by MidiMessage::getPitchWheelValue()
*/
virtual void handlePitchWheel (int midiChannel,
int wheelValue);
virtual void handlePitchWheel (int midiChannel, int wheelValue);

/** Sends a midi controller message to any active voices.

Expand All @@ -464,9 +459,7 @@ class YUP_API Synthesiser
@param controllerNumber the midi controller type, as returned by MidiMessage::getControllerNumber()
@param controllerValue the midi controller value, between 0 and 127, as returned by MidiMessage::getControllerValue()
*/
virtual void handleController (int midiChannel,
int controllerNumber,
int controllerValue);
virtual void handleController (int midiChannel, int controllerNumber, int controllerValue);

/** Sends an aftertouch message.

Expand Down Expand Up @@ -510,8 +503,7 @@ class YUP_API Synthesiser
The base class implementation of this has no effect, but you may want to make your
own synth react to program changes.
*/
virtual void handleProgramChange (int midiChannel,
int programNumber);
virtual void handleProgramChange (int midiChannel, int programNumber);

//==============================================================================
/** Tells the synthesiser what the sample rate is for the audio it's being used to render.
Expand Down Expand Up @@ -575,7 +567,7 @@ class YUP_API Synthesiser
/** This is used to control access to the rendering callback and the note trigger methods. */
CriticalSection lock;

OwnedArray<SynthesiserVoice> voices;
ReferenceCountedArray<SynthesiserVoice> voices;
ReferenceCountedArray<SynthesiserSound> sounds;

/** The last pitch-wheel values for each midi channel. */
Expand Down
Loading
Loading