Faster Array looping

Posted on
Page
of 2
Prev
/ 2
  • ...no problem with your suggestion... that would have been one of my approaches, but I did not want to deviate too much from the givens in the Web site referenced in Espruino's doc. The notation there there is easy to read, gives nice visual feed back about pacing - like good sheets do too by equidistant bars - and is easy to interpret by a machine.

    If we want to take it seriously, we would even have to account for the time the processor does 'switching'...

    On a totally 'non-musical' occasion - running continuously a stepper motor controlled by Espruino over some time - I notice irregularities in timing behavior, just by listening to the sound (noise). Each step took about 2ms, so it was about 500 Hz - with a very tight, interval driven loop (in this conversation, but driving a bit a larger bipolar OKI OL840 laser printer main stepper). It could have been some internal house keeping that made the (less prioritized) interval stutter. I hope it was not the something in the internal time keeping (that - temporary pitch change - should be not noticeable by human ear).

    In order to keep the tempo, it would not be sufficient to just make one call ofter the other... the durations would have to be calculated ever so often to stay in the beat.

    Now thinking about legato, normal accentuation, and staccato - a quite more elaborate approach is required, not just for timing, but also for intensity: 2 analog output pins would have to drive an external driver. The first pin would define the amplitude (or volume), the second the frequency... To not notice the first one and not create a audio-moire, it would have to be at a very high frequency. Would be a nice experiment... and I'm interested how such a simple driver(/mixer?) could look like...

    Btw, @alexanderbrevig, could you publish some audio clips in the IoT experimentation, midi pipe organ pedals and summer conversation?

  • I haven't yet had any more time to work on this, but if you want to see the code from the video here it is: https://gist.github.com/owenmcateer/0a57­634498a922a09db1

  • I finished some more of the code and now I have a fully working game of Tetris.
    I created a post in 'Projects' with more details, a video and the code: http://forum.espruino.com/conversations/­265028/
    Thank for all your help on this guys.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Faster Array looping

Posted by Avatar for Owen @Owen

Actions