BPM on OLED display


#1

Hey all, Im looking at displaying the BPM of my patches on my OLED display.. eg. 120bpm. A lfo conversion object (I guess). Ive done a search but the last thread was quite old, has this been figured?


#2

This object, byt Sptnk can give you the speed in bpm, based on a clock/counter:

sptnk/sequencer/24ppq to bpm


#3

Much thanks @jaffasplaffa, I got it working. Although it seems a bit glitchy when outputting between 100 and 109. The middle character (being 0) is blank. So instead of 105 (bpm) it will display 1 5.


#4

I think @SmashedTransistors know a lot about the display stuff. I have a few but never got around to getting them connected.. Maybe he can suggest something :slight_smile:


#5

i think this might be an issue where you feed the oled an actual NUL instead of the ascii 0 symbol. you should try convertingg the integer from the bpm object to a string before you pass it to the oled object.

fwiw for some numbers formatting i stole this code from i dont remember where, basically it is for fixed-digit formattingg of numbers but mught solve your issue too.

int i = attr_nrpn.array[midi_nrpn]; //your original int value, c being the char array that you wanna output
int i0 = i/10;
c[10] = '0'+i-10*i0;
i = i0; i0 = i/10;
c[9] = '0'+i-10*i0;
i = i0; i0 = i/10;
c[8] = '0'+i-10*i0;
i = i0; i0 = i/10;
c[7] = '0'+i-10*i0;

this also shows were i think your problem might lie: '0' vs 0. number symbol vs number.


#6

Hey Weasel, yeah I got this feeling also. "this also shows were i think your problem might lie: '0' vs 0. number symbol vs number"
I wonder if @Sputnki might want to update the code for sptnk/sequencer/24ppq to bpm? It's a bit above me. But otherwise it works very well.


#7

The problem isn't in 'sptnk/sequencer/24ppq to bpm'.

Unrelated observation:
There IS a bug in 'sptnk/sequencer/24ppq to bpm' - it reports double the correct number of BPM and 1000bpm. The problem is that it counts both rising and falling transitions of the inlet clock.


#8

I added tiar/conv/i_to_c object to the library, it can handle integer in the -99999 to +99999 range.


#9

this is super handy, i will cheeck it out and (in case you didn't already) try add some formatting options, leading zeroes etc.