Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Upgraded push buttons
#1
Hello everyone,

I am building a DIY Audio setup based on the ALLO KATANA DAC and Moode. I have ordered many push-buttons and a rotary coder and after wiring, all Moode's options are working very nicely. However, it is very difficult to get all typical options that you have with a regular hifi system : it is easy to get "PREV" and "NEXT" buttons associated with a third button with "MPC TOGGLE", but to manage other functions (like to create a playlist for example), it seems to be much more difficult.

One option that I would personally have would be able to "cycle" actions when making multiple press on the same button: for example, to have "Repeat"/"Single"/"Random" for a song in an existing playlist. I remember that Tim explained that it is possible to associate a "button" with a a Bash script, but due to my very low programing knowledge, I do not see how to get such a possibility.

I am maybe asking too much from Moode (I understand that this software is mainly designed to be used with a tactile interface), but I thank in advance anyone that could bring to me a piece of advice on how to do to upgrade the currently offered "push-button options" .

Best regards,
Reply
#2
For example, you can use this script and add the function time.

When starting the script, read time, from the last call and compare with the current time.

Code:
#!/bin/bash
t1=$(date +%s)
echo $t1
t2=$(cat time.log)
echo $t2
delta=$(( ($t1-$t2) ))
echo $t1 > time.log
echo $delta

if [ $delta -lt 2 ]
    then
        echo "Button pressed twice"
        double=1
fi

if the value $delta is small, you pressed the button twice.

like this you can extend the functions
Reply
#3
(04-29-2020, 07:12 AM)owagott Wrote: For example, you can use this script and add the function time.

When starting the script, read time, from the last call and compare with the current time.

Code:
#!/bin/bash
t1=$(date +%s)
echo $t1
t2=$(cat time.log)
echo $t2
delta=$(( ($t1-$t2) ))
echo $t1 > time.log
echo $delta

if [ $delta -lt 2 ]
    then
        echo "Button pressed twice"
       double=1
fi

if the value $delta is small, you pressed the button twice.

like this you can extend the functions

Thank you for this proposal. I will look into it and see what I can do with it.



Best regards,
Reply


Forum Jump: