Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
Hi Christoph.
Why does it take so much time to start the SoundPlayer?
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Best, Marcel Am 27.06.2021 20:22:20 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
Hi Marcel,
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Yes, I have already considered such a kind of workaround. Still, I'm confused about how starting a process can take more than 100 milliseconds, which looks suspicious to me ... :-) http://www.hpi.de/
Best, Christoph ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 28. Juni 2021 11:05:09 An: squeak-dev Betreff: Re: [squeak-dev] Many questions about sounds :-)
Hi Christoph.
Why does it take so much time to start the SoundPlayer?
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Best, Marcel
Am 27.06.2021 20:22:20 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de:
Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
Hi Christoph.
Still, I'm confused about how starting a process can take more than 100 milliseconds, which looks suspicious to me ... :-)
While it might be nice if we could somehow speed up "process" management in Squeak, creating OS threads (and similar control structures) is known to be a noticeable overhead for highly-async applications. There are "thread pools" to mitigate this, for example:
https://docs.microsoft.com/en-us/windows/win32/procthread/thread-pools [https://docs.microsoft.com/en-us/windows/win32/procthread/thread-pools]
https://refspecs.linuxbase.org/gtk/2.6/glib/glib-Thread-Pools.html [https://refspecs.linuxbase.org/gtk/2.6/glib/glib-Thread-Pools.html]
Such a "process pool" for Squeak would be cool. :-)
pool nextWorker value: [:process | process priority: 45. self doWork].
Best, Marcel Am 28.06.2021 12:30:35 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi Marcel,
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Yes, I have already considered such a kind of workaround. Still, I'm confused about how starting a process can take more than 100 milliseconds, which looks suspicious to me ... :-) [http://www.hpi.de/]
Best, Christoph Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 28. Juni 2021 11:05:09 An: squeak-dev Betreff: Re: [squeak-dev] Many questions about sounds :-) Hi Christoph.
Why does it take so much time to start the SoundPlayer?
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Best, Marcel Am 27.06.2021 20:22:20 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
Ah, that's interesting. :-) But why is "[] newProcess" blazing fast whereas the invocation in the SoundPlayer is so expensive? Is this somehow related to the resources (closure vector) that need to be shared in this case?
Best,
Christoph
http://www.hpi.de/ ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 28. Juni 2021 12:41:32 An: squeak-dev Betreff: Re: [squeak-dev] Many questions about sounds :-)
Hi Christoph.
Still, I'm confused about how starting a process can take more than 100 milliseconds, which looks suspicious to me ... :-)
While it might be nice if we could somehow speed up "process" management in Squeak, creating OS threads (and similar control structures) is known to be a noticeable overhead for highly-async applications. There are "thread pools" to mitigate this, for example:
https://docs.microsoft.com/en-us/windows/win32/procthread/thread-pools https://refspecs.linuxbase.org/gtk/2.6/glib/glib-Thread-Pools.html
Such a "process pool" for Squeak would be cool. :-)
pool nextWorker value: [:process | process priority: 45. self doWork].
Best, Marcel
Am 28.06.2021 12:30:35 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de:
Hi Marcel,
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Yes, I have already considered such a kind of workaround. Still, I'm confused about how starting a process can take more than 100 milliseconds, which looks suspicious to me ... :-) http://www.hpi.de/
Best, Christoph ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Taeumel, Marcel Gesendet: Montag, 28. Juni 2021 11:05:09 An: squeak-dev Betreff: Re: [squeak-dev] Many questions about sounds :-)
Hi Christoph.
Why does it take so much time to start the SoundPlayer?
If you want to play sounds in your application an rely on timing, the SoundPlayer process should never stop but always run. You can achieve this by always playing an "empty sound" while additional sounds will be mixed in.
Best, Marcel
Am 27.06.2021 20:22:20 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de:
Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
On 2021-06-28, at 4:12 AM, Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Ah, that's interesting. :-) But why is "[] newProcess" blazing fast whereas the invocation in the SoundPlayer is so expensive? Is this somehow related to the resources (closure vector) that need to be shared in this case?
This almost nothing at all to do with the costs of starting a Squeak Process - which are quite close to 0 - and almost entirely the costs of starting the platform sound system, getting the samples into the platform sound system buffers, and said sound system actually getting around to making speakers wobble back and forth. Another layer of possible time-spending is the fairly complex code in SoundPlayer class>>#playLoop and its friends.
I'm not certain, but I also suspect that only Mac has actually functional quick-start code in the sound plugin.
It might be instructive to insert some time tagging to measure how long it takes from sending the sound buffer to the OS until the actual sound comes out. And indeed how long from asking Squeak to start playing until it gets to the OS buffer.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Old programmers never die; they just branch to a new address.
Hi Tim, thanks for the background! So most likely, I will implement some kind of infinite NullSound to work around the issue.
But then my profiler stack must be wrong? Is this an issue with MessageTally?
Best,
Christoph
http://www.hpi.de/ ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von tim Rowledge tim@rowledge.org Gesendet: Montag, 28. Juni 2021 20:26:56 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Many questions about sounds :-)
On 2021-06-28, at 4:12 AM, Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Ah, that's interesting. :-) But why is "[] newProcess" blazing fast whereas the invocation in the SoundPlayer is so expensive? Is this somehow related to the resources (closure vector) that need to be shared in this case?
This almost nothing at all to do with the costs of starting a Squeak Process - which are quite close to 0 - and almost entirely the costs of starting the platform sound system, getting the samples into the platform sound system buffers, and said sound system actually getting around to making speakers wobble back and forth. Another layer of possible time-spending is the fairly complex code in SoundPlayer class>>#playLoop and its friends.
I'm not certain, but I also suspect that only Mac has actually functional quick-start code in the sound plugin.
It might be instructive to insert some time tagging to measure how long it takes from sending the sound buffer to the OS until the actual sound comes out. And indeed how long from asking Squeak to start playing until it gets to the OS buffer.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Old programmers never die; they just branch to a new address.
On 2021-06-28, at 4:08 PM, Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Hi Tim, thanks for the background! So most likely, I will implement some kind of infinite NullSound to work around the issue.
I don't think you should need that; the soundplayer simpy fills the buffer with zeros if it is set to keep playing even when there are no actual sounds. See SoundPlayer class>>#playLoop near the end where you see 'willStop'.
Also I suspect that RestSound is already a silent note. If you see what I mean.
But then my profiler stack must be wrong? Is this an issue with MessageTally?
Oh my, be careful about opening that can of vermiform creatures. MessageTally is not very helpful about primitive times. There is/was an improved version somewhere. I'll leave that to someone else to explain.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Breakthrough: It finally booted on the first try.
For follow-up, I have solved the rest sound issue via the following do-it:
(RepeatingSound repeatForever: (RestSound dur: 10)) play
Best,
Christoph
________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von tim Rowledge tim@rowledge.org Gesendet: Dienstag, 29. Juni 2021 01:48:28 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Many questions about sounds :-)
On 2021-06-28, at 4:08 PM, Thiede, Christoph Christoph.Thiede@student.hpi.uni-potsdam.de wrote:
Hi Tim, thanks for the background! So most likely, I will implement some kind of infinite NullSound to work around the issue.
I don't think you should need that; the soundplayer simpy fills the buffer with zeros if it is set to keep playing even when there are no actual sounds. See SoundPlayer class>>#playLoop near the end where you see 'willStop'.
Also I suspect that RestSound is already a silent note. If you see what I mean.
But then my profiler stack must be wrong? Is this an issue with MessageTally?
Oh my, be careful about opening that can of vermiform creatures. MessageTally is not very helpful about primitive times. There is/was an improved version somewhere. I'll leave that to someone else to explain.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Breakthrough: It finally booted on the first try.
Ha. This is funny. Just stumbled upon the preference
SoundPlayer stopSoundWhenDone
which apparently does just what I was reinventing through my "NullSound". :-)
Best, Christoph
--- Sent from Squeak Inbox Talk
On 2021-08-30T16:55:50+00:00, christoph.thiede@student.hpi.uni-potsdam.de wrote:
For follow-up, I have solved the rest sound issue via the following do-it:
(RepeatingSound repeatForever: (RestSound dur: 10)) play
Best,
Christoph
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von tim Rowledge <tim at rowledge.org> Gesendet: Dienstag, 29. Juni 2021 01:48:28 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Many questions about sounds :-)
On 2021-06-28, at 4:08 PM, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
Hi Tim, thanks for the background! So most likely, I will implement some kind of infinite NullSound to work around the issue.
I don't think you should need that; the soundplayer simpy fills the buffer with zeros if it is set to keep playing even when there are no actual sounds. See SoundPlayer class>>#playLoop near the end where you see 'willStop'.
Also I suspect that RestSound is already a silent note. If you see what I mean.
But then my profiler stack must be wrong? Is this an issue with MessageTally?
Oh my, be careful about opening that can of vermiform creatures. MessageTally is not very helpful about primitive times. There is/was an improved version somewhere. I'll leave that to someone else to explain.
tim
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim Breakthrough: It finally booted on the first try.
Hi Christopph,
did you enable the preference to quick start sounds?
Although there seems to be a delay before the sound starts but it seems faster than 2 + 2 print it.
And [[AbstractSound scaleTest play] timeProfile] fork. is faster than your example (79 vs. 92ms vs 139 w/o quick start)
Cheers,
Herbert
Am 27.06.2021 um 20:22 schrieb Thiede, Christoph:
Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
- Why could my coffeeCupClink be broken? It's already the second
image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
Why does it take so much time to start the SoundPlayer? I could
reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
- Is there any built-in way for loudness normalization (as opposed to
"normal" volume)?
- Can you recommend any further resources in Squeak for other sound
concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
Hi Herbert,
did you enable the preference to quick start sounds?
Thank you, that reduced my startup time by nearly 50%!
Although there seems to be a delay before the sound starts but it seems faster than 2 + 2 print it.
I think that rather might be the compiler. "[2 + 2] timeToRun" is "0" for me. :-)
Best, Christoph ________________________________ Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Herbert König herbertkoenig@gmx.net Gesendet: Montag, 28. Juni 2021 13:15:01 An: squeak-dev@lists.squeakfoundation.org Betreff: Re: [squeak-dev] Many questions about sounds :-)
Hi Christopph,
did you enable the preference to quick start sounds?
Although there seems to be a delay before the sound starts but it seems faster than 2 + 2 print it.
And [[AbstractSound scaleTest play] timeProfile] fork. is faster than your example (79 vs. 92ms vs 139 w/o quick start)
Cheers,
Herbert
Am 27.06.2021 um 20:22 schrieb Thiede, Christoph:
Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
I think that rather might be the compiler. "[2 + 2] timeToRun" is "0" for me. :-)
I think that the print-it lag is caused by some UI updating logic. And GC, depending on what you do in your print-it.
Best, Marcel Am 28.06.2021 15:28:06 schrieb Thiede, Christoph christoph.thiede@student.hpi.uni-potsdam.de: Hi Herbert,
did you enable the preference to quick start sounds?
Thank you, that reduced my startup time by nearly 50%!
Although there seems to be a delay before the sound starts but it seems faster than 2 + 2 print it.
I think that rather might be the compiler. "[2 + 2] timeToRun" is "0" for me. :-)
Best, Christoph Von: Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Herbert König herbertkoenig@gmx.net Gesendet: Montag, 28. Juni 2021 13:15:01 An: squeak-dev@lists.squeakfoundation.org Betreff: Re: [squeak-dev] Many questions about sounds :-) Hi Christopph,
did you enable the preference to quick start sounds?
Although there seems to be a delay before the sound starts but it seems faster than 2 + 2 print it.
And [[AbstractSound scaleTest play] timeProfile] fork. is faster than your example (79 vs. 92ms vs 139 w/o quick start) Cheers,
Herbert
Am 27.06.2021 um 20:22 schrieb Thiede, Christoph:
Hi all!
As I'm currently developing a small project that uses sounds in Squeak, I have collected a number of questions about the Sound package and am hoping to find some answers here. Even if you are able to answer one or two questions only, I will appreciate your help! :-)
1. What is the difference between QueueSound and SequentialSound? Roughly speaking, they both appear to do the same. AbstractSound >> #, uses SequentialSound whereas QueueSound might be thread-safe. Is there any reason why the two are not unioned into a single class?
2. Why could my coffeeCupClink be broken? It's already the second image in which I, after playing around a bit with sounds, managed to break that sound by accident. In both affected images, Beeper beep just does not beep any more. However, all other SampledSounds still sound fine. SampledSound initialize and VM restart didn't help. I even tried to find out what's going wrong with the help of comparative debugging of #play, but I did not discover any meaningful difference ...
3. SoundService/SoundPlayer/SoundSystem are not thread-safe, are they?
4. Why does it take so much time to start the SoundPlayer? I could reproduce this in two images using: [[PluckedSound default play] timeProfile] fork. In both cases, the image was busy for ~150ms. If another sound is already playing, #play is fast. According to the TimeProfileBrowser, #newProcess eats up all the time (see attachment), but can this really be true? Can you reproduce this on your machines or could this be a Windows-specific thing?
5. Is there any built-in way for loudness normalization (as opposed to "normal" volume)?
6. Can you recommend any further resources in Squeak for other sound concepts such as ring modulation, sawtooth/triangle/square waves, or also other musical instruments? For example, there are flutes and oboes, but I did not find a piano sound. Would it be possible to build one as a combination of FMSounds or are these instruments more sophisticated to program?
Thanks in advance and have a happy weekend!
Best, Christoph
squeak-dev@lists.squeakfoundation.org