Pop

Can anyone help me create a pop sound, like bubble wrap, using the sound() function and sliders. I was messing around with a decent pop sound and Codea crashed for some reason? I really don’t understand what each slider does but im trying to manipulate. The sound does actually have to do with my game and its boring without it. Thank you!!!

can anyone help?

.@simeon I wanted to help veeeralp so i opened the sound example, but it is not really usable anymore for quickly finding the sound one is looking for. It seems you have changed it since 1.4.3? This new one seems more parametrable, but i thought there were some indication of sound number in the previous one. It was then possible to try sounds and keep the one we need. Now there is just a sound and no number, and when we switch to detailed view, the sound setting are not the one that just played. So it is very difficult to built a sound from that. What would be great would be if after playing a sound on the basic menu, switching to the detailed menu would show this sound parameters. I thought i would modify the code mysel to do it, but when opening the code… Yeech! Too complex for me… I don’t understand what calls what etc…

.@Jmv38 the sound picker shouldn’t have changed at all (I haven’t touched it). I’ll have a look.

.@Simeon did you find anything wrong? I really need to create this pop sound but it’s so hard for some reason.

@Jmv38 thanks for your help and hopefully I can work something out with what I have now

.@Fred could you post a ‘pop’ sound example for veeeralp? Last time you were a great help for my whistle sound. Once i have a sound that is close to my need it is relatively easy to polish it until i get exactly what i want.

.@Jmv38 hey, I have something similar to a pop sound for my project. It’s close, but not perfect:

sound(DATA, "ZgJAJwNCPEJCO0A/OsmDvC13Uj3O2qw+fQBAf0A+PUBCfzs+")

Hi @Jmv38 and @veeeralp, here is a pop sound I made with SoundSlider http://twolivesleft.com/Codea/Talk/discussion/614/sound-slider-generate-the-sound-call-for-programmatic-use/p1

sound({StartFrequency = 0.181424, AttackTime = 0, SustainTime = 0.191331, SustainPunch = 1, DecayTime = 0, MinimumFrequency = 0, Slide = 1, DeltaSlide = 0.514757, VibratoDepth = 0.506914, VibratoSpeed = 0.526522, ChangeAmount = 0.518679, ChangeSpeed = 0.518679, SquareDuty = 0.491228, DutySweep = 0.601032, RepeatSpeed = 0.487306, PhaserSweep = 0.879463, LowPassFilterCutoff = 0.675542, LowPassFilterCutoffSweep = 0.499071, LowPassFilterResonance = 0.531476, HighPassFilterCutoff = 0.519711, HighPassFilterCutoffSweep = 0.535397, Waveform = 2, Volume = 1})

Sorry but i can’t help you if it is in this form. It has to be like whistle below, then i can more or less tune it…

function setup()
    parameter("p",0,1.5,0.800)
    parameter("ps",0,1,.38)
    parameter("vol",0,2,1)
end

function draw()
    background(40, 40, 50)
    text("tap screen for sound",WIDTH/2,HEIGHT/2)
    if s then
local whistle = {StartFrequency= 1, AttackTime = 0, SustainTime = 0.25, SustainPunch = 0.6, DecayTime = 0, MinimumFrequency = 0, Slide = 0.5, DeltaSlide = 0.5, VibratoDepth = 0.6, VibratoSpeed = 0.9, ChangeAmount=0.6, ChangeSpeed = 0.7, SquareDuty = 0.5, DutySweep = 0.5, RepeatSpeed = 0.5, PhaserSweep = 0.5, LowPassFilterCutoff = 1, LowPassFilterCutoffSweep = 0.5, LowPassFilterResonance = 0.5, HighPassFilterCutoff = 0.5, HighPassFilterCutoffSweep = 0.6, Waveform = 0, Volume = 1}
       sound(whistle)
         s=false
    end    
end

function touched(t)
    if t.state==BEGAN then
        s=true
    end
end

Fred fired exactly when i was writing my answer! Have ti check that pop.

Hi chaps, try out soundslider, same parameters as the advanced sound picker, but it doesn’t encode them, meaning you can tweak them later.

.@Fred that pop sounds nice! Is it what you wanted @veeeralp?

… goes the weasel. :slight_smile:

This is all pretty ‘real time’.

Here is my pop from your pop. What do you say Veeeralp?

local pop = {StartFrequency = 0.1, AttackTime = 0, SustainTime = 0.2, SustainPunch = 1, DecayTime = 0, MinimumFrequency = 0, Slide = 1, DeltaSlide = 0.5, VibratoDepth = 0.5, VibratoSpeed = 0.5, ChangeAmount = 0.5, ChangeSpeed = 0.5, SquareDuty = 0.5, DutySweep = 0.6, RepeatSpeed = 0.5, PhaserSweep = 0, LowPassFilterCutoff = 0.6, LowPassFilterCutoffSweep = 0, LowPassFilterResonance = 0.25, HighPassFilterCutoff =0.5, HighPassFilterCutoffSweep = 0.5, Waveform = 2, Volume = 0.5}
       sound(pop)

.@Fred @Jmv38 these all sound really awesome, but I think I will go with@Fred’s. in the beginning, I was actually going for a sound similar to the one in this video:

http://m.youtube.com/#/watch?v=D54ECICBsCA

but these will do. Thanks everyone for your tremendous help

Challenge accepted :slight_smile:

Play these two sounds in order, leaving the right amount of time between them (the programming challenge):

sound({StartFrequency = 0.106914, AttackTime = 0.255934, SustainTime = 0.403096, SustainPunch = 0.675542, DecayTime = 0, MinimumFrequency = 0, Slide = 0.679463, DeltaSlide = 0.526522, VibratoDepth = 0.506914, VibratoSpeed = 0.526522, ChangeAmount = 0.538287, ChangeSpeed = 0.561816, SquareDuty = 0.491228, DutySweep = 0.601032, RepeatSpeed = 0, PhaserSweep = 0.879463, LowPassFilterCutoff = 0.675542, LowPassFilterCutoffSweep = 0.499071, LowPassFilterResonance = 0.531476, HighPassFilterCutoff = 0.519711, HighPassFilterCutoffSweep = 0.535397, Waveform = 3, Volume = 1})

sound({StartFrequency = 0.530444, AttackTime = 0, SustainTime = 0.0736842, SustainPunch = 1, DecayTime = 0.0266253, MinimumFrequency = 0, Slide = 0.5, DeltaSlide = 0.5, VibratoDepth = 0.5, VibratoSpeed = 0.5, ChangeAmount = 0.5, ChangeSpeed = 0.5, SquareDuty = 0.5, DutySweep = 0.5, RepeatSpeed = 0.5, PhaserSweep = 0.5, LowPassFilterCutoff = 1, LowPassFilterCutoffSweep = 0.5, LowPassFilterResonance = 0.5, HighPassFilterCutoff = 0.5, HighPassFilterCutoffSweep = 0.5, Waveform = 2, Volume = 1})

.@Fred wow. you’re awesome. I can’t thank you enough. I never really needed the whoosh sound, it was just part of the video. The pop sound is amazing. Thanks again

No worries. :slight_smile:

BTW, @Jmv38, I was initially confused about your comment on the sound example - I thought you meant the advanced sound picker, which is built in. The Sounds Plus example project doesn’t let you modify basic sounds, which are seeded randomly, but the built in advanced picker does. Unfortunately it encodes the results so you can’t modify it. It is technically possible to decode, though. Perhaps @Simeon could give us a clue to the encoding scheme so we can roll our own decoder.

The string is a base64 encoded sequence of binary values that are directly passed into the LoadSettings() function of sfxr. If your interested in writing a decoder I can extract them.

Hi @Codeslinger, that would be very helpful, thanks.