Edition of the Sound component

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 770
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Edition of the Sound component

Post by Ats »

Hello,

In the ZGE documentation, it is said that the AudioMixer Channel Properties can go up to 16.
However, only channels 0 and 1 are working when testing the sound in it.

The same goes with Component @Playsound (Sound: mySound, Channel: 4);

Am I missing something?

Edit 1 :
My bad, I found it. Channels have to be activated in the Global Mixer tab, which is only displayable when selecting a sound Component, so not really global in terms of UI :lol:

So, as you play several sounds at the same time, the volume tends to get pretty intense. And some other time, sounds are not playing at all. That's why I had the idea of switching the channel each time a sound is played.

Edit 2 :
Oh... But modifying the Global Mixer also modify the AudioMixer Component when there is one...
ZGameEditor Help wrote:AudioMixer

A mixer for the real-time audio synthesizer. When a 2ref Sound component is selected in the editor, the AudioMixer custom editor is displayed as a separate page next to the audio custom editor.

The mixer is used for changing settings to different audio channels.

Note
To save the mixer settings, you must add an audiomixer component to your project. You can only have a single AudioMixer in one project.
That's not very intuitive.
Sorry, I only read the notice when it's clear that I don't understand how it's working :lol:

Edit 3 :
After a complete reading of the Audio documentation, I'm going to transform this topic into a more generic QA related to audio, as not everything is particularly clear regarding the UI and it's explanations
Last edited by Ats on Wed Feb 23, 2022 9:06 pm, edited 3 times in total.
User avatar
Ats
Posts: 770
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Edition of the Sound component

Post by Ats »

Alright, so my next workshop is about producing better sounds in my game. So I was discovering the Sound Editor and reading through the Help file when several problems hit me. I'm going to expose those point per point.


1- Undocumented sound parameters

For starters, there are a bunch of undocumented parameters in the help file for modifying the Sound component directly from a ZExpression:

Envelope 1: Env0Active, Env0AttackTime, Env0DecayTime, Env0SustainLevel, Env0ReleaseTime
Envelope 2: Env1Active, Env1AttackTime, Env1DecayTime, Env1SustainLevel, Env1ReleaseTime
LFO 1: Lfo0Active, Lfo0Style, Lfo0IsBipolar, Lfo0Speed
LFO 2: Lfo1Active, Lfo1Style, Lfo1IsBipolar, Lfo1Speed
Modulation matrix 1: Mod0Active, Mod0Source, Mod0Destination, Mod0Amount
Modulation matrix 2: Mod1Active, Mod1Source, Mod1Destination, Mod1Amount
Modulation matrix 3: Mod2Active, Mod2Source, Mod2Destination, Mod2Amount
Modulation matrix 4: Mod3Active, Mod3Source, Mod3Destination, Mod3Amount

Those handy parameters merit a little place in the Help documentation :wink:


2- Consistency of parameter's names regarding numbers

The parameters that concern the Oscillator n°1 are named: Osc1Waveform, Osc1NoteModifier and Osc1PW
Same goes for Oscillator n°2: Osc2Waveform, Osc2NoteModifier and Osc2PW

But then there's the Modulation matrix, LFOs and Envelopes where the number in their names don't match the parameter name.
As an example, "Modulation matrix 1 activation" is named Mod0Active, not Mod1Active.

Ok, this isn't a big issue. But then, when you chose the Destination of the Modulation Matrix, the same thing is called Mod1Amount, not Mod0Amount. There's a little consistency issue here. The only other component that has numbers in its parameters names is the DefineCollision. And they are named Cat1 and Cat2, not Cat0 and Cat1.


3- About Modulation matrix Destination

In the list of selectable options for the Destination, there are a bunch of new names:
FilterCutoff, FilterQ, NoteNr, Lfo1Speed, Lfo2Speed, Mod1Amount, Mod2Amount, Mod3Amount, Mod4Amount, Osc1NoteMod, Osc2NoteMod, Volume, Pan, Osc2Vol, Osc1PW
They are not the full display names, nor the parameter names, but shorten names to fit inside the selector box. It's understandable, but also a bit confusing. And I still haven't found what Osc1PW stands for...

Again, I know that the names were shortened to fit inside the boxes, but I believe that could be better with consistent names.


4- Hard to find parameters

Why everything concerning the Modulation matrix, LFOs and Envelopes are only displayed in the Sound Editor detachable window? Why aren't they listed in the Sound properties, in the left column, like the other properties?
I had to discover the undocumented parameters listed above in order to realize that this detachable windows is really the parameters of the selected sound. But that took me a while because when I change something in that window, let's say the volume, then the parameter isn't modified in the Sound properties in the left column. I have to select another component and then select my sound again in order to see the change being taken into account.

I think all the Sound properties should be listed in the left column, like any other Components.


5- Show/hide properties as they are enabled or disabled

Adding all those properties to the left column will make it longer, and this isn't related directly to the Sound component, but could something like this be possible?
unravel_options.gif
unravel_options.gif (44.93 KiB) Viewed 8340 times


6- Oscillator 2 wave form

In the Help doc, it is said that we can choose between Square, Saw and Noise, but there are only Square and Saw.
By the way, why only those two, and not the same choices as oscillator 1?


7- About Envelopes documentation

Here's what the doc says:
Each sound can have a number of ADSR envelopes. For every envelope the following values can be set:
•Active - Set if this envelope is active.
•Attack time (A) - The time taken for initial run-up of level from zero to peak, beginning when the sound is being played.
•Decay time (D) - The time taken for the subsequent run down from the attack level to the designated sustain level.
•Sustain level (S) - The level during the main sequence of the sound's duration.
•Release time (R) - The time taken for the level to decay from the sustain level to zero.
What do you mean by time? Is it in seconds? Or is it relative to the length of the sound, so, some kind of % of the sound duration?
By the way, I just realized that there's a Help button right under Save as raw-file, that goes to http://www.zgameeditor.org/index.php/ComponentRef.Sound which isn't consistent with the Help Documentation:
Each sound can have a number of envelopes.
For every envelope the following values can be set:
Active - Set if this envelope is active.
AttackTime - The duration of time that this envelope goes from zero to one.
ReleaseTime - The duration of time that this envelope returns from one to zero, after the AttackTime is finished.
Maybe the help in the wiki could be generated from the Github Help documentation too? But that's another problem for another day.



I think I'll stop there for today. I'll talk about the role of the sound editor's detachable window later, because I have some ideas to simplify it a bit :lol:
User avatar
VilleK
Site Admin
Posts: 2359
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Edition of the Sound component

Post by VilleK »

In general, I would recommend using the sound editor. Trying to set individual properties in the properties panel is not very productive. The sound editor is designed to make it possible to create a variety of sounds but I totally understand it is daunting to use if you don't have previous experience with synths.

There was an idea to add some kind of high-level wizard interface on top of this. Something like SFXR. I remember that Kjell even had a prototype of this.
User avatar
Ats
Posts: 770
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Edition of the Sound component

Post by Ats »

Don't get me wrong, I like the sound editor.
What I don't like about it is that it's not very clear if it affects the selected sound at first sight, and most of all, it's really easy to Inadvertently break the tweaks of a sound with it. I think it would be better if the sound editor was some kind of playground that doesn't impact the sound component, unless we press a "validation" button that will copy the parameters from the editor to the sound. Or a checkbox for toying or editing the current sound.

A "better" editor like SFXR would be nice, but for real time synthesizer.

For example, the information could be reordered, as the important NoteNr is almost hidden:
edit_informations.png
edit_informations.png (5.22 KiB) Viewed 8321 times
It could be something like that:
keyboard.png
keyboard.png (4.89 KiB) Viewed 8321 times

Is the sequence really important for the Sound to be placed on top? Why is it in the Sound Component instead of the Music component?
Why the Pan property is placed at the bottom in the left column instead of the top with the volume and length, like in the editor. All sort of little UI tweaks that could make the editor better to understand and to use.

By the way, the use of awsedftgyhuj is complicated on azerty keyboards. And when you press a wrong key (x), even if the editor is selected with the mouse, it can add a "x" right in the middle of your code if a ZExpression is displayed at the same time. Quite dangerous :lol:
User avatar
Ats
Posts: 770
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Edition of the Sound component

Post by Ats »

VilleK wrote:There was an idea to add some kind of high-level wizard interface on top of this. Something like SFXR. I remember that Kjell even had a prototype of this.
Is that right, Kjell? After playing with sfxr and seeing the limitations, I would be more than happy to see that, and to help to make it, if needed.
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Re: Edition of the Sound component

Post by Kjell »

Hi Ats,
Ats wrote: Thu May 02, 2024 4:56 pmIs that right, Kjell?
If the "prototype" he's referring to is this .. then i guess so? And the "sound effect wizard" was Ville's idea.

K
Post Reply