• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    Radiation detector send to trigger lights

    How To... ?
    6
    24
    16250
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DusX
      DusX Tech Staff @GertjanB last edited by

      @gertjanb said:

      Every time the Javascript acter is triggered it reads the file again

       The reading of external files can be done 2 ways. Using the Read() and Include() functions.

      Include must be the first line of your code, and will simply include the text in the file passed to it as additional Javascript. (parsed inline with your code after).

      Read can put the text content of a file into a variable. This one can be used on command.

      If using Include(), the command is run on Initialization of the javascript actor (this can be triggered via a User Actor on/off if within an user actor)

      Read() can be called as part of a function. I wouldn't suggest calling it constantly (this will be a slowdown to the system), rather use a trigger input to call the function containing Read() when required.

      Either of these can help you with reading JSON, but I would recommend Read() for getting data, and Include() for code Libraries (CSV parsing libs, XML parsing libs etc..)

      Troikatronix Technical Support

      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
      • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

      Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

      J 2 Replies Last reply Reply Quote 0
      • J
        JetJaguar @DusX last edited by

        @dusx: Thanks! That will be very helpful if we deal with files. Trying to understand how to have OSC listener "hear" the network send from LabView in real time?

        Portland, Oregon
        Mac Pro Retina 2013: 2.6 GHz Intel Core i7, 16 GB DDR3 Ram
        iMac 5K: 4 GHz quad-core Intel Core i7, 32 GB DDR3 SDRAM

        Michel Skulpture 2 Replies Last reply Reply Quote 0
        • Michel
          Michel Izzy Guru @JetJaguar last edited by

          @jetjaguar

          open the communication menu --> stream setup --> and click on auto-detect input. The source machine has to send to the IP address of the receiving computer.

          Best Michel

          Michel Weber | www.filmprojekt.ch | rMBP (2019) i9, 16gig, AMD 5500M 8 GB, OS X 10.15 | located in Winterthur Switzerland.

          1 Reply Last reply Reply Quote 0
          • Skulpture
            Skulpture Izzy Guru @JetJaguar last edited by

            @jetjaguar said:

            @dusx: Thanks! That will be very helpful if we deal with files. Trying to understand how to have OSC listener "hear" the network send from LabView in real time?

            You basically need to know the IP address and the port number it is sending to.

            It's a little hard to explain how this work over text/written words.

            Graham Thorne | www.grahamthorne.co.uk
            RIG 1: Custom-built PC: Windows 11. Ryzen 7 7700X, RTX3080, 32G DDR5 RAM. 2 x m.2.
            RIG 2: Laptop Dell G15: Windows 11, Intel i9 12th Gen. RTX3070ti, 16G RAM (DDR5), 2 x NVME M.2 SSD.
            RIG 3: Apple Laptop: rMBP i7, 8gig RAM 256 SSD, HD, OS X 10.12.12

            1 Reply Last reply Reply Quote 0
            • dbini
              dbini last edited by

              also> check the OSC port number in Preferences. it needs to be the same as the one being used by your interface application to send the OSC. i think i remember correctly that the default is 1234. if you change it in Izzy, you need to restart Izzy for it to take effect. and> OSC coming into Izzy needs to start with a forward slash.

              John Collingswood
              taikabox.com
              2019 MBPT 2.6GHZ i7 OSX15.3.2 16GB
              plus an old iMac and assorted Mac Minis for installations

              1 Reply Last reply Reply Quote 0
              • Skulpture
                Skulpture Izzy Guru last edited by

                A tutorial I did for TouchOSC and Isadora. The methods are the same, just pretend Touch OSC is instead LabView (....kinda)

                Graham Thorne | www.grahamthorne.co.uk
                RIG 1: Custom-built PC: Windows 11. Ryzen 7 7700X, RTX3080, 32G DDR5 RAM. 2 x m.2.
                RIG 2: Laptop Dell G15: Windows 11, Intel i9 12th Gen. RTX3070ti, 16G RAM (DDR5), 2 x NVME M.2 SSD.
                RIG 3: Apple Laptop: rMBP i7, 8gig RAM 256 SSD, HD, OS X 10.12.12

                1 Reply Last reply Reply Quote 2
                • J
                  JetJaguar last edited by

                  Excellent! Will play with all of this over next week or so, great community of support for Izzy. 

                  Portland, Oregon
                  Mac Pro Retina 2013: 2.6 GHz Intel Core i7, 16 GB DDR3 Ram
                  iMac 5K: 4 GHz quad-core Intel Core i7, 32 GB DDR3 SDRAM

                  1 Reply Last reply Reply Quote 1
                  • J
                    JetJaguar @DusX last edited by

                    @dusx- Could you explain this more? It is looking more like a live OSC send will not work with the hardware we have available. When you say Read () and Include (). What are you putting that into, a text file? what actor are you using to get the info into Isadora? Javascript actor? Thanks.

                    Portland, Oregon
                    Mac Pro Retina 2013: 2.6 GHz Intel Core i7, 16 GB DDR3 Ram
                    iMac 5K: 4 GHz quad-core Intel Core i7, 32 GB DDR3 SDRAM

                    DusX 1 Reply Last reply Reply Quote 0
                    • DusX
                      DusX Tech Staff @JetJaguar last edited by

                      @jetjaguar

                      These are Javascript functions. These functions are specific to Javascript in Isadora, they have been added to facilitate external data.

                      This tutorial covers the use of include() https://support.troikatronix.c...
                      read() is easier, it takes what ever text is in the file and stores it in memory, you can then assign it to a variable.

                      var myText = read("path/to/data/file.txt");

                      this line of code will read the file.txt file and store its contents in myText.
                      If this file contains JSON formatted data, you can use JSON.parse() to convert the data into a native Javascript data format.

                      var objData = JSON.parse(myText);

                      above we take the text content of myText and parse it into a Javascript object (think array for now).

                      The tutorial linked above also covers some basics of JSON, so it may be helpful in understanding what JSON.parse() does as well.

                      Since read() unlike include() doesn't need to be located an the first line of your Javascript code, it is possible to use it in a way that will read the external file continuously.
                      You should however limit the speed at which this file is being read (determined by how the code is constructed). Also, depending on how this external text file is created/written to, you may experience a file lock.
                      Where both the writer and reader try to access the file at the same time. I am not sure what the outcome of this situation would be, perhaps just a Javascript error for that attempt.


                      Troikatronix Technical Support

                      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                      • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                      Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        JetJaguar @DusX last edited by

                        @dusx- Thank you! Right now we are reading our .text file as an array with the DataArray actor and getting excellent results. I will look at the tutorial if we decide to go this route. 

                        Portland, Oregon
                        Mac Pro Retina 2013: 2.6 GHz Intel Core i7, 16 GB DDR3 Ram
                        iMac 5K: 4 GHz quad-core Intel Core i7, 32 GB DDR3 SDRAM

                        DusX 1 Reply Last reply Reply Quote 1
                        • DusX
                          DusX Tech Staff @JetJaguar last edited by DusX

                          @jetjaguar

                          Just did a quick test, and reading a txt file at 120hz (not suggested) that contained a single number.
                          Where I had the txt file open in a text editor and manually changed and saved the file numerous times caused 0 issues, so the file lock consideration seems minimal (and would be the same for the data array).

                          the code used for loading a single value in a text file called read.txt:

                          function main()
                          {
                          var i = read('read.txt');
                          return [i];
                          }

                          the above code runs every time an input come into the Javascript actor.
                          To run this at a specific rate, I connected a Pulse Generators trigger output to the Javascript actors input 1.
                          Then the code will be run each time the pulse triggers the JS actor.

                          Troikatronix Technical Support

                          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                          1 Reply Last reply Reply Quote 2
                          • First post
                            Last post