X3D Model Documentation: Figure24_4FourKeyKeyboard.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='Figure24_4FourKeyKeyboard.x3d'/>
  6            <meta name='creatorcontent='Figure 24.4, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch24/24fig04.htm'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='2 October 2000'/>
 10            <meta name='modifiedcontent='14 July 2023'/>
 11            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/KeyboardEightyEightKeys.x3d'/>
 12            <meta name='descriptioncontent='Four keys in a keyboard showing how pitch can vary a single sound source.'/>
 13            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/Figure24_4FourKeyKeyboard.x3d'/>
 14            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 15            <meta name='licensecontent='../../license.html'/>
 16       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BlackKey, C4, Cs4, D4, Ds4, PitchC4, PitchCs4, PitchD4, PitchDs4, WhiteKey

Index for Viewpoint node: Viewpoint_1
-->
 17       <Scene>
 18            <WorldInfo title='Figure24_4FourKeyKeyboard.x3d'/>
 19            <Viewpoint description='Middle C, C#, D, D#orientation='1 0 0 -0.758position='0 2 2'/>
 20            <Group>
 21                 <Transform>
 22 
                    <!-- Shape WhiteKey is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='WhiteKey'>
 23                           <Box size='0.23 0.1 1.5'/>
 24                           <Appearance>
 25                                <Material diffuseColor='0.9 0.9 0.9'/>
 26                           </Appearance>
 27                      </Shape>
 28 
                    <!-- ROUTE information for C4 node:  [from touchTime to PitchC4.set_startTime ] -->
                    <TouchSensor DEF='C4description='C4 key'/>
 29                      <Sound minBack='5minFront='5'>
 30 
                         <!-- ROUTE information for PitchC4 node:  [from C4.touchTime to set_startTime ] -->
                         <AudioClip DEF='PitchC4description='Pitch C4'   url=' "tone1.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/tone1.wav" '/>
 31                      </Sound>
 32                 </Transform>
 33                 <Transform translation='0.125 0.1 -0.375'>
 34 
                    <!-- Shape BlackKey is a DEF node that has 1 USE node: USE_1 -->
                    <Shape DEF='BlackKey'>
 35                           <Box size='0.2 0.1 0.75'/>
 36                           <Appearance>
 37                                <Material diffuseColor='0.4 0.4 0.4'/>
 38                           </Appearance>
 39                      </Shape>
 40 
                    <!-- ROUTE information for Cs4 node:  [from touchTime to PitchCs4.set_startTime ] -->
                    <TouchSensor DEF='Cs4description='Csharp4 key'/>
 41                      <Sound minBack='5minFront='5'>
 42 
                         <!-- ROUTE information for PitchCs4 node:  [from Cs4.touchTime to set_startTime ] -->
                         <AudioClip DEF='PitchCs4description='Pitch Csharp4pitch='1.059'   url=' "tone1.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/tone1.wav" '/>
 43                      </Sound>
 44                 </Transform>
 45                 <Transform translation='0.25 0 0'>
 46                      <Shape USE='WhiteKey'/>
 47 
                    <!-- ROUTE information for D4 node:  [from touchTime to PitchD4.set_startTime ] -->
                    <TouchSensor DEF='D4description='D4 key'/>
 48                      <Sound minBack='5minFront='5'>
 49 
                         <!-- ROUTE information for PitchD4 node:  [from D4.touchTime to set_startTime ] -->
                         <AudioClip DEF='PitchD4description='Pitch D4pitch='1.122'   url=' "tone1.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/tone1.wav" '/>
 50                      </Sound>
 51                 </Transform>
 52                 <Transform translation='0.375 0.1 -0.375'>
 53                      <Shape USE='BlackKey'/>
 54 
                    <!-- ROUTE information for Ds4 node:  [from touchTime to PitchDs4.set_startTime ] -->
                    <TouchSensor DEF='Ds4description='Dsharp4 key'/>
 55                      <Sound minBack='5minFront='5'>
 56 
                         <!-- ROUTE information for PitchDs4 node:  [from Ds4.touchTime to set_startTime ] -->
                         <AudioClip DEF='PitchDs4description='Pitch Dsharp4pitch='1.189'   url=' "tone1.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/tone1.wav" '/>
 57                      </Sound>
 58                 </Transform>
 59            </Group>
 60            < ROUTE  fromNode='C4' fromField='touchTime' toNode='PitchC4' toField='set_startTime'/>
 61            < ROUTE  fromNode='Cs4' fromField='touchTime' toNode='PitchCs4' toField='set_startTime'/>
 62            < ROUTE  fromNode='D4' fromField='touchTime' toNode='PitchD4' toField='set_startTime'/>
 63            < ROUTE  fromNode='Ds4' fromField='touchTime' toNode='PitchDs4' toField='set_startTime'/>
 64       </Scene>
 65  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: BlackKey, C4, Cs4, D4, Ds4, PitchC4, PitchCs4, PitchD4, PitchDs4, WhiteKey

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: Appearance, AudioClip, Box, Group, head, Material, meta, ROUTE, Scene, Shape, Sound, TouchSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

C4
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
PitchC4
AudioClip
set_startTime
SFTime

Cs4
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
PitchCs4
AudioClip
set_startTime
SFTime

D4
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
PitchD4
AudioClip
set_startTime
SFTime

Ds4
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
PitchDs4
AudioClip
set_startTime
SFTime

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/Figure24_4FourKeyKeyboardIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter24Sound/Figure24_4FourKeyKeyboard.x3d -->

<!-- Color legend: X3D terminology <X3dNode DEF='idName' field='value'/> matches XML terminology <XmlElement DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
-->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->