Page 1 of 1

genWave Viewer User Manual

PostPosted: Sun Jan 06, 2013 1:22 am
by GEuser
Image

genWave Viewer (abbreviation: gWV)

CONTENTS

1. Introduction
2. Downloads
3. Installing
4. Startup Screen
5. Output Values
6. Updating Status & Code Display
7. Saving Code
8. Reference Waves
9. Output Values
10. Scales and labels
11. Output Modes
12. Full Display
13. Output Display
14. Output Selection
15. Step Resolution.
16. Output Arithmetic Modes
17. Negative Values
18. Vertical Shift (vShift)
19. Y-axis inversion (invertY)
20. Phase Shift
21. Experiment & be fruitful

1. Introduction

This gE application is used in tandem with the genWave function. It allows you to visualise what the genWave function output is like when you tweak all the various parameter settings. This will make it easier to suss out whats happening and enable you to fully exploit the gW (genWave) function. At the same time you will realise the powerful utility this simple function provides for your game designs. All it needs is a bit of patience and creative imagination on your part.

2. Downloads


Linux:
Linux.zip
(798.08 KiB) Downloaded 180 times


Mac:
Mac.zip
(1.09 MiB) Downloaded 187 times


Windows:
Windows.zip
genWave Viewer (Windows version)
(838.82 KiB) Downloaded 184 times


3. Installing.

Unzip the download and you will get a folder: genWave_Viewer. In folder select the genWaveViewer file and run it (NOTE: for linux you will need to make it an executable. In a window linux system: right-click=>properties/permissions/Execute=>check:Allow executing file as program).

4. Start-up Screen

Image

5. Output Values.

Image

You should see the start-up screen as above. The gWV is not showing anything at moment because you haven't told it to yet (ignore this for now). Hover & move your mouse over the graphed area. You will notice that some numbers change in the gWV banner located at the top left corner of screen. These indicate various output values that will be explained later.

6. Updating Status & Code Display

On the right side of this banner you will see the <REFRESH> button. If you look at the bottom left of the gWV screen you will see a floppy disk icon and a blank area next to it. When you left mouse click the <REFRESH> button you will see this blank area get filled up with the genWave code. Everytime you click <REFRESH> this code will be updated to reflect any changes you made to the output.

7. Saving Code
If you like the changes you made you can save this code by clicking the floppy disk icon. This code will be saved and ovewrites/creates text in a file called: waveData.txt in your genWaveViewer folder. You can access this code from Game Editor by loading it up in the Script Editor (File=>Load) and copy/paste into relevant part of your gE code (then just close the gE Script Editor without adding anything, its just a short cut for copying in the gW code).

Image

8. Reference Waves
The gW function uses 3 reference waves and performs various arithmetic operations on them to generate an output wave. Click on the show check box for reference wave 1 (Yellow Text Panel, right of graph area) and <REFRESH>. You will see a yellow wave appear. This is the first of the reference waves that the user sets in the gW function (parameters: wAmp1, wFreq1, wPhase1). The other two are WAVE2 (purple wave: gw parameters: wAmp2, wFreq2, wPhase2) and WAVE3 (green wave: gw parameters: wAmp3, wFreq3, wPhase3).

9. Output Values
Hover mouse over halfway across the top rim of the yellow wave's crescent part. At the correct position the gWV banner displays a bracket value of (25). Repeat for bottom rim of trough part and you get (-25). These values show the amplitude of the wave (same as text shown under the amplitude field in WAVE 1's settings).

Were going to change the amplitude of wave1. Click on the amplitude value (in WAVE 1 settings) and delete old value (use arrow keys to navigate) and replace with 50. <REFRESH>. The yellow wave will double in height. The bracket values will reflect this for rim values of crescent & trough (50 & -50 respectively).

10. Scales and labels
Click on the (x,y) button (near top middle-right). A set of scale labels appear on the graph.

The Orange vertical figures: show scales relative to reference waves only.
The Red vertical ones: relative to gW output wave.
The Blue horizontal ones: the degree interval for each step of wave (for both output & reference waves).

You will notice that the Orange Scale Values of 50 and -50 correctly correspond with the crescent & trough values of wave1's amplitude. Also, that the red figures are between 0 to 1 for the positive scale and 0 to -1 for the negative scale (e.g. the Y-axis). This is because gW generates output values that are between -1 to 1 (0 to 1 if negatives de-activated). gW function shrinks or expands output to fit a unit of 1. The wave information is not lost just scaled for convenience. This is usefull because you can determine the magification size of the output externally by a suitable multiplier (e.g. 10 * genWave(...); or 0.25 * genWave(...); in game code or for alpha settings you would use it as is).

Reset wave1's amplitude to 25, uncheck its show (hide wave1) and click (x,y) button to de-activate scale labels then <REFRESH>

You should have a blank graph area.

11. Output Modes
gW offers 24 output modes. See MODES list numbered 01 to 24 on right hand side of screen. Modes 04 through to 24 perform a different arithmetic operation on either 2, or all 3 of the reference waves. Modes 01 to 03 output the raw (no arithmetic operations) for reference waves 1, 2 and 3 respectively, shrunk or expanded to unit 1 for convenience. To select a mode, either delete, type in and replace the current number in Mode field (top right) or click one of the mode numbers in the MODES list on right hand side (the field / MODES list will update accordingly to reflect the selection made).

To continue make sure mode 1 is selected...

12. Full Display

Full Display (White Wave) is a gW Viewer option only and is provided for convenience. It shows the full output wave regardless of the selection preferences set for output and DOES NOT represent what is actually output, just covers what the output WOULD BE if the full selection range is set.

13. Output Display
Output Display (Red Wave) only shows the range of wave values that fall within the specified wStart and wEnd range set with gW. This is the REAL OUTPUT because this is the result gW churns out for external use.

To clarify this further: select mode 1 (if not selected, either type and replace in Mode field or click 01 in MODES list). Continue...

14. Output Selection
Select checkbox for Full Display=>Show (bottom right) and <REFRESH>. A white wave appears on graph. This extends across horizonal axis (covers full range: 0 to 360 degrees).

Now select checkbox for SELECTION=>show (red text area at top middle-right) then <REFRESH> A red wave appears that completely overlaps the white wave. This is because both have the same range (0 to 360). Let's suppose we only want to output wave ranges that lay between 90 and 270 degrees. Set Start=90 and End=270 in the SELECTION area (red text) and <REFRESH>. You will see now that the red wave adjusts to required amount and the white wave remains in background to show the full range for reference purposes only. Uncheck Full Display=>show to see the actual output only.

15. Step Resolution.

The step resolution affects the quality of the output. The smaller the step setting the higher the resolution (and more processor intensive) the output will be. Try these step settings (middle top): 5.0, 1.0, 0.5 and 0.1 observing the effect as you <REFRESH> on each change. Leave it at 0.1. Depending on your computer processor lag is noticable for step sizes smaller then 0.005 (faster computers might be able to handle smaller ones, currently 0.001 is the limit hardwired into gW function - up to you to alter this in global code if you know what your doing).

To continue set SELECTION range back to Start=0 and End=360. Uncheck to de-select SELECTION=>show and check on to select Full Display=>Show <REFRESH>

16. Output Arithmetic Modes

Arithmetic Modes

Modes 04 to 06 (ACT on WAVE1 & WAVE2)
Show WAVE1 and WAVE2, select Mode 04. <REFRESH> This adds these waves to produce the white wave shown.
Click on Mode 05 <REFRESH> This subtracts WAVE2 from WAVE1.
Click on Mode 06 <REFRESH> This subtracts WAVE1 from WAVE2.

Modes 07 to 09 (Act on WAVE1 & WAVE3)
Hide WAVE2. Show WAVE3, select Mode 07. <REFRESH> This adds these waves to produce the white wave shown.
Click on Mode 08 <REFRESH> This subtracts WAVE3 from WAVE1.
Click on Mode 09 <REFRESH> This subtracts WAVE1 from WAVE3.

Modes 10 to 12 (Act on WAVE2 & WAVE3)
Hide WAVE1. Show WAVE2, select Mode 10. <REFRESH> This adds these waves to produce the white wave shown.
Click on Mode 11 <REFRESH> This subtracts WAVE3 from WAVE2.
Click on Mode 12 <REFRESH> This subtracts WAVE2 from WAVE3.

Modes 13 to 20 (Act on all 3 waves:WAVE1, WAVE2 & WAVE3)
Show all 3 WAVES 1, 2 & 3. select Modes 13 to 20. <REFRESH> each time and observe result. The arithmetic action is shown on the MODES list (next to each mode number).

Modes 21 to 23 multiples 2 of the WAVES togather whilst mode 24 multplies all 3 of them. You know how to check this out by now.

To continue select Mode 01. Show just WAVE1 and ensure Full Display is on <REFRESH>

17. Negative Values

Sometimes you might want to clip out negative values for actions that require positive values only (for things like use in alpha settings or color gradients). Some of you might think this is redundant because you can just use the built in abs function to achieve this (abs turns negatives into positives = absolute value). The problem is that with waves the abs function flips the negative wave up creating a crescent from a trough which totally changes type of wave rather than just clipping off the negatives, so it not useful in this case. Just click the negative checkbox then <REFRESH> to toggle between enable/disable negatives. Try it now.

To continue switch negatives back on.


18. Vertical Shift (vShift)
Sometimes you might want to phsyically shift the wave vertically up/down along the Y-axis. gWV will clip off values that fall over 1 or under -1. vShift (3rd from bottom right) only works with values between -1 and 1 (because output is always -1 to 1 if negatives on). Type in 0.25 in vShift field <REFRESH> then try -0.25 <REFRESH>.

To continue reset vShift to 0, switch off display of the 3 WAVES (show unchecked) <REFRESH>

19. Y-axis inversion (invertY)
In regular 2D maths drawing the vertical Y-axis (Cartesian coordinate system) increases as you go up, so that negatives go downwards and positives go upwards. See: http://en.wikipedia.org/wiki/Cartesian_ ... ate_system

The problem is that in gE the y-axis works in the opposite way. Y-axis decreases as you go up, so that negatives go upwards and positives downwards. To resolve this problem gW function has an invertY parameter and reverses the y-axis to make it compatible with gE drawing modes. Note: When using the gW function to do non-drawing stuff like alpha, color setting, etc... you don't need to activate the invertY parameter. Just remember that for drawing gE is upside down to regular y-axis system. To enable/disable Y-axis inversion click on the invertY checkbox (bottom right).

IMPORTANT: in order to see gW output in its proper orientation in this application you need to have invertY activated (since this app uses gE for drawing). Just remember to turn invertY off if you want to save your genWave code for non-drawing stuff and back on (after save) to see if as it should be (Cartesian Y-axis system).

To continue make sure you are on Mode 01, Full Display, negatives and invertY are enabled...

20. Phase Shift

Each of the three reference waves have their own Phase shift settings. You can shift the wave along it's horizonal axis. Infact, a cosine wave (as in trignometry) is just a regular sinewave(what we've been using so far) phase shifted by +90 degrees. Set phase shift for WAVE1 to 90 <REFRESH>. Play around with various negative and positive values to get a feeler for whats happening. You'll notice that for gaming purposes this can be used to create scrolling or animated effects (depending on how you apply the genwave code).


21. Experiment & be fruitful :)

Remember you can use +/- phase values, partial frequencies and amplitudes (0.333, 0.01 etc...). An amplitude or frequency of 0 is reset to 0.01 because 0 would cause a division by zero error. At first clipping effect of vShift and disabling of negatives may appear to be more of an obstacle, use them creatively and they bring a new lease of life to shaping the output wave. You can create interesting effects using different maths ideas:-

prime numbers: http://en.wikipedia.org/wiki/Prime_numbers
Harmonic Wave: http://en.wikipedia.org/wiki/Harmonic_wave
Fibonacci numbers: http://en.wikipedia.org/wiki/Fibonacci_numbers
Golden ratio: http://en.wikipedia.org/wiki/Golden_ratio
Waveform: http://en.wikipedia.org/wiki/Waveform (try the 'see also' links on this webpage).

Now go and play with all the various settings. Happy wave surfing :)

Re: genWave Viewer User Manual

PostPosted: Sun Jan 06, 2013 1:53 am
by Hblade
+1 this is awesome looking :) I'll try it soon

EDIT:
Just tried it. Nice job!