wind direction and speed added to supercollider

master
Rob Canning 2023-10-23 00:44:14 +02:00
parent 6b3d497a5b
commit fef370c2c1
2 changed files with 20 additions and 18 deletions

View File

@ -1,20 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<instant>
<Main x="0" y="0" w="1916" h="1036" current-tab="mixer"/>
<Editor id="49" edit-horizontal-pane-pos="0.82035928964614868" notebook-shrunk="0" edit-vertical-pane-pos="0.89999997615814209" mixer-width="Wide" zoom-focus="ZoomFocusPlayhead" zoom="729" grid-type="GridTypeBeat" snap-mode="SnapOff" internal-grid-type="GridTypeBeat" internal-snap-mode="SnapOff" pre-internal-grid-type="GridTypeBeat" pre-internal-snap-mode="SnapOff" edit-point="EditAtMouse" visible-track-count="-1" draw-length="GridTypeNone" draw-velocity="-1" draw-channel="-1" playhead="0" left-frame="0" y-origin="0" maximised="0" follow-playhead="1" stationary-playhead="0" mouse-mode="MouseRange" join-object-range="0" show-editor-mixer="1" show-editor-list="0" editor-list-page="0" show-marker-lines="0" show-touched-automation="0" nudge-clock-value="a1411200000@a0">
<Window name="Editor" visible="0" x-off="-1" y-off="-1" x-size="-1" y-size="-1" tabbed="1"/>
<Buttons>
<Press/>
<Release/>
</Buttons>
<Selection>
<StripableView id="240"/>
<StripableView id="308"/>
<StripableView id="376"/>
<StripableView id="172"/>
</Selection>
<EditorLocations clock-mode="Samples"/>
</Editor>
<Mixer mixer-rhs-pane1-pos="0.69696968793869019" mixer-rhs_pane2-pos="0.69999998807907104" mixer-list-hpane-pos="0.1111111119389534" mixer-inner-pane-pos="0.31874999403953552" narrow-strips="0" show-mixer="0" maximised="0" show-mixer-list="0" monitor-section-visible="1" foldback-strip-visible="0" show-vca-pane="0">
<Window name="Mixer" visible="0" x-off="-1" y-off="-1" x-size="-1" y-size="-1" tabbed="1"/>
</Mixer>
@ -44,4 +30,19 @@
<Clock name="ToolbarTimeInfo-selection-end" mode="Timecode" on="0"/>
<Clock name="ToolbarTimeInfo-selection-length" mode="Timecode" on="0"/>
</ClockModes>
<LastUsedSnapshot name="witw"/>
<Editor id="49" edit-horizontal-pane-pos="0.82035928964614868" notebook-shrunk="0" edit-vertical-pane-pos="0.89999997615814209" mixer-width="Wide" zoom-focus="ZoomFocusPlayhead" zoom="729" grid-type="GridTypeBeat" snap-mode="SnapOff" internal-grid-type="GridTypeBeat" internal-snap-mode="SnapOff" pre-internal-grid-type="GridTypeBeat" pre-internal-snap-mode="SnapOff" edit-point="EditAtMouse" visible-track-count="-1" draw-length="GridTypeNone" draw-velocity="-1" draw-channel="-1" playhead="0" left-frame="0" y-origin="0" maximised="0" follow-playhead="1" stationary-playhead="0" mouse-mode="MouseRange" join-object-range="0" show-editor-mixer="1" show-editor-list="0" editor-list-page="0" show-marker-lines="0" show-touched-automation="0" nudge-clock-value="a1411200000@a0">
<Window name="Editor" visible="0" x-off="-1" y-off="-1" x-size="-1" y-size="-1" tabbed="1"/>
<Buttons>
<Press/>
<Release/>
</Buttons>
<Selection>
<StripableView id="240"/>
<StripableView id="308"/>
<StripableView id="376"/>
<StripableView id="172"/>
</Selection>
<EditorLocations clock-mode="Samples"/>
</Editor>
</instant>

View File

@ -161,6 +161,10 @@ s.waitForBoot{
~dateTime=~data[0];
~windDirection=~data[13];
~windGust=~data[14]; // m/s
~windNorth=~data[16]; // m/s
~windEast=~data[18]; // m/s
~global_t = 0; // temperature C
~global_wD = 0; // wind direction 360degrees
@ -169,18 +173,16 @@ s.waitForBoot{
~time = Routine {
arg inval; var t = 0;
// itterate through data at a fixed rate // data point every 15mins
// 4sec = 1 hr 24 * 96seconds = 1 day // 9.6 seconds = 1 day @ 0.1.wait
loop {
t = (t + 1) % (~csvFile.size - 1) ;
~global_t = ~temperature[t];
~global_wD = ~windDirection[t];
postln( "index:" ++ t ++ " Date:" ++ ~dateTime[t] ++ " C:" ++ ~temperature[t] ++ " Wind Direction:" ++ ~windDirection[t] );
postln( t + " " + ~dateTime[t] + " C:" ++ ~temperature[t] + " Wind Dir: " + ~windDirection[t] + " Gust: " ++ ~windGust[t] + "North: " + ~windNorth[t] + "East: " + ~windEast[t]);
0.1.wait;
}}.play();
r = Routine { arg inval; var i = 0;
loop {
@ -252,4 +254,3 @@ r = Routine { arg inval; var i = 0;
r.stop;
~time.pause;