Skip to content

Commit b1ba944

Browse files
committed
Test Program 1.3.5
Test Program 1.3.5
1 parent 9c644d2 commit b1ba944

File tree

7 files changed

+87
-35
lines changed

7 files changed

+87
-35
lines changed

src/FMODGMS Test.gmx/Configs/Default.config.gmx

+6-6
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@
276276
<option_in_app_purchase_server_url></option_in_app_purchase_server_url>
277277
<option_information>FMODGMS Test Program
278278

279-
FMODGMS version: 0.5.0
280-
FMOD version: Studio 1.08.00</option_information>
279+
FMODGMS version: 0.6.0
280+
FMOD version: Studio 1.08.04</option_information>
281281
<option_interpolate>False</option_interpolate>
282282
<option_ios_adcolony_enable_V4VC>0</option_ios_adcolony_enable_V4VC>
283283
<option_ios_advertising_enable>0</option_ios_advertising_enable>
@@ -351,7 +351,7 @@ FMOD version: Studio 1.08.00</option_information>
351351
<option_linux_steam_app_id>0</option_linux_steam_app_id>
352352
<option_linux_sync>0</option_linux_sync>
353353
<option_linux_texture_page>2048</option_linux_texture_page>
354-
<option_linux_version_build>4</option_linux_version_build>
354+
<option_linux_version_build>5</option_linux_version_build>
355355
<option_linux_version_major>1</option_linux_version_major>
356356
<option_linux_version_minor>3</option_linux_version_minor>
357357
<option_loadalpha>255</option_loadalpha>
@@ -468,15 +468,15 @@ FMOD version: Studio 1.08.00</option_information>
468468
<option_tizen_usesplash>False</option_tizen_usesplash>
469469
<option_use_new_audio>True</option_use_new_audio>
470470
<option_variableerrors>False</option_variableerrors>
471-
<option_version>1.3.1</option_version>
471+
<option_version>1.3.5</option_version>
472472
<option_version_build>0</option_version_build>
473473
<option_version_company>M.S.T.O.P.</option_version_company>
474474
<option_version_copyright>(c) 2016 M.S.T.O.P.</option_version_copyright>
475475
<option_version_description>FMODGMS Test Program</option_version_description>
476476
<option_version_major>1</option_version_major>
477477
<option_version_minor>3</option_version_minor>
478478
<option_version_product>FMODGMS Test</option_version_product>
479-
<option_version_release>4</option_version_release>
479+
<option_version_release>5</option_version_release>
480480
<option_win8_advertising_appid></option_win8_advertising_appid>
481481
<option_win8_advertising_enable>0</option_win8_advertising_enable>
482482
<option_win8_advertising_key></option_win8_advertising_key>
@@ -557,7 +557,7 @@ FMOD version: Studio 1.08.00</option_information>
557557
<option_windows_major_version>1</option_windows_major_version>
558558
<option_windows_nsis_file>Configs\Default\windows\RunnerInstaller.nsi</option_windows_nsis_file>
559559
<option_windows_product_info>FMODGMS Test</option_windows_product_info>
560-
<option_windows_release_version>4</option_windows_release_version>
560+
<option_windows_release_version>5</option_windows_release_version>
561561
<option_windows_runner_finished>Configs\Default\windows\Runner_finish.bmp</option_windows_runner_finished>
562562
<option_windows_runner_header>Configs\Default\windows\Runner_header.bmp</option_windows_runner_header>
563563
<option_windows_save_location>0</option_windows_save_location>

src/FMODGMS Test.gmx/FMODGMS Test.project.gmx

+3
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@
133133
<paths name="paths"/>
134134
<scripts name="scripts">
135135
<script>scripts\switch_track.gml</script>
136+
<script>scripts\draw_GUI_modules.gml</script>
137+
<script>scripts\draw_GUI_mp3.gml</script>
138+
<script>scripts\draw_GUI_ogg.gml</script>
136139
</scripts>
137140
<fonts name="fonts">
138141
<font>fonts\fnt_normal</font>

src/FMODGMS Test.gmx/extensions/FMODGMS.extension.gmx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<name>FMODGMS</name>
44
<version>0.6.0</version>
55
<packageID></packageID>
6-
<ProductID>ACBD3CFF4E539AD869A0E8E3B4B022DD</ProductID>
6+
<ProductID></ProductID>
77
<date>13/02/2016</date>
88
<license>Free to use, also for commercial games.</license>
99
<description></description>

src/FMODGMS Test.gmx/objects/obj_player.object.gmx

+30-28
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
// Number of bins in Spectrum data
3737
//show_message(FMODGMS_FFT_Set_WindowSize(128));
3838
numBins = FMODGMS_FFT_Get_NumBins();
39+
peakDamping = 0;
40+
41+
// init spectrum visualizer bins
42+
for (var i=0; i&lt;numBins; i++)
43+
{
44+
avgBin[i] = 0;
45+
}
3946

4047
// Load sounds
4148
sound[0] = FMODGMS_Snd_LoadSound(working_directory + "cronolog.s3m");
@@ -71,10 +78,6 @@
7178
channel_pitch = 1;
7279

7380
window_set_caption("The colours!");
74-
75-
//show_message(FMODGMS_Snd_Get_TagStringFromName(sound[4],"TITLE"));
76-
//show_message(FMODGMS_Snd_Get_TagTypeFromIndex(sound[4],1));
77-
//show_message(FMODGMS_Snd_Get_TagDataTypeFromIndex(sound[4],2));
7881
}
7982
</string>
8083
</argument>
@@ -102,6 +105,13 @@
102105
{
103106
FMODGMS_Sys_Update();
104107
hue = (hue + 1) mod 256;
108+
109+
// update spectrum visualizer values
110+
for (var i=0; i&lt;numBins; i++)
111+
{
112+
var bin = clamp(FMODGMS_FFT_Get_BinValue(i),0,1);
113+
avgBin[i] = avgBin[i] * peakDamping + bin * (1-peakDamping);
114+
}
105115
}
106116
</string>
107117
</argument>
@@ -363,42 +373,34 @@ FMODGMS_Chan_Set_Volume(0,channel_volume);
363373
}
364374

365375
// dominant Frequency
366-
draw_text(416,112,"Dominant Freq.: " + string(FMODGMS_FFT_Get_DominantFrequency()) + " Hz");
376+
draw_text(432,112,"Dominant Freq.: " + string(FMODGMS_FFT_Get_DominantFrequency()) + " Hz");
367377

368378
// spectrum
369-
370-
draw_rectangle_colour(416,144,416+numBins*5,244,c_black,c_black,$202020,$202020,false);
379+
draw_rectangle_colour(432,144,432+numBins*5,244,c_black,c_black,$202020,$202020,false);
371380

372381
for (var i=0; i&lt;numBins; i++)
373382
{
374-
var bin = FMODGMS_FFT_Get_BinValue(i);
375383
var col;
376384

377-
if (bin &lt;= 0.5)
378-
col = merge_colour(c_lime,c_yellow,bin*2);
385+
if (avgBin[i] &lt;= 0.5)
386+
col = merge_colour(c_lime,c_yellow,avgBin[i]*2);
379387
else
380-
col = merge_colour(c_yellow,c_red,(bin-0.5)*2);
388+
col = merge_colour(c_yellow,c_red,(avgBin[i]-0.5)*2);
381389

382390
draw_set_colour(col);
383-
draw_rectangle(416+i*5+1,244-bin*100,416+i*5+4,244,false);
391+
draw_rectangle(432+i*5+1,244-avgBin[i]*100,432+i*5+4,244,false);
384392
}
385393

386-
draw_set_color(make_color_hsv((hue+64 mod 256),128,255));
387-
draw_text(16,128,"Position: " + string(FMODGMS_Chan_Get_Position(0)));
388-
draw_set_color(make_color_hsv((hue+80 mod 256),128,255));
389-
draw_text(16,144,"Loop Points: " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],0)) + " - " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],1)));
390-
draw_set_color(make_color_hsv((hue+96 mod 256),128,255));
391-
draw_text(16,160,"Order: " + string(FMODGMS_Chan_Get_ModOrder(0))); // only works with module files
392-
draw_set_color(make_color_hsv((hue+112 mod 256),128,255));
393-
draw_text(16,176,"Pattern: " + string(FMODGMS_Chan_Get_ModPattern(0))); // only works with module files
394-
draw_set_color(make_color_hsv((hue+128 mod 256),128,255));
395-
draw_text(16,192,"Row: " + string(FMODGMS_Chan_Get_ModRow(0))); // only works with module files
396-
draw_set_color(make_color_hsv((hue+144 mod 256),128,255));
397-
draw_text(16,208,"Volume: " + string(channel_volume));
398-
draw_set_color(make_color_hsv((hue+160 mod 256),128,255));
399-
draw_text(16,224,"Playback Freq.: " + string(channel_frequency * channel_pitch) + " Hz# (" + string(channel_frequency) + " x " + string(channel_pitch) + ")");
400-
//draw_set_color(make_color_hsv((hue+176 mod 256),128,255));
401-
//draw_text(16,240,"Pitch: " + string(FMODGMS_Chan_Get_Pitch(0)));
394+
// draw playback info based on filetype
395+
396+
// modules (MOD, XM, S3M, IT)
397+
if (sound_index &lt; 4)
398+
draw_GUI_modules();
399+
else if (sound_index == 4)
400+
draw_GUI_mp3();
401+
//the rest
402+
else
403+
draw_GUI_ogg();
402404

403405
draw_set_color(c_white);
404406
draw_text(16,304,"Space -- Play/Stop#P - Pause/Unpause#Q/A -- Change volume#W/S -- Change frequency#E/D -- Change pitch");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
///draw_GUI_modules()
2+
3+
draw_set_color(make_color_hsv((hue+64 mod 256),128,255));
4+
draw_text(16,128,"Position: " + string(FMODGMS_Chan_Get_Position(0)));
5+
draw_set_color(make_color_hsv((hue+80 mod 256),128,255));
6+
draw_text(16,144,"Loop Points: " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],0)) + " - " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],1)));
7+
draw_set_color(make_color_hsv((hue+96 mod 256),128,255));
8+
draw_text(16,160,"Order: " + string(FMODGMS_Chan_Get_ModOrder(0))); // only works with module files
9+
draw_set_color(make_color_hsv((hue+112 mod 256),128,255));
10+
draw_text(16,176,"Pattern: " + string(FMODGMS_Chan_Get_ModPattern(0))); // only works with module files
11+
draw_set_color(make_color_hsv((hue+128 mod 256),128,255));
12+
draw_text(16,192,"Row: " + string(FMODGMS_Chan_Get_ModRow(0))); // only works with module files
13+
draw_set_color(make_color_hsv((hue+144 mod 256),128,255));
14+
draw_text(16,208,"Volume: " + string(channel_volume));
15+
draw_set_color(make_color_hsv((hue+160 mod 256),128,255));
16+
draw_text(16,224,"Playback Freq.: " + string(channel_frequency * channel_pitch) + " Hz# (" + string(channel_frequency) + " x " + string(channel_pitch) + ")");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
///draw_GUI_mp3()
2+
3+
draw_set_color(make_color_hsv((hue+64 mod 256),128,255));
4+
draw_text(16,128,"Position: " + string(FMODGMS_Chan_Get_Position(0)));
5+
draw_set_color(make_color_hsv((hue+80 mod 256),128,255));
6+
draw_text(16,144,"Loop Points: " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],0)) + " - " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],1)));
7+
draw_set_color(make_color_hsv((hue+96 mod 256),128,255));
8+
9+
// get tags
10+
draw_text(16,176,"Title: " + FMODGMS_Snd_Get_TagStringFromName(sound[4],"TITLE"));
11+
draw_set_color(make_color_hsv((hue+112 mod 256),128,255));
12+
draw_text(16,192,"Artist: " + FMODGMS_Snd_Get_TagStringFromName(sound[4],"ARTIST"));
13+
draw_set_color(make_color_hsv((hue+128 mod 256),128,255));
14+
draw_text(16,208,"Album: " + FMODGMS_Snd_Get_TagStringFromName(sound[4],"ALBUM"));
15+
draw_set_color(make_color_hsv((hue+144 mod 256),128,255));
16+
17+
18+
draw_text(16,240,"Volume: " + string(channel_volume));
19+
draw_set_color(make_color_hsv((hue+160 mod 256),128,255));
20+
draw_text(16,256,"Playback Freq.: " + string(channel_frequency * channel_pitch) + " Hz# (" + string(channel_frequency) + " x " + string(channel_pitch) + ")");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
///draw_GUI_ogg()
2+
3+
draw_set_color(make_color_hsv((hue+64 mod 256),128,255));
4+
draw_text(16,128,"Position: " + string(FMODGMS_Chan_Get_Position(0)));
5+
draw_set_color(make_color_hsv((hue+80 mod 256),128,255));
6+
draw_text(16,144,"Loop Points: " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],0)) + " - " + string(FMODGMS_Snd_Get_LoopPoints(sound[sound_index],1)));
7+
draw_set_color(make_color_hsv((hue+96 mod 256),128,255));
8+
draw_text(16,208,"Volume: " + string(channel_volume));
9+
draw_set_color(make_color_hsv((hue+112 mod 256),128,255));
10+
draw_text(16,224,"Playback Freq.: " + string(channel_frequency * channel_pitch) + " Hz# (" + string(channel_frequency) + " x " + string(channel_pitch) + ")");
11+

0 commit comments

Comments
 (0)