Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Torus to patch.Init() #293

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

huwshimi
Copy link

This is a port of the Torus (MI Rings) example to the patch.Init(). I've added a few enhancements to make it a bit more fully featured (v/oct and calibration, CV control of some params etc.)

I'll leave some comments about what has been modified from the Patch example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in the .vscode dir should be the same as the Patch example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing in the dsp dir has been modified from the Patch example.

dsp/string.cpp \
dsp/string_synth_part.cpp \
resources.cpp \
calibrate.cpp \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this line has changed from the Patch example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with new instructions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is new. The implementation is largely from electro-smith/libDaisy#397 (comment).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resources files are unchanged from the Patch example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is new.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been updated to handle the increased number of controls and to remove the screen UI.

Comment on lines +326 to +359
if(settings_data.easter_egg_on)
{
for(size_t i = 0; i < size; ++i)
{
input[i] = in[0][i];
}
strummer.Process(NULL, size, &performance_state);
string_synth.Process(
performance_state, patch, input, output, aux, size);
}
else
{
// Apply noise gate.
for(size_t i = 0; i < size; i++)
{
float in_sample = in[0][i];
float error, gain;
error = in_sample * in_sample - in_level;
in_level += error * (error > 0.0f ? 0.1f : 0.0001f);
gain = in_level <= kNoiseGateThreshold
? (1.0f / kNoiseGateThreshold) * in_level
: 1.0f;
input[i] = gain * in_sample;
}

strummer.Process(input, size, &performance_state);
part.Process(performance_state, patch, input, output, aux, size);
}

for(size_t i = 0; i < size; i++)
{
out[0][i] = output[i];
out[1][i] = aux[i];
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are unchanged.

while(1)
{
// Without this pause the save events get missed for some unknown reason.
hw.Delay(1);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to know what's going on here. If I don't have this delay and trigger_save becomes true it never gets picked up. I only discovered this because it worked if I had other processing happening in the while loop. I tried throttling with a timer but that had no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant