cv_trigger: a host-sized input count, and MIDI notes reach a CV note output - #1179
Conversation
…output
Three things a MIDI->CV bench on a Tulip found in an afternoon:
- AMY_MAX_CV_IN is #ifndef now and update_external_cv_in loops over it,
so a host can offer amy_external_coef_hook a channel that is not an
ADC at all -- a gate GPIO read as 0 or 5 V -- and a cv_trigger can
fire off a gate jack with no analog input spent on it.
- note_output_handle_event refused any note carrying note_source_channel
unless forward_midi_in, a flag only MIDI_OUT mode can set. The
feedback-loop guard is right for a MIDI port and has no loop to guard
against on a jack, so a MIDI keyboard never moved a CV/gate output.
The guard is MIDI_OUT only now.
- An empty velocity field in the CV_GATE config ("1,0,2,,12,24", the
doc's own example) was cast to channel 0, so every note-on wrote its
velocity over the pitch DAC. An unset arg stays unset.
And the doc: cv_trigger's scale and offset are OCTAVES with 0 at
ZERO_MIDI_NOTE (midi_note_for_logfreq), not semitones, and note_output's
comment claimed to be its exact inverse in semitones. api.md says so and
cv_pitch_for says how to convert.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The same #ifndef as AMY_MAX_CV_IN, for the same reason: a host with more control outputs than four -- here two DACs, two gates and two that only exist to be stamped -- names the count at build time, and the default stays what it was. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| // build time (-DAMY_MAX_CV_IN=3) to offer amy_external_coef_hook a | ||
| // channel that is not an ADC at all -- a gate GPIO read as 0 or 5 V, so |
There was a problem hiding this comment.
This is confusing. I can imagine a situation where ext_coef_in(2) actually reads a gate input, but AMY knows nothing about how that function interprets its arg. The comment seems to imply something more specific.
There was a problem hiding this comment.
Agreed -- that comment described what one host does with channel 2, and AMY has no view of that. Reworded to what AMY actually knows: the count of channels update_external_cv_in asks the hook for and the range a cv_trigger may name, with what a channel physically is left to the host.
🎛️ AMY HW CI (AMYboard bench)Flashed this PR's AMY (LoadTestChord: 6-voice Juno ✅ PASS — the bench ran the test to completion.
Full chord settled render μs: 2597 (was 2608, Δ -0.4%) (peak 2602, 39 samples) ⬇️ Artifacts: serial log · load trace · report Self-hosted bench (amyboardci). FAIL means only that the test could not run — the load values are informational, with no threshold and no audio compare. See |
⛓️ tulipcc integration PR openedThis merge was pinned into tulipcc for full-system CI: shorepine/tulipcc#1372 Test it there and merge that PR to move tulipcc onto this AMY. |
Three things found bringing a MIDI->CV converter (a Kenton Pro Solo) to a board whose gate input is a GPIO, not an ADC channel:
AMY_MAX_CV_INis#ifndefnow, andupdate_external_cv_inloops over it, so a host can build with-DAMY_MAX_CV_IN=3and answeramy_external_coef_hookfor a channel that is not analog at all -- a gate pin read as 0 or 5 V. Acv_triggercan then fire off a gate jack with no ADC input spent on it. Default and web behaviour unchanged.note_output_handle_eventrefused any note carryingnote_source_channelunlessforward_midi_in, a flag only MIDI_OUT mode can set. The feedback-loop guard is right for a MIDI port and has no loop to guard against on a jack, so a MIDI keyboard never moved a CV/gate output. The guard applies to MIDI_OUT only now.note_output='1,0,2,,12,24'(the doc's own example) cast the unset arg to channel 0, so every note-on wrote its velocity over the pitch DAC.Docs:
cv_trigger's scale and offset are octaves with 0 atZERO_MIDI_NOTE(midi_note_for_logfreq), not semitones, which api.md now says;cv_pitch_for's comment claimed to be that formula's exact inverse in semitones and now says how the two convert.🤖 Generated with Claude Code