Streaming Subsonic in higher quality at lower bitrates on Vortexbox

My primary music library is in lossless FLAC format, which Subsonic, by default, transcodes to mp3 for streaming to PC’s and mobile devices.

I’ve always used a two-step transcode for this as FFmpeg doesn’t always handle FLAC files as well as other formats, which can result in streaming problems.

Continue reading

Posted in Android, Google, Linux, Music, Streaming | Leave a comment

Yes I’m afraid of change (but not in the way you think I am)

On more that one occasion since the UK’s historic decision to leave the EU, I’ve heard it said that the remain camp was just scared of change.

It’s an interesting hypothesis, given that whatever reason some people voted to leave, one of the biggest reasons is that many in the leave campaign didn’t like the way that the UK was changing, be that demographically, democratically or for other reasons. Change is a fact of life, in our workplaces or in our communties, it’s unavoidable and whatever the relative merits of each sides particular view of the change they prefer, it’s not the reason I voted to remain.

But there is a fear I’ve had, that’s been central to my support of remain and I’m deeply concerned that it’s becoming a reality.

Continue reading

Posted in Life | Leave a comment

BBC micro:bit Modified tilt sensor in Python

This is a modified version of the previous tilt sensor application, this one tidies the code a little for readability, adding more comments and adds the ability to adjust the sensitivity.

Enjoy!

from microbit import *

#Program to read accelerometer and show tilt direction

#Sensitivity of readings (lower value to make more sensitive)
#Suggested range 20 - 240
sensitivity = 20

#Create image for when micro:bit is level
centred = Image("00400:"
                "00400:"
                "44944:"
                "00400:"
                "00400")

#Main loop
while True:
    #Get tilt readings for x and y axes
    tilt_x = accelerometer.get_x()
    tilt_y = accelerometer.get_y()
    #Use sensitivity value to adjust size of null window
    #If tilt_x or tilt_y are < sensitivity, register as level
    x_null = -sensitivity < tilt_x < sensitivity
    y_null = -sensitivity < tilt_y < sensitivity
    
	#Allow sensitivity adjustment: button a to increase, button b to decrease
    if button_a.is_pressed() and sensitivity >= 40:
        #Increase sensitivity by 20 (reduce size of null window)
        sensitivity -= 20
        #Pause 100ms so single click doesn't register as multiple presses
        sleep(100)
    elif button_b.is_pressed() and sensitivity <= 220:
        #Decrease sensitivity (increase size of null window)
        sensitivity += 20
        #Pause 100ms so single click doesn't register as multiple presses
        sleep(100)
        
    #Check if micro:bit is tilted
    #If tilted forward and x-axis is within null window point N
    if tilt_y < -sensitivity and x_null:
        display.show(Image.ARROW_N)
	#If tilted forward and right point NE
    elif tilt_x > sensitivity and tilt_y < -sensitivity:
        display.show(Image.ARROW_NE)
    #If tilted right and y-axis is within null window point E
    elif tilt_x > sensitivity and y_null:
        display.show(Image.ARROW_E)
    #If tilted back and to the right point SE
    elif tilt_x > sensitivity and tilt_y >sensitivity:
        display.show(Image.ARROW_SE)
    #If tilted back and x-axis is within null window point S
    elif tilt_y > sensitivity and x_null:
        display.show(Image.ARROW_S)
    #If tilted back and to the left point SW
    elif tilt_x < -sensitivity and tilt_y > sensitivity:
        display.show(Image.ARROW_SW)
    #If tilted left and y-axis is within null window point W
    elif tilt_x < -sensitivity and y_null:
        display.show(Image.ARROW_W)
    #If tilted forward and left point NW
    elif tilt_x < -sensitivity and tilt_y < -sensitivity:
        display.show(Image.ARROW_NW)
    
    else:
        #If level display our custom cross
        display.show(centred)
adjustable_tilt_sensor.py

 

Posted in Uncategorized | Leave a comment