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

Patchsm blocksize update #265

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1,074 changes: 537 additions & 537 deletions dist/examples.json

Large diffs are not rendered by default.

Binary file modified dist/patch_sm_GettingStarted/Audio_Settings.bin
Binary file not shown.
3 changes: 2 additions & 1 deletion helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ def create_from_template(destination, board, libs, include_vs = False):
f.write('{\n')
f.write('\thw.Init();\n')
# Include Audio Setting Options
f.write('\thw.SetAudioBlockSize(4); // number of samples handled per callback\n')
if board != 'patch_sm':
f.write('\thw.SetAudioBlockSize(4); // number of samples handled per callback\n')
f.write('\thw.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ);\n')
if board != "seed" and board != "patch_sm":
f.write('\thw.StartAdc();\n')
Expand Down
16 changes: 7 additions & 9 deletions patch_sm/GettingStarted/Audio_Settings/Audio_Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ DaisyPatchSM patch;

/** Callback for processing and synthesizing audio
*
* The default size is very small (just 4 samples per channel). This means the
* callback is being called at 16kHz.
* The default size is 48 samples per channel. This means the
* callback is being called at 1kHz.
*
* This size is acceptable for many applications, and provides an extremely low
* latency from input to output. However, you can change this size by calling
* patch.SetAudioBlockSize(desired_size). When running complex DSP it can be more
* efficient to do the processing on larger chunks at a time.
* You can change this size by calling patch.SetAudioBlockSize(desired_size).
* When running complex DSP it is more efficient to do the processing on larger chunks at a time.
*
*/
void AudioCallback(AudioHandle::InputBuffer in,
Expand All @@ -40,16 +38,16 @@ void AudioCallback(AudioHandle::InputBuffer in,
int main(void)
{
/** Initialize the patch_sm object
* This sets the blocksize to its default of 4 samples.
* This sets the blocksize to its default of 48 samples.
* This sets the samplerate to its default of 48kHz.
*/
patch.Init();

/** Set the samplerate to 96kHz */
patch.SetAudioSampleRate(96000);

/** Set the blocksize to 4 samples */
patch.SetAudioBlockSize(4);
/** Set the blocksize to 48 samples */
patch.SetAudioBlockSize(48);

/** Start the audio callback */
patch.StartAudio(AudioCallback);
Expand Down
10 changes: 4 additions & 6 deletions patch_sm/PassthruExample/PassthruExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ DaisyPatchSM patch;
* where n is the specific sample.
* There are "size" samples in each array.
*
* The default size is very small (just 4 samples per channel). This means the
* callback is being called at 16kHz.
* The default size is 48 samples per channel. This means the
* callback is being called at 1kHz.
*
* This size is acceptable for many applications, and provides an extremely low
* latency from input to output. However, you can change this size by calling
* patch.SetAudioBlockSize(desired_size). When running complex DSP it can be more
* efficient to do the processing on larger chunks at a time.
* You can change this size by calling patch.SetAudioBlockSize(desired_size).
* When running complex DSP it is more efficient to do the processing on larger chunks at a time.
*
*/
void AudioCallback(AudioHandle::InputBuffer in,
Expand Down
10 changes: 4 additions & 6 deletions patch_sm/ReverbExample/ReverbExample_comments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ ReverbSc reverb;
* where n is the specific sample.
* There are "size" samples in each array.
*
* The default size is very small (just 4 samples per channel). This means the
* callback is being called at 16kHz.
* The default size is 48 samples per channel. This means the
* callback is being called at 1kHz.
*
* This size is acceptable for many applications, and provides an extremely low
* latency from input to output. However, you can change this size by calling
* patch.SetAudioBlockSize(desired_size). When running complex DSP it can be more
* efficient to do the processing on larger chunks at a time.
* You can change this size by calling patch.SetAudioBlockSize(desired_size).
* When running complex DSP it is more efficient to do the processing on larger chunks at a time.
*
*/
void AudioCallback(AudioHandle::InputBuffer in,
Expand Down
10 changes: 4 additions & 6 deletions patch_sm/TripleSaw/TripleSaw_comments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ Oscillator osc_a, osc_b, osc_c;
* where n is the specific sample.
* There are "size" samples in each array.
*
* The default size is very small (just 4 samples per channel). This means the
* callback is being called at 16kHz.
* The default size is 48 samples per channel. This means the
* callback is being called at 1kHz.
*
* This size is acceptable for many applications, and provides an extremely low
* latency from input to output. However, you can change this size by calling
* hw.SetAudioBlockSize(desired_size). When running complex DSP it can be more
* efficient to do the processing on larger chunks at a time.
* You can change this size by calling patch.SetAudioBlockSize(desired_size).
* When running complex DSP it is more efficient to do the processing on larger chunks at a time.
*
*/
void AudioCallback(AudioHandle::InputBuffer in,
Expand Down