dMZX Forums: Adding volume parameter to SAM command -> Rejected Requests -> Tracker

Jump to content

Report ID 587 Title Adding volume parameter to SAM command
Product Rejected Requests Status Rejected (Severity 0 - None Assigned)
Version - Fixed in -

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #587: Adding volume parameter to SAM command

#1 User is offline  
A-Guymzx 

  • Bouncin'
  • PipPipPip
  • Group: Members
  • Posts: 225
  • Joined: 19-June 09
  • Gender:Male
  • Location:The Netherlands

Posted 18 July 2013 - 11:32 PM

I think adding a new parameter to the SAM command to play the given sound file at a certain volume, much like you have the VOLUME # command for music, could be a very handy thing to have to save on several copies of the same sound file, but each with a different volume. This could be used i.e. enemy footsteps further away sounding more softly than close by, adding the need to hear what's around you in a stealth game or something.

A possible syntax could be
SAM 0 "sound.ogg" 255


Where the 255 would represent the playback volume. The input would then range from 0 (perfectly silent, or very, very softly) to 255 (the original sound volume).


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 6)

#2 User is offline  
ThDPro 

  • Brontosaurus-Sea-slug; Gooey and phallic
  • PipPipPipPip
  • Group: Members
  • Posts: 718
  • Joined: 03-December 06
  • Gender:Male
  • Location:Portland, OR

Posted 19 July 2013 - 06:45 PM

I've always wanted this kind of thing. I was thinking it'd work with counters setting the channel your adjusting, then counters for volume/pan, whatever else is plausible... if any of it is.
original soundtracks
Better Than Nothing - DOMINATION - Commander Keen: Heroes Lost - Welkin - A Confectioner's Recipe - random ThDPro music stuff
<Risu21121> if you're not going to make a good game, you might as well make a blatantly racist one.
<Kuddy> Testicles.
"Where are my folder?" - KKairos

#3 User is offline  
ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 23 July 2013 - 12:19 AM

play_sample() could be easily modified to take an optional per-sample volume multiplier.

Adding commands isn't something we do lightly, but when I was looking for VOLUME I did find something strange. It looks like there are two VOLUME commands in bytecode, both treated identically. I guess we can't just override VOLUME2 but maybe we could convert VOLUME2->VOLUME for legacy worlds and use the VOLUME2 command henceforth for your SAM variant. OTOH there might be better uses of that spare command.

--ajs.

#4 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 23 July 2013 - 03:32 AM

To simplify it we could drop the frequency parameter (since everyone uses 0 anyway) and maybe make the new command more obvious as to what it does (nobody uses SAMs anymore and MZX converts them anyway)

sound "sound.wav" (0 to 255) (-100 to 100)


Or we could save the panning bit for debytecode. I'm sure it'd be used but if we're only looking at one available command it might not be worth the added clutter.

edit: What about changing volume and panning on a currently-playing sound effect? What about looping sound effects? aaaaaaaaaaaaaaaaaaaaaaaaaaadhsjhg
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#5 User is offline  
A-Guymzx 

  • Bouncin'
  • PipPipPip
  • Group: Members
  • Posts: 225
  • Joined: 19-June 09
  • Gender:Male
  • Location:The Netherlands

Posted 30 July 2013 - 11:01 PM

Lachesis, on 23 July 2013 - 05:32 AM, said:

To simplify it we could drop the frequency parameter (since everyone uses 0 anyway) and maybe make the new command more obvious as to what it does (nobody uses SAMs anymore and MZX converts them anyway)

I am actually using the frequency parameter in my current project, in order to make even more variations of the same sound.

Personally I dislike the idea of a global sound effect VOLUME command, as I would need per-sound volume changing. I thing this would also prove much more useful and efficient, as you wouldn't need to change VOLUME2 every time you need to play a sound with a lower volume, then change it again to make all other sounds play as they should.

I do like the idea of panning, however. These three parameters (Frequency, volume and panning) would give people nearly all options they really need regarding sound effect playback. (Although I must say being able to change these parameters again mid-sound is also an interesting thing, but I guess that would become a bit too much.)

So in the end the command could become something like this:
sound (0 to something) "sound.wav"  (0 to 255) (-100 to 100)

The first parameter being, like with the SAM command, frequency, the second volume, and the third panning.

This post has been edited by A-Guymzx: 30 July 2013 - 11:04 PM


#6 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 22 March 2015 - 03:51 PM

Updating status to: Rejected

a new command isn't happening any time soon; this is better suited to built-in counters. please turn your attention here and have a nice day
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#7 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,961
  • Joined: 12-October 00
  • Gender:Male

Posted 23 March 2015 - 06:09 PM

Moving to: Rejected Requests


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.