Skip to content

Commit

Permalink
mention max blocksize; clamp blocksize between 1 and 256
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Nov 10, 2023
1 parent 0df7bc1 commit da336e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/03.gen.daisy.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ This can be done by adding either to the meta.json:
}
```

Do note that the samplerate will be automatically set to either 16k, 32k, 48k, or 96k.
Do note that the samplerate will be automatically set to either 16k, 32k, 48k, or 96k. Blocksize will need to be less than 256.
10 changes: 8 additions & 2 deletions hvcc/generators/c2daisy/c2daisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ def compile(
component_glue['header'] = f"HeavyDaisy_{patch_name}.hpp"
component_glue['max_channels'] = board_info['channels']
component_glue['num_output_channels'] = num_output_channels
component_glue['has_midi'] = board_info['has_midi']
component_glue['debug_printing'] = daisy_meta.get('debug_printing', False)
component_glue['usb_midi'] = daisy_meta.get('usb_midi', False)
component_glue['samplerate'] = daisy_meta.get('samplerate')
component_glue['blocksize'] = daisy_meta.get('blocksize')
component_glue['has_midi'] = board_info['has_midi']

blocksize = daisy_meta.get('blocksize')

if blocksize:
component_glue['blocksize'] = max(min(256, blocksize), 1)
else:
component_glue['blocksize'] = None

component_glue['copyright'] = copyright_c

Expand Down

0 comments on commit da336e3

Please sign in to comment.