♦ Ongoing Research & Experiments ♦
reducing the file size of an h264 video in ffmpeg.
ffmpeg -i input.mp4 -vcodec libx264 -crf 27 -preset slower output_reduced_in_size.mp4
ffmpeg optimization for oculus quest 2.
ffmpeg -i inputvideo.mp4 -c:v libx264 -crf 18 -x264-params mvrange=511 -maxrate 120M -bufsize 150M -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -movflags faststart outputvideo.mp4
ffmpeg -i input.mp4 -c:v libx264 -crf 18 -x264-params mvrange=511 -maxrate 120M -bufsize 150M -vf "scale=5760x2880" -pix_fmt yuv420p -c:a aac -b:a 192k -r 30 -movflags faststart output.mp4
hex code for silver is: #C0C0C0
from: https://people.xiph.org/~xiphmont/demo/neil-young.html
Unfortunately, there is no point to distributing music in 24-bit/192kHz format.
Its playback fidelity is slightly inferior to 16-bit /44.1 or 16/48, and it takes up 6 times the space.
Ears and auditory concentration both fatigue quickly, so testing must be done when a listener is fresh. That means lots of breaks and pauses. Testing takes anywhere from many hours to many days depending on the methodology.
The upper limit of the human audio range is defined to be where the absolute threshold of hearing curve crosses the threshold of pain. To even faintly perceive the audio at that point (or beyond), it must simultaneously be unbearably loud.
At low frequencies, the cochlea works like a bass reflex cabinet. The helicotrema is an opening at the apex of the basilar membrane that acts as a port tuned to somewhere between 40Hz to 65Hz depending on the individual. Response rolls off steeply below this frequency.
The visible spectrum extends from about 400THz (deep red) to 850THz (deep violet)
All signals with content entirely below the Nyquist frequency (half the sampling rate) are captured perfectly and completely by sampling; an infinite sampling rate is not required. Sampling doesn't affect frequency response or phase. The analog signal can be reconstructed losslessly, smoothly, and with the exact timing of the original analog signal.
First week of April '22, experimenting with led wall & touchdesigner.
ffmpeg to resize, speed-up and convert a H265 to gif.
ffmpeg -i input.mp4 -filter:v "setpts=PTS/2,scale=200:-1" output.gif
from: "Seeing lightness in the dark" by Robert Ennis, Matteo Toscani and Karl R. Gegenfurtner. https://doi.org/10.1016/j.cub.2017.05.008
There is only one type of rod, and thus intensity and wavelength differences cannot be disentangled when only the rods are active. Different colors inevitably get mapped onto different shades of gray. The perception of lightness is also different for night vision: our results indicate that surfaces that appear to be white under daylight conditions, at best, appear medium gray under night vision, suggesting that activation of the cones is necessary for the perception of white.
We have shown that the lightness scale undergoes a significant, but asymmetric, compression in the scotopic range: white percepts are not present during scotopic viewing, while black objects are consistently perceived as black across illumination changes. We propose that white is a percept that is elicited by cone activation. This indicates a failure of lightness constancy at low light levels. Even though something appears white during photopic viewing, it does not appear white at scotopic luminance levels, and even white cats at night appear gray.
from: "Circadian Potency Spectrum with Extended Exposure to Polychromatic White LED Light under Workplace Conditions" - Martin Moore-Ede, Anneke Heitmann and Rainer Guttkuhn.
With mounting evidence that artificial light sources can disrupt circadian rhythms and lead to myriad negative health outcomes, there is a dire need for biologically healthy light sources (Zielinska-Dabkowska, 2018). There are several problems with using the previously reported circadian spectral sensitivity curve from short exposures of dark-adapted subjects to monochromatic light to spectrally engineer healthy white light sources for day and night applications.
First, the previously reported circadian spectral sensitivity from dark-adapted subjects spans a broad band of violet, blue, and green wavelengths (400-560nm), and when all of these wavelengths are removed from the polychromatic 380- to 780-nm white light spectrum, the result is an unattractive yellow-orange light not suitable for most human uses.
The definition of the steady-state Circadian Potency spectral sensitivity curve makes it feasible to design and build blue-rich white LED chips to optimize Circadian Potency during daytime hours and bluedepleted white LED chips to minimize Circadian Potency from sunset to sunrise. Because the steadystate Circadian Potency spectral sensitivity is narrower than the previously reported circadian spectral sensitivity curves for dark-adapted conditions, it permits the use of dies and phosphors that emit violet and green (plus yellow and red) wavelengths at night to produce attractive and energy-efficient white electric light, which minimizes circadian disruption.
One particularly interesting feature of the Circadian Potency spectral sensitivity curve is the relative insensitivity to spectral wavelengths less than 420 nm. This permits the incorporation of 2 important features into nocturnal circadian lighting. First, violet LED dies with peak wavelengths of 410 to 420 nm can be used to replace the typical ~450-nm blue peak emissions of conventional LEDs to spectrally engineer colorimetrically balanced attractive white-colored light.
Second, short-wavelength light is known to have alerting-, performance-, and moodenhancing properties (Rahman et al., 2014; Viola et al., 2008), leading to the proposal that blue-rich light should be used at night to reduce human error, but this has the unfortunate consequence that it could significantly increase the risk of circadian disruption and health disorders.
There is evidence that the alerting effects of 420-nm violet light are even greater than 440-nm or 470-nm blue light (Revell et al., 2006).
Why might evolutionary selection result in such a narrow band of blue wavelengths defined by the Circadian Potency spectral sensitivity curve being used to communicate the environmental day-night signal? We suggest it may be because life forms have been exposed to steady-state blue wavelengths during the day ever since the origin of life deep in the primitive oceans. Below a depth of 200 m, all other visible spectral wavelengths except for ~475-nm light are absorbed by seawater (Denton, 1990). From single- cell marine organisms such as Gonyaulax (Hastings, 2001) to humans, the fundamental apparatus consisting of (1) blue photoreceptors maximally sensitivity at ~475 nm, (2) circadian clocks, and (3) melatonin release as the internal temporal signal has been conserved for billions of years to equip life for successful predictive adaptation to a rotating planet (Moore-Ede, 1986).
from: Robert Sapolsky's Stanford lecture, Andrew Huberman's podcast on dopamine and various other papers.
One millisecond before a behavior occurred, what was going on in the brain?
What parts of the brain? What neurotransmitters?
What was it in the environment that triggered the brain to produce that behavior?
What acute hormonal exposure had to do with sensitizing you to the environmental stimulus which released the nervous system into generating the behavior?
You need to get it (the research) in the natural setting, or else you are going to lose all sorts of insight.
People will work like mad in contexts of maybe far more so than when they work in contexts of certainty.
D1 and D2 dopamine receptors:
In monogamous species what happens is right after mating when a pair bond is first formed the second that's over with levels of the D2 receptor go way down, you down regulate the levels of the receptor and you up regulate the levels of the D1 receptor.
If you drive down the D2 levels before they even mate they don't form a pair bond if you prevent the decline in the D2's after they've made it and pair bonded or if you prevent the rise in the D1's, they'll pair bond and eight and a half minutes later they'll go and pair bond with somebody else. D2 seem to mediate the rewarding anticipatory aspects of pair bonding and D1's on a certain rodential level seem to mediate the pleasure of the truly monogamous features of the pair bond.
Dopamine has everything to with how you feel right now, it has everything to do with how you will feel in an hour from now, has everything to do with your motivation and your level of desire and your willingness to push through effort.
Neuromodulators influence the communication of many neurons.
Dopamine is not just responsible for pleasure, it is responsible for motivation, drive and craving at the psychological level. Also controls time perception. Dopamine is vitally important for movement.
The dopaminergic systems are generally divided into four major pathways: mesolimbic, mesocortical, nigrostriatal, and tuberoinfundibular. However, neurons located in the substantia nigra (SN) and ventral tegmentum do not demonstrate firing pattern variability in response to sleep/wake changes, as they do in response to movement and reward.
Mesocortical and mesolimbic pathways, mainly driven by dopaminergic projections; but also by norepinephrine and serotonin projections, and modulated by glutamate (excitatory) and GABA (inhibitory). Projections from striatal brain regions to the frontal cortex occur mainly through the thalamic cores, and are influenced by other brain areas such as the amygdala (for the reward/motivational pathways), the globus pallidus, and the substantia nigra (for executive control).
The mesolimbic and mesocortical pathways, two of the brain's major dopaminergic pathways, have been implicated as key circuits that are disrupted in addictive behaviors (Blum et al., 2012). Both pathways originate primarily in the ventral tegmental area (VTA); the mesolimbic pathway projects to the nucleus accumbens, and is a part of complex circuits involving the amygdala, hippocampus, and the bed nucleus of the stria terminalis. In contrast, the mesocortical pathway projects primarily to the prefrontal cortex. Rats rapidly learn to press a lever to self-administer an electric pulse to regions along this pathway (Olds and Milner, 1954), and activation of dopaminergic neurons is necessary for this behavior (Garris et al., 1999). Some rats will even forego food and starve themselves to continue receiving stimuli to the VTA (Stutz et al., 1971). Together, these findings indicated that mesocorticolimbic dopamine (DA) circuitry contribute to the rewarding aspect of a stimulus. Subsequent findings showed that dopaminergic transmission in this system not only respond to rewards, but to the cues that reliably indicate that a reward will or will not arrive (Schultz et al., 1997).
The mesolimbic pathway is characterized by dopaminergic projections from the VTA to nucleus accumbens (NAcc) and olfactory tubercle and is involved in reward processing behavior. Preclinical studies highlight its involvement in reward seeking and reinforcement, and atypical development of this pathway is associated with ADHD and addiction in humans.
/*
Wind Sensor Rev. C to Serial (sending wind speed data in km/h to use in touchdesigner) - 18.05.22 - 13:45
*/
#define analogPinForRV 5
#define analogPinForTMP 4
const float zeroWindAdjustment = .2; // negative numbers yield smaller wind speeds and vice versa. (i have no idea.)
int TMP_Therm_ADunits; //temp termistor value from wind sensor
float RV_Wind_ADunits; //RV output from wind sensor
float RV_Wind_Volts;
unsigned long lastMillis;
int TempCtimes100;
float zeroWind_ADunits;
float zeroWind_volts;
float WindSpeed_MPH;
void setup() {
Serial.begin(57600);
Serial.println();
}
void loop() {
if (millis() - lastMillis > 100) {
TMP_Therm_ADunits = analogRead(analogPinForTMP);
RV_Wind_ADunits = analogRead(analogPinForRV);
RV_Wind_Volts = (RV_Wind_ADunits * 0.0048828125);
TempCtimes100 = (0.005 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits)) - (16.862 * (float)TMP_Therm_ADunits) + 9075.4;
zeroWind_ADunits = -0.0006 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits) + 1.0727 * (float)TMP_Therm_ADunits + 47.172;
zeroWind_volts = (zeroWind_ADunits * 0.0048828125) - zeroWindAdjustment;
// Thank you Modern Device Wind Sensor Rev. C
WindSpeed_MPH = pow(((RV_Wind_Volts - zeroWind_volts) / .2300) , 2.7265);
Serial.println(WindSpeed_MPH * 1.609);
// Serial.print(" km/h");
// Serial.print(" ");
lastMillis = millis();
// Serial.print(" TMP volts ");
// Serial.print(TMP_Therm_ADunits * 0.0048828125);
// Serial.print(" RV volts ");
// Serial.print((float)RV_Wind_Volts);
// Serial.print("\t TempC*100 ");
// Serial.print(TempCtimes100 );
// Serial.print(" ZeroWind volts ");
// Serial.print(zeroWind_volts);
// Serial.print(" WindSpeed MPH ");
// Serial.println((float)WindSpeed_MPH);
// Serial.print(" mp/h");
// Serial.print(" ");
// use these to debug - check your ground connection.
}
}
/*
esp 32 + wind sensor wifi data send for led wall - km/h wind speed
onurson 27.06.22 15:19
marco 27.06.22
*/
#include <WiFi.h>
#include <WiFiUdp.h>
/*-------------------------WIDI & UDP VARIABLES AND INITS-------------------------*/
/* WiFi network name and password */
const char * ssid = "LedWall";
const char * pwd = "*******";
const char * udpAddress = "192.168.0.157";
const int udpPort = 44444;
WiFiUDP udp;
/*-------------------------SENSOR VARIABLES-------------------------*/
const int analogPinForRV = 32;
const int analogPinForTMP = 33;
const float zeroWindAdjustment = .2; // negative numbers yield smaller wind speeds and vice versa.
int TMP_Therm_ADunits; //temp termistor value from wind sensor
float RV_Wind_ADunits; //RV output from wind sensor
float RV_Wind_Volts;
unsigned long lastMillis;
int TempCtimes100;
float zeroWind_ADunits;
float zeroWind_volts;
float WindSpeed_MPH;
float WindSpeed_KMH;
/*------------END OF VARS------------*/
void initWiFi() {
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pwd);
Serial.print("Connecting to WiFi ..");
while (WiFi.status() != WL_CONNECTED) {
Serial.print('.');
delay(1000);
}
Serial.println(WiFi.localIP());
}
void setup() {
Serial.begin(115200);
initWiFi();
Serial.print("RSSI: ");
Serial.println(WiFi.RSSI());
delay(1000);
}
void loop() {
//read sensor data
if (millis() - lastMillis > 10) { // read every 200 ms - printing slows this down further
TMP_Therm_ADunits = analogRead(analogPinForTMP);
RV_Wind_ADunits = analogRead(analogPinForRV);
RV_Wind_Volts = (RV_Wind_ADunits * 0.0048828125);
TempCtimes100 = (0.005 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits)) - (16.862 * (float)TMP_Therm_ADunits) + 9075.4;
zeroWind_ADunits = -0.0006 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits) + 1.0727 * (float)TMP_Therm_ADunits + 47.172; // 13.0C 553 482.39
zeroWind_volts = (zeroWind_ADunits * 0.0048828125) - zeroWindAdjustment;
WindSpeed_MPH = pow(((RV_Wind_Volts - zeroWind_volts) / .2300) , 2.7265);
WindSpeed_KMH = WindSpeed_MPH * 1.609;
lastMillis = millis();
}
//check for data - if data is empty just send 0's
if (isnan(WindSpeed_MPH)) {
WindSpeed_KMH = 0.0;
Serial.println(0.00);
} else {
Serial.println(WindSpeed_KMH, 6);
}
String msg = String(WindSpeed_KMH, 3);
//This initializes udp and transfer buffer
udp.beginPacket(udpAddress, udpPort);
udp.print(msg);
udp.endPacket();
delay(0);
}