Skip to content

Commit

Permalink
Add Hermas project
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Feb 15, 2024
1 parent 3f25bc3 commit 3017ff1
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
mkdir firmware
cp build/src/kyma/Release/kyma.bin firmware
cp build/src/hades/Release/hades.bin firmware
cp build/src/hermas/Release/hermas.bin firmware
cp build/src/astra/Release/astra.bin firmware
- name: Upload coverage artifacts
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ if(CMAKE_CROSSCOMPILING)
add_subdirectory(src/astra)
add_subdirectory(src/benchmark)
add_subdirectory(src/hades)
add_subdirectory(src/hermas)
add_subdirectory(src/kyma)
endif()

Expand Down
6 changes: 6 additions & 0 deletions src/hermas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.23...3.27)
project(hermas)

add_baremetal_executable(${PROJECT_NAME} ${LINKER_SCRIPT})
target_sources(${PROJECT_NAME} PRIVATE main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE daisy gritwave::eurorack)
7 changes: 7 additions & 0 deletions src/hermas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hermas

## Features

- Transient Shaper
- Output gain control signal
- Sum of attack & sustain, or one only via switch/button
55 changes: 55 additions & 0 deletions src/hermas/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include <grit/audio/stereo.hpp>
#include <grit/math/remap.hpp>
#include <grit/unit/decibel.hpp>

#include <daisy_patch_sm.h>

namespace hermas {

constexpr auto blockSize = 16U;
constexpr auto sampleRate = 96'000.0F;

auto patch = daisy::patch_sm::DaisyPatchSM{};

auto audioCallback(
daisy::AudioHandle::InterleavingInputBuffer in,
daisy::AudioHandle::InterleavingOutputBuffer out,
size_t size
) -> void
{
patch.ProcessAllControls();

auto const input = grit::StereoBlock<float const>{in, size};
auto const output = grit::StereoBlock<float>{out, size};

auto const gainLeftKnob = patch.GetAdcValue(daisy::patch_sm::CV_1);
auto const gainRightKnob = patch.GetAdcValue(daisy::patch_sm::CV_2);

auto const gainLeft = grit::fromDecibels(grit::remap(gainLeftKnob, -30.0F, 6.0F));
auto const gainRight = grit::fromDecibels(grit::remap(gainRightKnob, -30.0F, 6.0F));

for (size_t i = 0; i < size; ++i) {
auto const inLeft = input(0, i);
auto const inRight = input(1, i);

auto const leftGained = inLeft * gainLeft;
auto const rightGained = inRight * gainRight;

output(0, i) = leftGained + rightGained;
output(1, i) = leftGained + rightGained;
}
}

} // namespace hermas

auto main() -> int
{
using namespace hermas;

patch.Init();
patch.SetAudioSampleRate(sampleRate);
patch.SetAudioBlockSize(blockSize);
patch.StartAudio(audioCallback);

while (true) {}
}
28 changes: 28 additions & 0 deletions src/hermas/signal_chain.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Gritwave Hermás
---
flowchart LR
subgraph Transient[TransientShaper]
Attack
Sustain
Strength
Smooth
SelectOut[Select CV Output]
end

Knob1((Knob 1)) --> Attack
Knob2((Knob 2)) --> Sustain
Knob3((Knob 3)) --> Strength
Knob4((Knob 4)) --> Smooth

%% Button
Switch --> SelectOut

CV5(CV5) --> Attack
CV6(CV6) --> Sustain
CV7(CV7) --> Strength
CV8(CV8) --> Smooth

Input --> |Signal| Transient
Transient --> |Signal| Output
Transient --> |Transient Gain| CVOut(CV Out)

0 comments on commit 3017ff1

Please sign in to comment.