How to incorporate inputs into project - good practices


I have App that has some inputs, for example:
FFT / GIST (values)
Physical buttons (booleans)
Speech recognition (string)

I want to use this data in various places - UI, audio analysis, logic, etc.

Do I:

  • define them in my App record with their respective data type and fill them with Update
  • make them into Observables
  • is there something better to use?

I always used first approach for this and then just grab them out of my App with operations like GetFFT, but I wonder if this is the right approach?


Did you have a look at @dottore’s Model-Runtime-Editor pattern?

That’s the pattern I’ve been using ever since to build applications, and I believe it would give you an answer on where/how to manage those sources you’re talking about.

I think there is no easy way, to make it feel proper you need some sort of parameters manager where you intersect with controllers but having this is a bit usually hard to maintain…

do you see any particular issues with this approach?

@sebescudie I did, but around 2 years ago and it was not really clicking with me back then, I will have another look.

@joreg in principle nothing, I want to make an App that will be readable by other coders if the need arises, and I was not really sure if there is not some wierd thing happening with order of operations - like I get some input frame later from what I would expect, etc. I think I just wanted to hear if this is normal use of record and some coder after me wont roll his eyes when he sees me pumping FFT into record on every frame or something.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.