Coder Social home page Coder Social logo

Make capabilities consume parameters about rune HOT 4 OPEN

hotg-ai avatar hotg-ai commented on May 30, 2024
Make capabilities consume parameters

from rune.

Comments (4)

kthakore avatar kthakore commented on May 30, 2024 1

Another would be get GPIO from a device input pin.

Some other phone sensors are here:

https://github.com/SensingKit/SensingKit-iOS

from rune.

Michael-F-Bryan avatar Michael-F-Bryan commented on May 30, 2024

I think this ticket comes in two pieces.

The first piece is internal and involves adding a mechanism that transforms Runefile arguments into method calls on the generated code.

For example, this line

CAPABILITY<I16[24000]> audio SOUND --hz 16000 --samples 150 --sample-size-ms 1500

Would need to be converted into a bunch of calls which tell the host to configure the SOUND capability so that we get 1500ms worth of samples taken at 16kHz. This would be a once-off step which gets run from _manifest().


The second part will be identifying the various knobs and levers that we want to expose and wiring them into the runtime. At the moment the Rust runtime is very bare-bones and doesn't let you configure anything.

I'm not 100% sure what these would be, but I'm guessing @meelislootus and @kthakore will have a list.

from rune.

Michael-F-Bryan avatar Michael-F-Bryan commented on May 30, 2024

With #72 things are set up so you can set a capability object's properties. Now we just need to figure out which properties to implement and their semantics for the PC and mobile runtimes.

@meelislootus, @Mi1ind, and @kthakore I'm completely spitballing here, so feel free to post suggestions or alterations.

Random

Fill a buffer with random data.

(nothing needed, number of bytes can be inferred from the buffer's size)

Accelerometer

A capability which gives you an array of [f32; 3] samples containing the acceleration in the X/Y/Z direction.

General:

  • n | samples - the number of samples we want (could also be inferred from the destination buffer size?)

Phone:

  • sample_rate - How frequently to sample the accelerometer
  • duration - How long we should be taking samples for (note: samples = duration * sample_rate so this could be unnecessary)

Image

Fill a buffer with a single image.

General:

  • grayscale - convert the image's 3 RGB channels into one
  • width and height - ask the capability to resize the image to the desired dimensions

Video

(note: I've split this out from the image capability)

A capability which fills the provided buffer with a series of images (e.g. u8[num_samples x height x width x channels]).

General:

  • samples - the number of images to use
  • (all the other Image properties)

Phone:

  • sample_frequency - when recording video in real time

Sound

Fill a buffer with PCM formatted audio samples.

General:

  • samples - the number of samples (could be inferred from the buffer size?)

Phone:

  • hz | frequency - the frequency to record audio at
  • sample_duration | sample_duration_ms - how long to record samples for

from rune.

kthakore avatar kthakore commented on May 30, 2024

@meelislootus @Ge-te the mobile runtime may not be using the parameters for the capabilities to massage in the inputs for the Rune.

from rune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.