From c9dc69fb835ff0fbe674f1102ab3188f6d9baadd Mon Sep 17 00:00:00 2001 From: Petr Horacek Date: Sun, 17 Sep 2023 20:57:05 +0200 Subject: [PATCH] track: Implement basic audio passthrough Signed-off-by: Petr Horacek --- eurorack/Cargo.lock | 21 +++++++++ eurorack/Cargo.toml | 2 +- hardware/Module.kicad_pro | 85 +++++++++++++++++++++++++++++++++--- instruments/traky/src/lib.rs | 7 ++- 4 files changed, 103 insertions(+), 12 deletions(-) diff --git a/eurorack/Cargo.lock b/eurorack/Cargo.lock index 52c62a3..3b9f42e 100644 --- a/eurorack/Cargo.lock +++ b/eurorack/Cargo.lock @@ -179,6 +179,7 @@ dependencies = [ "cortex-m", "cortex-m-rt", "cortex-m-semihosting", + "num_enum", "stm32-fmc", "stm32h7xx-hal", ] @@ -469,6 +470,26 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "panic-probe" version = "0.3.0" diff --git a/eurorack/Cargo.toml b/eurorack/Cargo.toml index 38a0417..34514f1 100644 --- a/eurorack/Cargo.toml +++ b/eurorack/Cargo.toml @@ -41,7 +41,7 @@ defmt = "0.3" defmt-rtt = "0.3" panic-probe = { version = "0.3", features = ["print-defmt"] } stm32h7xx-hal = { version = "0.12", features = ["stm32h750v", "rt", "revision_v",] } -daisy = { version = "0.7", features = ["seed"] } +daisy = { version = "0.7", features = ["seed_1_1"] } display-interface-spi = "0.4" ssd1306 = "0.7.0" fugit = "0.3" diff --git a/hardware/Module.kicad_pro b/hardware/Module.kicad_pro index 8b268d2..acb6cea 100644 --- a/hardware/Module.kicad_pro +++ b/hardware/Module.kicad_pro @@ -1,5 +1,6 @@ { "board": { + "3dviewports": [], "design_settings": { "defaults": { "board_outline_line_width": 0.049999999999999996, @@ -57,20 +58,26 @@ "rule_severities": { "annular_width": "error", "clearance": "error", + "connection_width": "warning", "copper_edge_clearance": "error", + "copper_sliver": "warning", "courtyards_overlap": "error", "diff_pair_gap_out_of_range": "error", "diff_pair_uncoupled_length_too_long": "error", "drill_out_of_range": "error", "duplicate_footprints": "warning", "extra_footprint": "warning", + "footprint": "error", "footprint_type_mismatch": "error", "hole_clearance": "error", "hole_near_hole": "error", "invalid_outline": "error", + "isolated_copper": "warning", "item_on_disabled_layer": "error", "items_not_allowed": "error", "length_out_of_range": "error", + "lib_footprint_issues": "warning", + "lib_footprint_mismatch": "warning", "malformed_courtyard": "error", "microvia_drill_out_of_range": "error", "missing_courtyard": "ignore", @@ -80,9 +87,14 @@ "padstack": "error", "pth_inside_courtyard": "ignore", "shorting_items": "error", + "silk_edge_clearance": "warning", "silk_over_copper": "warning", "silk_overlap": "warning", "skew_out_of_range": "error", + "solder_mask_bridge": "error", + "starved_thermal": "error", + "text_height": "warning", + "text_thickness": "warning", "through_hole_pad_without_hole": "error", "too_many_vias": "error", "track_dangling": "warning", @@ -91,7 +103,6 @@ "unconnected_items": "error", "unresolved_variable": "error", "via_dangling": "warning", - "zone_has_empty_net": "error", "zones_intersect": "error" }, "rule_severitieslegacy_courtyards_overlap": true, @@ -101,18 +112,63 @@ "allow_microvias": false, "max_error": 0.005, "min_clearance": 0.0, + "min_connection": 0.0, "min_copper_edge_clearance": 0.024999999999999998, "min_hole_clearance": 0.25, "min_hole_to_hole": 0.25, "min_microvia_diameter": 0.19999999999999998, "min_microvia_drill": 0.09999999999999999, + "min_resolved_spokes": 2, "min_silk_clearance": 0.0, + "min_text_height": 0.7999999999999999, + "min_text_thickness": 0.08, "min_through_hole_diameter": 0.3, "min_track_width": 0.19999999999999998, "min_via_annular_width": 0.049999999999999996, "min_via_diameter": 0.39999999999999997, + "solder_mask_to_copper_clearance": 0.0, "use_height_for_length_calcs": true }, + "teardrop_options": [ + { + "td_allow_use_two_tracks": true, + "td_curve_segcount": 5, + "td_on_pad_in_zone": false, + "td_onpadsmd": true, + "td_onroundshapesonly": false, + "td_ontrackend": false, + "td_onviapad": true + } + ], + "teardrop_parameters": [ + { + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_target_name": "td_round_shape", + "td_width_to_size_filter_ratio": 0.9 + }, + { + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_target_name": "td_rect_shape", + "td_width_to_size_filter_ratio": 0.9 + }, + { + "td_curve_segcount": 0, + "td_height_ratio": 1.0, + "td_length_ratio": 0.5, + "td_maxheight": 2.0, + "td_maxlen": 1.0, + "td_target_name": "td_track_end", + "td_width_to_size_filter_ratio": 0.9 + } + ], "track_widths": [ 0.0, 0.3, @@ -125,7 +181,8 @@ "zones_allow_external_fillets": false, "zones_use_no_outline": true }, - "layer_presets": [] + "layer_presets": [], + "viewports": [] }, "boards": [], "cvpcb": { @@ -309,18 +366,23 @@ "rule_severities": { "bus_definition_conflict": "error", "bus_entry_needed": "error", - "bus_label_syntax": "error", "bus_to_bus_conflict": "error", "bus_to_net_conflict": "error", + "conflicting_netclasses": "error", "different_unit_footprint": "error", "different_unit_net": "error", "duplicate_reference": "error", "duplicate_sheet_names": "error", + "endpoint_off_grid": "warning", "extra_units": "error", "global_label_dangling": "warning", "hier_label_mismatch": "error", "label_dangling": "error", "lib_symbol_issues": "warning", + "missing_bidi_pin": "warning", + "missing_input_pin": "warning", + "missing_power_pin": "error", + "missing_unit": "warning", "multiple_net_names": "warning", "net_not_bus_member": "warning", "no_connect_connected": "warning", @@ -330,6 +392,7 @@ "pin_to_pin": "warning", "power_pin_not_driven": "error", "similar_labels": "warning", + "simulation_model_issue": "ignore", "unannotated": "error", "unit_value_mismatch": "error", "unresolved_variable": "error", @@ -347,7 +410,7 @@ "net_settings": { "classes": [ { - "bus_width": 12.0, + "bus_width": 12, "clearance": 0.1999, "diff_pair_gap": 0.25, "diff_pair_via_gap": 0.25, @@ -361,13 +424,15 @@ "track_width": 0.25, "via_diameter": 0.8, "via_drill": 0.4, - "wire_width": 6.0 + "wire_width": 6 } ], "meta": { - "version": 2 + "version": 3 }, - "net_colors": null + "net_colors": null, + "netclass_assignments": null, + "netclass_patterns": [] }, "pcbnew": { "last_paths": { @@ -383,6 +448,8 @@ "schematic": { "annotate_start_num": 0, "drawing": { + "dashed_lines_dash_length_ratio": 12.0, + "dashed_lines_gap_length_ratio": 3.0, "default_line_thickness": 6.0, "default_text_size": 79.0, "field_names": [], @@ -414,7 +481,11 @@ "page_layout_descr_file": "", "plot_directory": "plot", "spice_adjust_passive_values": false, + "spice_current_sheet_as_root": false, "spice_external_command": "spice \"%I\"", + "spice_model_current_sheet_as_root": true, + "spice_save_all_currents": false, + "spice_save_all_voltages": false, "subpart_first_id": 65, "subpart_id_separator": 0 }, diff --git a/instruments/traky/src/lib.rs b/instruments/traky/src/lib.rs index e9193d1..8f3698d 100644 --- a/instruments/traky/src/lib.rs +++ b/instruments/traky/src/lib.rs @@ -37,13 +37,12 @@ impl InstrumentTrait for Instrument { fn process(&mut self, buffer: &mut [(f32, f32)], _randomizer: &mut impl ProtonRandomizer) { for chunk in buffer.chunks_exact_mut(32) { - let mut buffer = [0.0; 32]; + let mut buffer = [(0.0, 0.0); 32]; for (i, x) in chunk.iter_mut().enumerate() { - buffer[i] = x.0; + buffer[i] = *x; } - // TODO Process here for (i, x) in buffer.iter_mut().enumerate() { - chunk[i] = (*x, 0.0); + chunk[i] = *x; } } }