Comments (1)
Thanks for this suggestion @Kouzeru. I will try to explain here why we will probably keep the current behavior, and how we might consider a corresponding feature request.
The current behavior of limiting the pitch effect to three octaves up and down (-360 to 360) is intended to prevent confusion for beginners.
You can think of it as analogous to the "fencing" behavior for the positions of sprites: when a sprite's x or y position is set to an extreme value like -99999, the sprite only goes partway off the edge, instead of disappearing completely. This helps beginners understand what happened when they try something very typical for beginners, such as "forever change x by 1000" or "set x to -999999". They can see what happened ("oh, it went off to the left!"), and recover from it (you can still drag the sprite back to where you wanted it). Without fencing, your sprite would disappear, and you may not know why, or how to get it back.
The pitch effect is much more abstract, because it is hidden state (you cannot see the value, and it only takes effect while a sound is playing). Beginners will typically do something like "forever change pitch effect by 10" or "set pitch effect to -99999". They may have no idea what to expect when they run these blocks, e.g. if they do not know what "pitch" means. Without the limits, the sound would become inaudible, and all sound from that sprite will seem completely broken. They may not know what has occurred or why, or how to recover ("is my volume off? are all sounds broken?").
With the current limits in place, the sound will still play, and be audible. The idea is that the person can at least hear that a sound has played. They may be able to recover using the pitch blocks (e.g. if you do "set pitch effect to -99999" and then "change pitch by 10", you may be able to hear the change from -360 to -350). This is not perfect, but seems to me to be better for beginners than the behavior without the limits.
The other thing for us to consider is how we might separate the feature request from the proposed solution. Sounds like turbowarp now has the ability to pause and unpause sounds, which is super cool! My question is: if we want to add that feature, how could we make it friendly and accessible, instead of a hidden feature? One way would be to add one or more blocks for controlling the sound in new ways (e.g. pause/unpause, jump to a certain time, a hat block to trigger when the sound reaches a certain time, etc.). We haven't really considered this space of possibilities in detail. It might make an interesting exploration to prototype these new blocks. It's not clear to me if they should be added to the "sounds" category or become a separate extension for advanced sound things.
from scratch-audio.
Related Issues (20)
- Notes initially ignore volume HOT 2
- The ADPCM decoder uses too much memory HOT 1
- RIFFVtWAVEfmt Wave Files don't load in 3.0
- The instruments could use some tweaks HOT 1
- Invalid content error in Firefox on one project
- Handle Chrome audio autoplay policy change HOT 5
- Repeatedly changing the volume (e.g. fade-out) causes bitsy effect HOT 1
- Audio on a particular project can't be decoded successfully HOT 1
- Set volume to in a forever loop causes audio to stutter on Firefox HOT 2
- First time a sound plays it starts at full volume even if volume is set lower
- Pan left/right doesn't effect extension blocks HOT 1
- Extend the pitch effects limit HOT 3
- After numerous changes of volume/pitch, they became less responsive HOT 8
- "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page." are displayed in chrome console when scratch is started. HOT 1
- npm-published packages should follow semver
- Dependency Dashboard
- module is not defined HOT 1
- Migrate from travis-after-all to Travis Stages
- Audio still clicks when restarting after a rest block HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scratch-audio.