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
Finalize syntax for crow as i2c follower #258
Comments
Ah, I should've probably commented here :| |
@simonvanderveldt Let's not worry about reorganization. Perhaps we can start a new thread once we have settled on a path forward? |
wow there is a thick maze of issues and PRs related to this :) i'm going to start with a dumb list of things a crow in follow mode should be able to do:
design decision is whether to have packed messages, ie, but this is about messages. we're talking about syntax. what's the current leading proposal? (my brain is mush after reading all those issues/etc) |
Here's a proposal for the command list. I've separated crow & TT as I think they should have different interfaces. Crow will support all the commands, but the exposed API should be different owing to the differing concerns of the 2 platforms. Crow API--- ACTIONS
-- basics
ii.crow.reset() -- resets the VM (like `crow.reset()` on norns)
ii.crow.volts(chan,val) -- was 'output'
ii.crow.slew(chan,time)
-- ASL actions (fully parameterized)
ii.crow.pulse(chan,time,level,polarity) -- trigger a pulse
ii.crow.ar(chan,attack,release,level,shape) -- trigger an AR envelope
ii.crow.lfo(chan,frequency,level,shape,ramp) -- starts (or resets) the LFO
-- generics (defined on the crow follower)
ii.crow.call1(arg)
ii.crow.call2(a,a2)
ii.crow.call3(a,a2,a3)
ii.crow.call4(a,a2,a3,a4)
--- QUERIES (return exactly 1 value)
-- basics
ii.crow.get('input',chan) -- current input voltage
ii.crow.get('output',chan) -- current output voltage (instantaneous, not destination)
-- generics (defined on the crow follower)
ii.crow.get('query0')
ii.crow.get('query1',a)
ii.crow.get('query2',a,a2)
ii.crow.get('query3',a,a2,a3) Teletype APIThis API is much more longer as TT users are used to setting static variables first, then calling actions separately. I don't think the meta commands are necesary as they would potentially not even fit on a single line. Focus here is on terseness, requiring memorization or a reference companion.
InputsI think we should only allow basic voltage query of the inputs. It would be too weird having functions to activate the crow input modes but then need to query the values. Pretty much the whole point of the input libs is that they are event based - the processing they do is very basic - what makes them special is the event-detection logic. crow <-> crow input events makes more sense, but it would change the mental model of the ii.self.event = function(e,val)
if e.name == 'input' then
-- process a direct input query
elseif e.name == 'change' then
-- process a change event detected on a remote device
end
end I could be convinced to implement this, but I can't see it being very exciting / enabling many more things. nb: This does not make sense on TT, so I would argue it be crow only. Crow syntaxInstead of worrying about these issues together, we can consider adding a special crow-ii library which enables some shortcuts, or alternative syntax. This is particularly aimed at crow<->crow communication (or controlled via norns). Rather than change how ii is implemented globally, it can be made as a translation layer in the user-space (means we don't break every other module in the process). -- This is what we'd write on on crow#2 directly
output[1].volts = 5
output[1].slew = 2
output[2]( lfo(0.1, 4) )
--- Now let's call those same functions via ii (from another crow)
-- These would be prefixed with `crow.` on norns
-- above proposed version (ie. same style as other ii devices)
ii.crow.volts( 1, 5 )
ii.crow.slew( 1, 2 )
ii.crow.lfo( 2, 0.1, 4 )
-- and we could add some magical indexing for pointing at hardware like tables
-- pro: feels more like normal crow indexing
-- con: we're indexing the *action* rather than the *hardware*
ii.crow.volts[1]( 5 )
ii.crow.slew[1]( 2 )
ii.crow.lfo[2]( 0.1, 4 )
-- the con above could be improved with explicit 'output' names
-- pro: more like normal crow
-- con: more verbose
ii.crow.output[1].volts( 5 )
ii.crow.output[1].slew( 2 )
ii.crow.output[2].lfo( 0.1, 4 )
-- the con above could be dealt with by the magical output indexing
-- pro: more terse
-- pro: 'feels like' the outputs are an extension of crow#1
-- con: opaque, not explicit, syntax sugar is too sweet
-- con: suggests that *all* of the normal output behaviour is available (it's not, and won't be)
output[5].volts( 5 )
output[5].slew( 2 )
output[6].lfo( 0.1, 4 ) I'm sure there's many other permutations that are better than these. My main point is we can separate the issues, and that the 'fancy syntax' issue is clearly secondary. |
+1 for getting some basics working first before adding some wrappers/syntactic sugar to make it look different/better integrated. Regarding the crow syntax as list at the top of your post: 👍
And I don't really understand the suggestion(s) mentioned in the "Input" section :/ |
|
@trentgill looks excellent i'd vote for this, despite its verbosity:
least confusing and weird. most continuity with normal main question is (ugghh) multiple crow remotes. i guess at this point the outputs could "magic index" ie |
@tehn Thanks for the clarifications.
How would this work then? The
Will the same convention then also be applied to all the other ii devices instead of the current
Why not just do the simple thing by indexing the crows? So |
The No magic numbering. In fact the
I don't think so. If we do this it'll need to be a per-module helper library. We'd have to drastically change the way the ii files were generated if we wanted to have a special handling for an 'index' parameter. I don't think it makes sense to break the existing API for other modules. We're talking about doing this for crow in particular in order to keep things feeling more consistent within the crow ecosystem. Imagine a user who's only use of
///////////////////////////////////// Ok. Seems like we're on the same page about what the initial implementation should be. Feels like a great start and if we make it clear that it's experimental support we should be able to get some good feedback on the interface. |
Isn't the group of people with crow + some other ii device much larger, though? |
You are probably right which I think reinforces our "let's make it work in the existing model first" approach. crow to crow communication feels like an easy opportunity to explore any syntax changes because we can control both sides of the equation with a single firmware. Even if we do extend the syntax possibilities, I don't imagine we would disable the current style. This discussion can be treated as added functionality, rather than a breaking change, and as such should be discussed in its own Issue. |
See #250 for discussion.
Relates strongly to #55
The text was updated successfully, but these errors were encountered: