Git Product home page Git Product logo

diverstestsjava's Introduction

  • 👋 Hi, I’m @gabywald
  • 👀 I’m interested in #TTRPG : #CyberPunk , #Cthulhu , #DeltaGreen ; most devs here are on #Java #LaTeX #Perl #Python and #TXT (maybe #RUST one day)
  • 📫 How to reach me : https://linktr.ee/gabywald
  • OSS stand for "Open-Source-Software" ? and "Free Software" : Free as in FreeDom not as in "Free Beer (or wathever you pay for)" !
  • #geek #biogeek #bioinfo #spaceopera #cyber #linux #ubuntu #jdr #roliste #cyberpunk #deltagreen #bioinformatics #dataengineer #data #BigData #OSINT (?)

diverstestsjava's People

Contributors

dependabot[bot] avatar gabywald avatar

Watchers

 avatar

diverstestsjava's Issues

check alternatives for here when exception occurs !! (builder ?) : see StringUti...

// TODO check alternatives for here when exception occurs !! (builder ?) : see StringUtils.applySha256 comment !
} catch (BlockchainException e) {
// e.printStackTrace();
System.out.println(e.getMessage());
this.id = null;
}


This issue was generated by todo based on a TODO comment in 4d7f814 when #14 was merged. cc @gabywald.

JADE Experiements

https://gist.github.com/gyassine/a6689d1d7b5332da561f73401917d605
mvn install:install-file -Dfile=src/main/resources/Jade/JADE-bin-4.6.0/jade/lib/jade.jar -DgroupId=jade -DartifactId=jade -Dversion=4.6.0 -Dpackaging=jar -DgeneratePom=true
java -cp src/main/resources/Jade/JADE-JADE-all-4.6.0/JADE-bin-4.6.0/jade/lib/jade.jar jade.Boot -gui

upgrade / improve this method (applySha256) to return null value if any exceptio...

* TODO upgrade / improve this method (applySha256) to return null value if any exception inside !
*/
public static String applySha256(String input)
throws BlockchainException {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");


This issue was generated by todo based on a TODO comment in 4d7f814 when #14 was merged. cc @gabywald.

replace GsonBuilder !! (build json from objet !)

// TODO replace GsonBuilder !! (build json from objet !)
import com.google.gson.GsonBuilder;
/**
* NoobChain Test and Main Class of BlockChain.
* <br/><a href="https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa">https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa</a>


This issue was generated by todo based on a TODO comment in f210ffc when #8 was merged. cc @gabywald.

Java Sounds and Colored Noises

https://stackoverflow.com/questions/26963342/generating-colors-of-noise-in-java
https://noisehack.com/generate-noise-web-audio-api/

https://fr.wikipedia.org/wiki/Bruits_colorés
https://en.wikipedia.org/wiki/Colors_of_noise

https://www.izotope.com/en/learn/colored-noise.html

https://github.com/DinuGanea/Perlin-Noise
https://fr.wikipedia.org/wiki/Bruit_de_Perlin

https://stackoverflow.com/questions/50220948/noise-generation-room-noise

https://blog.demofox.org/2017/10/20/generating-blue-noise-sample-points-with-mitchells-best-candidate-algorithm/

https://docs.thi.ng/umbrella/colored-noise/

https://www.cirrusresearch.co.uk/blog/2023/04/the-colours-of-noise/

The Colours of Noise: What are they and what do they mean?

26th April 2023 FAQs, Featured, News & Press Releases, Noise Measurement

Noise is found all around us. The sound of traffic, the hum of an air conditioner, and the rustling of leaves in the wind are all examples of noise that we hear around us in our environment all day.

But did you know that different types of noise are categorised by different colours? Each different type of noise has a unique spectral distribution, and each of these colours can be used effectively in different contexts.

White Noise

White noise is probably the most well-known colour of noise and is a type of noise that has equal power across all frequencies. It sounds like static or the hiss of a television set and is often used as a masking sound to drown out other noises.

Pink Noise

On the other hand, pink noise has equal power per octave, which means that it has more energy in the lower frequencies than white noise, but less than brown noise. Pink noise sounds like a waterfall or rain falling steadily and is considered more soothing than other colours of noise. Pink noise has been shown to improve sleep quality and memory consolidation in some studies.

Brown Noise

Brown noise, also known as red noise, has a spectral distribution that decreases by 6 decibels per octave. This basically means that it has more energy in the lower frequencies and less energy in the higher frequencies. Brown noise sounds like a low rumble or a deep roar, similar to the sound of the ocean or a distant thunderstorm. It is usually used for relaxation and meditation, as well as to mask other sounds that might be distracting.

Both brown and pink noise are considered “natural” noises because they have a spectral distribution similar to that of many natural sounds. In fact, pink noise is very similar in spectral distribution to many natural phenomena, such as ocean waves, heartbeats and even the distribution of galaxies in the universe.

Blue Noise

Blue noise is a type of noise that has more energy in the higher frequencies. It can be described as a high-pitched hissing sound, similar to the sound of steam escaping from a pipe. Blue noise is sometimes used in audio engineering to create a sense of space or depth.

Violet Noise

Violet noise is a more extreme version of blue noise, with even more energy in the higher frequencies. It can be described as a very high-pitched sound, like the sound of a dentist’s drill.

The colours of noise are an interesting and very useful way to categorise the different types of noise that we encounter in our environment. Understanding the different characteristics of each type of noise can help us to use them effectively in different contexts.

So whether you need to drown out distracting noises, improve your sleep quality, or create a calming atmosphere, there’s a colour of noise to help!

https://www.brownnoiseradio.com/resources/generate-white-noise-in-java%3A-simple-steps-and-explanation
Generate White Noise in Java: Simple Steps and Explanation

May 18, 2024

Generating white noise in Java, a popular programming language, might come in handy for various scenarios such as testing audio equipment, sound masking or even improving sleep quality by blocking out external sounds. In this article, we'll take a step-by-step approach on how to create an application that generates white noise using Java.

What is White Noise?

White noise is a random signal that has equal intensity across all frequencies. It can be produced by combining all sound frequencies together at the same time. It is often used as a sound masking technique, to block out external noises and help people focus, relax or sleep better.

Steps to Generate White Noise in Java:

Import necessary libraries:

To create a white noise generatorSteps to Generate White Noise in Java: Import necessary libraries: To create a white noise generatorSteps to Generate White Noise in Java: Import necessary libraries: To create a white noise generatorSteps to Generate White Noise in Java: Import necessary libraries: To create a white noise generator, we need to import the required libraries for audio processing. Add the following import statements at the top of your Java class:

import javax.sound.sampled.*;
import java.util.Random;

Configure the Audio Format:

Before generating audio data, we need to define an audio format that specifies the properties of the sound, such as sample rate, sample size, and number of channels. Add the following code snippet within your main method:

AudioFormat audioFormat = new AudioFormat(44100, 16, 1, true, false);

This configures the audio format to have a sample rate of 44,100 Hz, 16-bit samples, one channel (mono), signed data, and little-endian byte order.

Create the Audio Data Buffer:

Next, we need to create a buffer that will hold the white noise data. Allocate an array of bytes that is large enough to store a few seconds' worth of audio:

byte[] buffer = new byte[44100 * 2];

This creates a buffer that can hold two seconds of audio at the specified audio format.

Generate the White Noise:

Now, we'll use the Java Random class to generate random samples for the white noise. Iterate over the buffer and fill it with random byte values:

Random random = new Random();
for (int i = 0; i < buffer.length; i++) {
buffer[i] = (byte) random.nextInt(256);
}

Play the White Noise:

Finally, we need to play the generated white noise. To do this, we'll use the SourceDataLine interface provided by the Java Sound API. Add the following code snippet to set up the audio playback:

DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
try {
SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
line.open(audioFormat);
line.start();
line.write(buffer, 0, buffer.length);
line.drain();
line.close();
} catch (LineUnavailableException e) {
e.printStackTrace();
}

That's it! Run your Java application, and it should play two seconds of white noise. You can adjust the buffer size or use a loop to continuously generate and play white You can adjust the buffer size or use a loop to continuously generate and play white noise for longer durations.

In conclusion, this article has provided a simple explanation and step-by-step guide on how to generate white noise using Java. It's a useful technique that can be applied in various applications related to audio processing or sound masking.

https://balanceapp.com/blog/what-are-color-noises
What are color noises? A comprehensive guide to the colors of sound
September 19, 2023 by Anna REVIEWED by Jaime

Did you know that the familiar background sound you hear every time you're in an airplane is actually a specific type of color noise? And that there are many other color noises, too?

Much like the way light frequencies are categorized into colors, different blends of sound frequencies are categorized as distinct noise colors.

In this comprehensive guide, we'll explore the colors of sound—which we like to call the sound rainbow—from the well-known white noise to lesser-known sounds like pink and brown noise. We'll also discuss what each color represents, how they're created, and their potential benefits in various settings.

So whether you're looking to improve your focus while working or help yourself relax before bed, understanding the different colors of sound can be incredibly helpful. Let's dive in!
What is color noise?

Color noise, in the context of audio, refers to its power spectrum, which encompasses both its strength and the distribution of its frequencies.

Sound reaches us in the form of waves, each with its own distinct characteristics. On one end of the spectrum, the waves are tight and short, indicating high frequencies reminiscent of the rapid beats of a hummingbird's wings. On the other end of the spectrum, we have the long, leisurely undulating waves, corresponding to low frequencies and evoking the image of the gentle swaying of ocean waves.

Of course, sounds often fall somewhere between these extremes, encompassing a vast range of frequencies that our ears perceive differently. It's this variety in frequency and amplitude distribution that leads us to classify noise into various "colors" such as white, pink, or brown, each painting its own acoustic picture.
Volume and frequency: How they affect the effectiveness of color noises

When it comes to choosing the right color noise for relaxation, sleep, or focus, the volume and frequency of each sound can make a big difference.

Volume refers to how loud or soft the sound is. For some people, a louder sound may be more effective at masking external noises and providing a consistent background sound. Others may prefer a softer sound that can be used as a gentle lullaby.
Frequency refers to how high- or low-pitched the sound is. Different frequencies can have different effects on our brainwaves and body. For example, lower frequencies can promote deep relaxation and calmness, while higher frequencies can improve focus and concentration.

Experiment with different volumes and frequencies to find what works best for you. Keep in mind that everyone's preferences are different, so what works for one person may not work for another.
Understanding the specific benefits of various color noises

Want to learn a little more about the various color noises and their unique benefits? We've got you:
White noise

The wide range of tones in White Noise resembles the sounds of fans, TV static, and airplanes, and studies show it may:

Manage sleep disorders, like insomnia
Relax colicky babies
Reduce ADHD symptoms
Improve working memory

Brown noise

The deeper and lower tones of Brown Noise have similar sound frequencies as those found in waterfalls, crashing waves, and rumbling thunder, and studies show it may:

Trigger your natural relaxation response
Reduce symptoms of tinnitus
Assist your transition to REM sleep

Pink noise

The relaxing low tones of Pink Noise evoke the sounds of light rain, wind, and rustling leaves, and studies show it may:

Boost your memory recall
Increase your focus, attention span, and productivity
Improve sleep quality by matching slower brain waves

Green noise

The soothing mid-range tones of Green Noise are reminiscent of heavy rain, ocean waves, and rustling trees, and studies show it may:

Create a calm and serene sleep environment
Help you overcome sleep anxiety

https://boingboing.net/2022/08/04/what-is-your-favorite-color-of-noise-white-pink-brown-blue-violet-gray-or-black.html

What is your favorite color of noise: white, pink, brown, blue, violet, gray, or black?
Mark Frauenfelder 10:19 am Thu Aug 4, 2022
Boing Boing/MidJourney

You're probably familiar with white noise generators, which insomniacs often find useful as a sleep aid. White noise is a blend of random frequencies with a flat spectrum — any frequency band has the same amount of power as any other. I find white noise to be sharp and harsh.

Here's an example of white noise (warning — it's loud!)

Most white noise generators don't actually play white noise — they play a "colored noise" that's more soothing. Colored noises have a blend of random frequencies, but some frequencies play at a higher volume than other frequencies. This gives the noise a "color" or distinctive tone. Here are samples of some common colored sounds:

Pink noise differs from white noise — every octave contains the same amount of energy, rather than every frequency band like in white noise. It's not as sharp as white noise. It's richer, deeper. It sounds like a rushing river.
Brown noise's power drops as the frequency increases. It sounds like pink noise off in the distance. It's lush and chocolately. I find it to be the most pleasant of all colored noises.
Blue noise's signal power increases with higher frequencies. It sounds like air escaping from an inflated tire. It's startling rather than soothing.
Violet noise is like blue noise but the power increases more sharply as the frequency increases. It sounds like a thinner version of blue noise.
Grey noise is designed to fit a psychoacoustic equal loudness curve "giving the listener the perception that it is equally loud at all frequencies." I could probably fall asleep to grey noise, but it's not as velvety as brown noise.
Black noise is silence. Here's 10 hours of it.

Wikipedia has a good article about the colors of noise with examples for each one.

This originally appeared in my newsletter, The Magnet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.