-
Notifications
You must be signed in to change notification settings - Fork 63
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
Complex IOT device #952
Comments
One could take an object-oriented approach, where a Thing (instance, object) has properties, actions (methods) and events. In this case, the electronic keyboard is a Thing. Events: Sorry if it's inaccurate (and surely it's incomplete), I am not a musician. But in practice the OO design is quite well applicable when you define TDs (other might differ or warn about pitfalls - but as a start, try it) :). |
@zolkis Thanks for taking the time on this. s. |
I think that the above proposal is very sound. The best place to discuss is indeed here, we do not use issues only for bug reports but for discussions as well :) Thank you for the input @skavan ! |
ok - so if you don't mind. let's play with this a little more...hopefully as a template for other complex cases.
For the sake of simplicity, let's ignore the Synthesizer (for now) and focus on the "Keyboard". In this "Synthesizer-less" mode..the keyboard is used to send "messages" to other devices. The keyboard has up to 88 keys. To add some complexity, a follow on message might be triggered like: 0xA0 0x3C 0x7F --- which says (A0) aftertouch on Channel 1 (0) has been applied to note 3C with a pressure of 127 (7f). "Aftertouch" might cause the rendering synthesizer to play the note with vibrato. And to add a final level of complexity, a follow on message might say: 0xe0 0x7f 0x7f, which says, apply Pitch Bend (e) to all notes on channel 1 (0) with a value of 7f 7f. (Pitch bend is when a note slides up or down - like a guitarist sliding a note). It doesn't apply to a single note -- but to all "on notes" on the specified "channel". It is important to know that one doesn't need to track the state of 88 notes. But rather, only the notes that are on. And their attributes - where attributes maybe per "note" (i.e. aftertouch) or applied to all "on" notes. i.e. Pitch Bend. OK - that's enough for this simplified (but reasonably complex model) model. Now I will underwhelm you with:
My instinct is to create a property that is an array of "onKeys".
I have no idea how to describe on the key value (above) in the schema (above above!). Hope this makes vague sense and we can iterate to describe this example. |
@skavan please let me know if you question is answered and if I can close this issue. |
Thx. I guess it has run it's course! |
Hi,
I am almost certainly pushing this message in the wrong place....but have no idea where the right place is.
So feel free to kick me to the right place and close this "issue"...and apols for the clutter.
I have studied the docs (web things description) and many examples. But they are all rather simple devices.
A light switch, thermostat, dimmer and so forth.
I can find zero information on what the right approach to define a complex thing might be.
Example - an electronic keyboard.
It has 88 keys.
Keys can be On or Off. With additional properties, such as:
I can't figure out what is a thing, what are properties and so forth.
Is an individual key (on the keyboard) a thing? If so, what is the collection of keys? And it's parent properties?
Or is the whole keyboard a thing?
End game - to define a schema/data model that describes a real-world complex electronic device.
While I picked a keyboard as the example, it could just as easily be a sprinkler system, with multiple sprinkler heads.
Or an LED strip, with multiple addressable LED's.
If someone could kick me to the right place to ask this...and/or give me some pseudo code to get started...would be really grateful.
Thanks.
The text was updated successfully, but these errors were encountered: