-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f25bc3
commit 3017ff1
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |