Random noise generator

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Gumaster
Regular
Posts: 93
Joined: Sun Sep 06, 2009 6:54 am
Contact:

Random noise generator

#1 Post by Gumaster »

Right, so after making a disrupted noise effect using the cookbook recipe on the main site

Code: Select all

image staticdisrupt = anim.SMAnimation("a",
        anim.State("a", "noise1.png"),
        anim.State("b", "noise2.png"),
        anim.State("c", "noise3.png"),
        anim.State("d", "noise4.png"),
        anim.State("e", "noise5.png"),
        anim.State("f",  "blank.png"),
        anim.State("g",  "blank2.png"),
        anim.State("h",  "blank3.png"),

        anim.Edge("a", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "a", trans=Dissolve(.2, alpha=True)),
        etc etc
It works nicely and all, so now I was wondering- is it possible to create a sfx to match it? It would be perfect if it was sync'd to the static effect (so noise sfx plays when images a-e appear, and nothing/silence plays when its f-g) although a randomly generated one is fine too. Is it possible, and is it practical? If there's static on screen for around 30-60 or so of reading, are there any other better options for sfx? (There's a bgm playing in the background too)

Also...what's a 'good' noise sfx like? Been playing around but I can never get to a point where I'm happy with it

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Random noise generator

#2 Post by JinzouTamashii »

Go here http://www.freesound.org/searchText.php and type in static or white nose. Download Audacity for all your audio editting needs and convert whatever it is you choose to ogg format.

Code: Select all


label staticgo:
play music "static.ogg"
show staticdisrupt with dissolve
return

label staticstop:
hide staticdisrupt with dissolve
stop music
return

label start:
scene tv
call staticgo
i "Shit!"
"Bang! {w=.5} Whud! {w=.5} Thump!"
call staticstop
i "Ah, there we go."

Also, there is a way to make a separate channel to play your static music or sound in and stop that, but I don't know how or where I first saw it and where to look it up at. All I know is that it can be done. I just choose music because it loops automatically.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Random noise generator

#3 Post by Jake »

JinzouTamashii wrote: Also, there is a way to make a separate channel to play your static music or sound in and stop that
You can play your static on a different channel, sure, and you can mute/stop that channel independently of the others... but this doesn't help with synching. You can't, to my knowledge, synch your static with the frames of an animation easily. You could probably use a custom displayable and control it all yourself, but it's not the simplest thing in the world.
Server error: user 'Jake' not found

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Random noise generator

#4 Post by JinzouTamashii »

Why does it need to by synched?

Static is random white noise. As an animator, I can't understand what you want to sync it to ... by its very definition, visual and audio static are random. Even radio static, the leftovers of background radiation from the beginning of the universe, is random when perceived by human ears.

How would you sync "random"? You can only sync something pseudo-random, which is by its very definition nonrandom.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Random noise generator

#5 Post by Jake »

JinzouTamashii wrote:Why does it need to by synched?
...
How would you sync "random"?
It needs to be synched because that's what the original poster asked for - they have a random state-machine animation which switches between some frames of static and some blank frames, and asked if it was possible to synch the white-noise to the static frames and silence to the blank frames.

It would be doable, but I think you'd need to write a custom displayable that managed the animation itself and also played/stopped the 'music' depending on what state it was in (which isn't a trivial thing), because there's no facility to synch sound with animations in Ren'Py. And I'm just assuming that the audio functions would work from within a displayable, of course.
Server error: user 'Jake' not found

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Random noise generator

#6 Post by PyTom »

Jake wrote:And I'm just assuming that the audio functions would work from within a displayable, of course.
FWIW, they should.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Gumaster
Regular
Posts: 93
Joined: Sun Sep 06, 2009 6:54 am
Contact:

Re: Random noise generator

#7 Post by Gumaster »

Sounds like something that is far, far beyond my capabilities...for now :D
Well, no matter. I'll settle with non-synced looped disrupted noise for now. Thanks for all the info.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]