Skip to content

Commit

Permalink
added heading events & test; added course to locate event
Browse files Browse the repository at this point in the history
  • Loading branch information
danomatika committed Nov 17, 2013
1 parent 796f537 commit 22b0089
Show file tree
Hide file tree
Showing 19 changed files with 424 additions and 125 deletions.
24 changes: 21 additions & 3 deletions doc/PdParty_User_Guide.md
@@ -1,4 +1,4 @@
PdParty 0.4.4-alpha
PdParty 0.4.5-alpha
===================

Copyright (c) [Dan Wilcox](danomatika.com) 2011-13
Expand Down Expand Up @@ -193,7 +193,9 @@ These settings are mainly for live performance reasons where you don't want the

These are useful options for patch creation & debugging. Basically, you can send accelerometer, touch, and key\* events from the device to your computer while you work on your patch/scene in Pure Data. You can also receive live Pd prints from a running patch/scene in PdParty to make sure everything is working as expected.

The OSC server needs to be enabled and a patch/scene must be running in order for events to be streamed.
The OSC server needs to be enabled and a patch/scene must be running in order for events to be streamed. The easiest option is to run an existing patch or upload an empty one you can run while sending events. Event sending *will not* work unless a patch or scene is being run.

_Note: Locate & Heading events require the services to be enabled within the patch/scene before any events will be sent. Also, certain scene types do not support all events, please see "Scenes" in "Patching for PdParty" for more info._

\* *requires a usb/bluetooth keyboard*

Expand Down Expand Up @@ -326,9 +328,14 @@ PdParty returns the following events:
* _lon_: longitude in degrees
* _alt_: altitude from sea level in meters, + above & - below
* _speed_: average speed in meters per second (not guaranteed to be accurate), invalid if negative
* _course_: direction of travel in degrees -> 0 N, 90 S, 180 S, 270 E, invalid if negative
* _horz_accuracy_: horizontal accuracy (+/-) of the lat & lon in meters
* _vert_accuracy_: vertical accuracy (+/-) of the alt in meters
* _timestamp_: timestamp string, format yyyy-MM-dd HH:mm:ss zzz (ex: 2013-11-13 17:13:17 EST)
* **[r #heading] _degrees_ _accuracy_ _timestamp_**: orientation toward magnetic north with the top of UI at 0 degrees
* _degrees_: heading toward magnetic north -> 0 N, 90 S, 180 S, 270 E
* _accuracy_: +/- accuracy deviation of the heading value in degrees, a negative vale is invalid (device is not calibrated, etc)
* _timestamp_: timestamp string, format yyyy-MM-dd HH:mm:ss zzz (ex: 2013-11-13 17:13:17 EST)

_Note: RjDj scenes only receive #touch & #accelerate, PdDroidParty scenes do not receive any events, PdParty & Patch scenes receive all events. This is mainly for explicit compatibility (although it could be argued in the cause of RjDj as the RjDj app is no longer available)._

Expand All @@ -353,7 +360,18 @@ Since running the GPS location service will affect battery life in most cases, i

It usually takes a few seconds to fix your position after enabling the location services.

_Note: Locate events are only available in PdParty & Patch scene types._
_Note: Locate events are only available in PdParty & Patch scene types. Events work best on devices with multiple location sensors (phone) and may not work on some devices at all._

#### Heading (Compass) Control

A heading event is simply the compass orientation toward magnetic north with the top of the current UI orientation being at 0 degrees.

Like locate events, the tracking the heading requires extra resources so it must be manual started by the scene after it is loaded by sending messages to the internal #pdparty receiver:

* **#pdparty heading _value_**: heading service run control
* **#pdparty heading filter _degrees_**: the minimum amount of change in degrees required before a heading event is generated (default 1), a value of 0 indicates no filtering, negative values are clipped to 0

_Note: Heading events are only available in PdParty & Patch scene types. Events work best on devices with a digital compass (phones) and may not work on some devices at all._

#### Recording

Expand Down
2 changes: 2 additions & 0 deletions res/Defaults.plist
Expand Up @@ -16,6 +16,8 @@
<false/>
<key>locateSendingEnabled</key>
<false/>
<key>headingSendingEnabled</key>
<false/>
<key>keySendingEnabled</key>
<false/>
<key>printSendingEnabled</key>
Expand Down
44 changes: 37 additions & 7 deletions res/en.lproj/MainStoryboard_iPad.storyboard
Expand Up @@ -3,7 +3,7 @@
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<development version="4600" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--Patch View Controller - Patch-->
Expand Down Expand Up @@ -242,9 +242,38 @@
<constraint firstAttribute="trailing" secondItem="V5i-Dw-GXW" secondAttribute="trailing" constant="30" id="bbh-NG-Abp"/>
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="6uJ-Jc-Dgz">
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="A5w-O7-N0A">
<rect key="frame" x="0.0" y="301" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Heading" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SFx-11-OI8">
<rect key="frame" x="20" y="11" width="65" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="highlightedColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Kuu-W9-n7W">
<rect key="frame" x="203" y="8" width="79" height="27"/>
<connections>
<action selector="oscEventTypeChanged:" destination="iuf-Pb-1Gb" eventType="valueChanged" id="NzO-yP-W6R"/>
</connections>
</switch>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstItem="Kuu-W9-n7W" firstAttribute="top" secondItem="A5w-O7-N0A" secondAttribute="top" constant="8" id="0my-pZ-LCZ"/>
<constraint firstItem="SFx-11-OI8" firstAttribute="leading" secondItem="A5w-O7-N0A" secondAttribute="leading" constant="30" id="AC0-ZP-5Rb"/>
<constraint firstItem="SFx-11-OI8" firstAttribute="centerY" secondItem="Kuu-W9-n7W" secondAttribute="centerY" type="default" id="In8-XK-kga"/>
<constraint firstAttribute="trailing" secondItem="Kuu-W9-n7W" secondAttribute="trailing" constant="30" id="nt3-Ru-jZK"/>
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="6uJ-Jc-Dgz">
<rect key="frame" x="0.0" y="345" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -275,7 +304,7 @@
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="x6x-Af-bPp">
<rect key="frame" x="0.0" y="345" width="320" height="45"/>
<rect key="frame" x="0.0" y="389" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
Expand Down Expand Up @@ -308,7 +337,7 @@
<tableViewSection headerTitle="Audio Latency" footerTitle="Lower latencies are more responsive, yet use more CPU time." id="hOZ-hg-jwG">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" rowHeight="132" id="InV-nT-br0">
<rect key="frame" x="0.0" y="464" width="320" height="134"/>
<rect key="frame" x="0.0" y="508" width="320" height="134"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="1" width="300" height="131"/>
Expand Down Expand Up @@ -371,7 +400,7 @@
<tableViewSection headerTitle="Copy Default Folders" footerTitle="Copy default libs &amp; scenes to the Documents folder. Overwrites contents of existing folders with the same name." id="818-aL-zA6">
<cells>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="Ffr-5T-j2H">
<rect key="frame" x="0.0" y="690" width="320" height="45"/>
<rect key="frame" x="0.0" y="734" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="1" width="300" height="43"/>
Expand Down Expand Up @@ -420,7 +449,7 @@
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="USP-AB-x2j">
<rect key="frame" x="0.0" y="735" width="320" height="44"/>
<rect key="frame" x="0.0" y="779" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
Expand Down Expand Up @@ -469,7 +498,7 @@
</constraints>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="sUB-I6-wXx">
<rect key="frame" x="0.0" y="779" width="320" height="45"/>
<rect key="frame" x="0.0" y="823" width="320" height="45"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
Expand Down Expand Up @@ -532,6 +561,7 @@
<outlet property="libFolderSpinner" destination="W8f-oQ-otM" id="SFJ-jr-Tvb"/>
<outlet property="lockScreenDisabledSwitch" destination="A7k-nA-TCM" id="Qjq-la-cSW"/>
<outlet property="oscAccelEnabledSwitch" destination="LKg-KT-KOx" id="bfg-qI-LhZ"/>
<outlet property="oscHeadingEnabledSwitch" destination="Kuu-W9-n7W" id="fJ0-aK-Rce"/>
<outlet property="oscKeyEnabledSwitch" destination="85d-n7-H74" id="HG1-a2-hCy"/>
<outlet property="oscLocationEnabledSwitch" destination="V5i-Dw-GXW" id="dYu-aS-eGi"/>
<outlet property="oscPrintEnabledSwitch" destination="NnA-9x-7WE" id="2Ua-6G-c1Y"/>
Expand Down

0 comments on commit 22b0089

Please sign in to comment.