Jump to content
Sign in to follow this  
hujairi

Help with Processing Live Weather Data in Opusmodus

Recommended Posts

Hello,

 

I am working on a sound installation for two voices (using Soniccouture's Geosonics VST plugin and a vibraphone VST plugin running through a computer). The source of the data is taken live from the internet and is actually API weather data from a city in South Korea. The piece will play for 2 hours every night between early December and early March. 

 

The trouble I am having is how to transform the different fragments of weather data into data I could use within Opusmodus. Here's the type of data that I get according to each parameter (the options are either floating points, integers, or T/F). All of this is on my computer as OSC signals.

 

1. wind direction: floating points, between 0 and 360.0

2. wind speed: floating points

3. sky code (i.e., clear, cloudy, rain, snow): integers

4. precipitation type: integers (codes for each type of precipitation) 

5. temperature (celcius): floating points

6. temperature minimum: floating points

7. temperature maximum: floating points

8. humidity: floating points (representing percentage, example 31.1% = 31.1)

9. pressure: float points (time of writing this, pressure of the place I was looking at was 1008.9 while here in Seoul, the pressure is 922.8)

10. lightning: True or False option

 

 

My questions are: 

- How can I receive OSC signals within Opusmodus? Is there a function that allows me to do this?

- I've never used the Live Coding function in Opusmodus although I've got a basic knowledge of live coding within other environments such as SuperCollider, Sonic Pi, and Max/MSP. I would like to have the data control the live coding functions modulate the music as it plays live. 

 

I would really, really appreciate any advice I may get on this. I don't mean to have the community here 'do everything' for me, but I'd appreciate any direction I may get in successfully accomplishing this project.  

 

Thanks very much and sorry for any trouble,

Hasan

Share this post


Link to post
Share on other sites

>  How can I receive OSC signals within Opusmodus? Is there a function that allows me to do this?

 

There are OSC libraries for plain Common Lisp out there that you could use, e.g., https://github.com/zzkt/osc or its fork https://github.com/jamieforth/osc

 

Just found these via Google :)

 

Best,

Torsten

Share this post


Link to post
Share on other sites

Dear Hasan,

I could send you few examples on how to use the OSC library and how to send the signal to the OSC devices (Reaktor, etc...). 

In order to help I would need to know which of the data will be a length, pitch, etc... and that data will be for OSC controllers.

In Opusmodus any data can be courted to any of the 4 parameters or to OSC values (floating points).

You most have some idea how you would like to use the data in Opusmodus, please explain a bit more the structure.

 

Share this post


Link to post
Share on other sites

would be also interesting for me/my work!

greetings

andré

Share this post


Link to post
Share on other sites

Dear Janusz,

 

How about using the following four parameters:

 

Length (according to range): wind direction (degrees): floating points, between 0 and 360.0

Dynamics: wind speed (m/s): floating points

Pitch: temperature (celcius): floating points

Chance of randomly modulating length (according to range of Humidity): Humidity (percentage): floating points

 

Do you think this can be done? I've attached a screenshot of what I'm currently working with to receive weather API data.

 

Thanks.

Screen Shot 2017-10-28 at 2.16.16 PM copy.png

Share this post


Link to post
Share on other sites

Are you collecting the data each day?

Could you send me the data for each of the 4 parameters.

 

For example the function VECTOR-TO-LENGTH could generate the lengths:

(setf l-data '(87.10115 149.16446 261.51358 97.36691 349.27936 279.12173 133.68344 313.95352
               324.80905 50.51986 137.61513 277.79932 142.74834 194.98927 224.3649 188.95398
               114.017494 214.18486 340.42432 175.74698 350.46225 184.5418 153.89604 325.713))
               
(setf l-scale-data (append '(0.0) l-data '(360.0)))
(setf length (butlast (rest (vector-to-length '1/16 1 16 l-scale-data))))
=> (5/16 7/16 3/4 5/16 1 13/16 7/16 7/8 15/16 3/16 7/16 13/16
    7/16 9/16 5/8 9/16 3/8 5/8 15/16 1/2 9/16 7/16 15/16)

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Topics

    • By Jorvd
      Hi everyone,

      For the past two days I've been messing around with SuperCollider and OM.
      I want to be able to write my score in OMN format and send it via OSC to SuperCollider.
      So far I have this in OM:
      (defparameter to-sc '(127.0.0.1 57120)) (setf thd1 (create-osc-thread "thread1" to-sc)) (send-osc-data thd1 '( (12 1/2) (2 1/2) (0 1/2) (3 1/2) (14 1/2) (2 1/2) (0 1/2) (3 1/2) (8 1/2) (2 1/2) (0 1/2) (3 1/2) (7 1/2) (2 1/2) (0 1/2) (3 1/2) )) And this in SuperCollider
      (OSCdef.new( \toggle, { arg msg, time, addr, port; [msg, time, addr, port].postln; Synth(\synth1, [pitch:msg[1]+60]); }, '/thread1' ); ) ( SynthDef('synth1', { arg pitch=60, amp=0.2, ffreq=15000; var linen, env, sig1, sig2; linen = Env.linen(0.01, sustainTime:0, releaseTime:1); env = EnvGen.kr(linen, doneAction:2); sig1 = Mix(VarSaw.ar([pitch.midicps], 0, 0.5)); sig2 = LPF.ar(sig1, ffreq); Out.ar(0, sig2* env * amp); }).add; ) And this works great! However I would like to write my OM script in regular OMN format and then convert it to integers, which SuperCollider understands.
      I've tried to do this like so:
      (setf convert-test '( (q a3 e4 c4 f4) (q e3 b4 a3 c4))) (setf data (gen-osc-data 16 (pitch-to-midi (omn :pitch convert-test)) :time (flatten (omn :length convert-test)) :min 0 :max 127)) However, it seems like "gen-osc-data" really wants to use floating values, adding the Min and Max does seem to convert these values in the range 0-127 but still I end up having the wrong notes:
      (setf data (gen-osc-data 16 (pitch-to-midi (omn :pitch convert-test)) :time '(1/2 1/4 1/12 1/12 1/12) :min 0 :max 127)) >> (((0 91 127) 1/2) ((27 127 0) 1/4) ((0 106 127) 1/12) ((0 127 64) 1/12) ((0 91 127) 1/12) ((27 127 0) 1/2) ((0 106 127) 1/4) ((0 127 118) 1/12) ((0 127 118) 1/12) ((0 127 118) 1/12)....  
      Any ideas on a straightforward method to deal with this? I hope my question is understandable, this is by far the most challenging project I've tried in OM, any help would be very appreciated!
      NOTE: I know that I can just send MIDI notes to SC however I would like to control my Synth Parameters via OSC and I'm a big fan of consistency, therefor it would be great if the Pitch and Length information also could be converted and send via OSC messages.

      Thanks very much in advance!
      - Jor
    • By opmo
      Forthcoming ver. 1.4
      Function: CHORALIS

       
         
       
       

       
    • By AM
      ;;; ...an idea ;;; how to import some TEXT and translate it to integer-sequences to use this data ;;; for LIVE-CODING. also possible without .txt, but i tried to IMPORT it. perhaps ;;; in your live-coding session a friend of you is writing the text in a different ;;; location and you could share it (the path) via CLOUD :-D ;;; i know, this kind of data... is not very smart, but a little bit steam-punky :-) (defparameter *map-integer1* '(((a à á â ã ä å æ ą) 0) (b 1) ((c ç ć) 2) (d 3) ((e è é ê ë ę) 4) (f 5) (g 6) (h 7) ((i ì î ï) 8) (j 9) (k 10) ((l ł) 11) (m 12) ((n ñ ń) 13) ((o ò ó ô õ ö) 14) (p 15) (q 16) (r 17) ((s ś ß) 18) (t 19) ((u ù ú û ü) 20) (v 21) (w 22) (x 23) ((y ý ÿ) 24) ((z ż ź) 25))) ;;; 1) open/write a .txt-file ;;; 2) define your path (inside the loop) ;;; 3) start the loop ;;; 4) write/change your .txt, and SAVE it ;;; => every 2 seconds it will be read by the code (loop repeat 60 do (progn (print (progn (setf x (string-to-list (let ((in (open "/Users/meierandre/Desktop/test.txt"))) ;; use your own path!! (read-line in)))) (text-map *map-integer1* (loop for i in x append (explode i))))) (print x)) do (sleep 2)) ;;; every 2 seconds the loop is reading your .txt, change variable x and PRINT it  
      for this example i used PRINT (so you see what is happening), but you could also "rewrite" a variable inside your sound-live-coding-CODE/FUNCTION
       
       

      Bildschirmvideo aufnehmen 2019-11-02 um 23.16.58.mov  
×
×
  • Create New...