Giter Club home page Giter Club logo

Comments (5)

ojack avatar ojack commented on August 9, 2024 1

I am going to close this because it exists!

from hydra.

ojack avatar ojack commented on August 9, 2024

This actually already exists! but i hadnt mentioned it because i wasn't sure about the api/possibly has some bugs.

// run this line to start recording
vidRecorder.start()

// stop recording
vidRecorder.stop()

// set the output video as a source
s0.init({src: vidRecorder.output})

// display the source
src(s0).out()

from hydra.

echophon avatar echophon commented on August 9, 2024

This is great. Looking forward to playing with this. I'm a test engineer, so finding bugs is sort of my thing. Happy to provide feedback on experimental builds. Speaking of which- I saw that there was some NanoKontrol support for a bit but removed later on? I'm interested in that!

from hydra.

ojack avatar ojack commented on August 9, 2024

i put in a nanokontrol package mainly because i was performing with a nanokontrol! but then it caused build problems at some point and i took it out. But it turns out the web midi api is pretty straight forward without using any packages.
THis is code to initialize webmidi, you can then inspect the values and see what corresponds to what on your midi controller, and use that to change a variable.

navigator.requestMIDIAccess()
    .then(onMIDISuccess, onMIDIFailure);
//
function onMIDISuccess(midiAccess) {
    console.log(midiAccess);
    var inputs = midiAccess.inputs;
    var outputs = midiAccess.outputs;
    for (var input of midiAccess.inputs.values()){
        input.onmidimessage = getMIDIMessage;
    }
}
//
function onMIDIFailure() {
    console.log('Could not access your MIDI devices.');
}
//

getMIDIMessage = function(midiMessage) {
    var data = midiMessage.data
   /// do something with the data
}

from hydra.

ojack avatar ojack commented on August 9, 2024

I have used it to control the cutoff and scale of the microphone input so that I can adjust as the music changes. this is code for doing that using the nanokontrol:

cutoffMult = 10
scaleMult = 1.5
getMIDIMessage = function(midiMessage) {
    var arr = midiMessage.data
    var val = arr[2]
    var index = arr[1]
    if(arr[1] < 4) {
      a.settings[index].cutoff = val/cutoffMult
    }
    if(arr[1] > 15 && arr[2] < 20) a.settings[arr[1]-16].scale = val/scaleMult
}

from hydra.

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.