Read a text (.txt) file in Max in real time and convert it to an int or float

SFV Sound's icon

I am a newbie in Max, really need some help here.

I want to read a .txt file every 2 seconds and convert the value in this .txt file into an int number to control the frequency of a cycle~ object through a mtof~ (what is in the .txt file is an "always randomly changing" number from 0 to 127 -midi-). In this moment I can read a txt file with the text object, when I double click it, this object shows the string number that is in the text file but when I try to visualize it in a number box it doesn't work. I tried connecting a "metro 2000" to the inlet of the text object to read the .txt file every 2 seconds, but the text object doesn't understand this bang.

I'll really appreciate any help, kind of desperate trying to figure out how to this correctly.

(The current patch image is attached in this post)

duda1.png
png
double_UG's icon

message "dump" or "line $1". Look at the Text helpfile.

Unbenannt.png
png