Skip to content

Commit

Permalink
Merge branch 'vv0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Sep 4, 2023
2 parents 4243083 + 2128696 commit 16e54f1
Show file tree
Hide file tree
Showing 11 changed files with 405 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.0
current_version = 0.9.0

[bumpversion:file:setup.cfg]

Expand Down
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: Wasted-Audio
patreon: WastedAudio
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
CHANGELOG
=====

0.9.0
-----

* Daisy: set bootloader type in Makefile
* Daisy: MIDI i/o for NoteOn/Off, ControlChange, ProgramChange, ChannelPressure, and PitchBend
* Daisy: USB MIDI toggle (disabled by debug printing)
* Daisy: allow for debug printing (off by default, increases program size due to formatting)
* DPF bugfixes: broken midi template include; MIDI_RT_CLOCK fails under certain conditions
* Pdext bugfixes: Windows library linking

0.8.0
-----

Expand Down
42 changes: 41 additions & 1 deletion docs/03.gen.daisy.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,44 @@ Which can be configured using the `-m` metadata.json `daisy.board` setting:
}
```

However one can also create custom board layouts. See the pd2dsy documentation for more information.
However one can also create custom board layouts. See [the Electro-Smith documentation](https://github.com/electro-smith/DaisyWiki/wiki/Pd2dsy-Guide) for more information.

The custom layout can be passed on via the meta.json as such:

```json
{
"daisy": {
"board_file": <path to board.json>
}
}
```

## MIDI

Board files that have `OOPSY_TARGET_HAS_MIDI_INPUT` configured will automatically set up UART MIDI on the default USART1 Rx and Tx pins of the Daisy (D13/14).

Additionally `usb_midi`, running on the onboard micro-usb, can be enabled separately via the meta.json

```json
{
"daisy": {
"usb_midi": true
}
}
```

At the moment all midi messages will be merged between USB and UART MIDI interfaces. In the future it will likely be possible to assign additional UART pins and group them under a specific PD midi "port".

## [print] object

Printing to serial console can be enabled using the `debug_printing` flag in the meta.json:

```json
{
"daisy": {
"debug_printing": true
}
}
```

This will increase the program size with a few kb and will disable `usb_midi` as we currently do not have composite USB device yet.
26 changes: 22 additions & 4 deletions hvcc/generators/c2daisy/c2daisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
from . import parameters


hv_midi_messages = {
"__hv_noteout",
"__hv_ctlout",
"__hv_pgmout",
"__hv_touchout",
"__hv_bendout",
"__hv_midiout"
}


class c2daisy:
""" Generates a Daisy wrapper for a given patch.
"""
Expand Down Expand Up @@ -63,13 +73,20 @@ def compile(
else:
header, board_info = json2daisy.generate_header_from_name(board)

# remove heavy out params from externs
externs['parameters']['out'] = [
t for t in externs['parameters']['out'] if not any(x == y for x in hv_midi_messages for y in t)]

component_glue = parameters.parse_parameters(
externs['parameters'], board_info['components'], board_info['aliases'], 'hardware')
component_glue['class_name'] = board_info['name']
component_glue['patch_name'] = patch_name
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['debug_printing'] = daisy_meta.get('debug_printing', False)
component_glue['usb_midi'] = daisy_meta.get('usb_midi', False)
component_glue['has_midi'] = board_info['has_midi']

component_glue['copyright'] = copyright_c

Expand All @@ -82,16 +99,17 @@ def compile(
daisy_cpp_path = os.path.join(source_dir, f"HeavyDaisy_{patch_name}.cpp")

rendered_cpp = env.get_template('HeavyDaisy.cpp').render(component_glue)
with open(daisy_cpp_path, 'w') as file:
file.write(rendered_cpp)
with open(daisy_cpp_path, 'w') as f:
f.write(rendered_cpp)

makefile_replacements = {'name': patch_name}
makefile_replacements['linker_script'] = daisy_meta.get('linker_script', '')
if makefile_replacements['linker_script'] != '':
makefile_replacements['linker_script'] = f'../{daisy_meta["linker_script"]}'
makefile_replacements['linker_script'] = daisy_meta["linker_script"]
depth = daisy_meta.get('libdaisy_depth', 2)
makefile_replacements['libdaisy_path'] = f'{"../" * depth}libdaisy'
makefile_replacements['bootloader'] = daisy_meta.get('bootloader', False)
makefile_replacements['bootloader'] = daisy_meta.get('bootloader', '')
makefile_replacements['debug_printing'] = daisy_meta.get('debug_printing', False)

rendered_makefile = env.get_template('Makefile').render(makefile_replacements)
with open(os.path.join(source_dir, "Makefile"), "w") as f:
Expand Down
Loading

0 comments on commit 16e54f1

Please sign in to comment.