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

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: BlackKey, C4, Cs4, D4, Ds4, PitchC4, PitchCs4, PitchD4, PitchDs4, WhiteKey

Index for Viewpoint node: Viewpoint_1
-->
<Scene>
<WorldInfo title='Figure24_4FourKeyKeyboard.x3d'/>
<Viewpoint description='Middle C, C#, D, D#orientation='1 0 0 -0.758position='0 2 2'/>
<Group>
<Transform>
<Shape DEF='WhiteKey'>
<Box size='0.23 0.1 1.5'/>
<Appearance>
<Material diffuseColor='0.9 0.9 0.9'/>
</Appearance>
</Shape>
<!-- ROUTE information for C4 node:  [from touchTime to PitchC4.set_startTime ] -->
<TouchSensor DEF='C4description='C4 key'/>

<Sound minBack='5minFront='5'>
<!-- 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" ' />
</Sound>
</Transform>
<Transform translation='0.125 0.1 -0.375'>
<Shape DEF='BlackKey'>
<Box size='0.2 0.1 0.75'/>
<Appearance>
<Material diffuseColor='0.4 0.4 0.4'/>
</Appearance>
</Shape>
<!-- ROUTE information for Cs4 node:  [from touchTime to PitchCs4.set_startTime ] -->
<TouchSensor DEF='Cs4description='Csharp4 key'/>

<Sound minBack='5minFront='5'>
<!-- 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" ' />
</Sound>
</Transform>
<Transform translation='0.25 0 0'>
<Shape USE=' WhiteKey'/>
<!-- ROUTE information for D4 node:  [from touchTime to PitchD4.set_startTime ] -->
<TouchSensor DEF='D4description='D4 key'/>

<Sound minBack='5minFront='5'>
<!-- 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" ' />
</Sound>
</Transform>
<Transform translation='0.375 0.1 -0.375'>
<Shape USE=' BlackKey'/>
<!-- ROUTE information for Ds4 node:  [from touchTime to PitchDs4.set_startTime ] -->
<TouchSensor DEF='Ds4description='Dsharp4 key'/>

<Sound minBack='5minFront='5'>
<!-- 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" ' />
</Sound>
</Transform>
</Group>
< ROUTE  fromNode=' C4' fromField='touchTime' toNode=' PitchC4' toField='set_startTime'/>
< ROUTE  fromNode=' Cs4' fromField='touchTime' toNode=' PitchCs4' toField='set_startTime'/>
< ROUTE  fromNode=' D4' fromField='touchTime' toNode=' PitchD4' toField='set_startTime'/>
< ROUTE  fromNode=' Ds4' fromField='touchTime' toNode=' PitchDs4' toField='set_startTime'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: BlackKey, C4, Cs4, D4, Ds4, PitchC4, PitchCs4, PitchD4, PitchDs4, WhiteKey

Index for Viewpoint node: Viewpoint_1
-->

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



-->

<!-- 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. -->