Hacker News new | past | comments | ask | show | jobs | submit | tulihauki's comments login

In warmer climates, yes. Not in Finland, however. Here's a graph of power use and generation in 2015:

http://www.fingrid.fi/EN/ELECTRICITY-MARKET/LOAD-AND-GENERAT...


The way I read it, OP was claiming that in any given place electricity demand goes up precisely when solar generation goes down.

Which may be true in Finland but is false in general.


I've found that a steady method for timing is by calculating the number of samples to render per "tick" and decrement the counter after each completed sample when rendering audio to the buffer in JavaScriptNode/ScriptProcessor. Eg.

samples_to_tick=Math.floor( (125.0/bpm) * (1.0/50.0)*sampleRate );

Upon the counter reaching zero, the render loop actually jumps to do sequencing and effects/modulation and then resets to counter.

In my case, the tick occurs at 50Hz because that's the PAL frame clock used in Amiga and MS-DOS module trackers like Scream Tracker and FastTracker 2. Typically trackers use a "speed" setting to additionally specify the number of ticks per pattern step - usually 6.

Although you do get sample-accurate timing, you also get latency up to the size of a single audio buffer (I use 4096 samples). While this isn't really an issue when doing purely playback, it obviously is when the audio is controlled real-time (eg. MIDI).

Anyway - the module player is at http://mod.haxor.fi/ and the source code at https://github.com/jhalme/webaudio-mod-player


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: