Ofelia icon indicating copy to clipboard operation
Ofelia copied to clipboard

ofToString return a list of audio driver

Open 60-hz opened this issue 3 years ago • 4 comments

ofToString function is returning a list of audio drivers, when openframeworks documentation say that it should "Convert a value to a string."

On OSX and Windows10, here is the results of conversion from 1 to 10:

Unkown API Alsa Pulse OSS Jack OSX Core Audio MS WASAPI MS ASIO MS DirectShow Unkown API

60-hz avatar Nov 16 '20 21:11 60-hz

@60-hz I could confirm this behavior which is pretty weird. Thanks for reporting this. I will have a look into this issue soon. For converting values to a string, I think you can just use tostring() which is a built-in Lua function.

cuinjune avatar Nov 16 '20 23:11 cuinjune

@cuinjune thanks for the hint, I found tostring yes :) but for this issue, I thought that I could use toboolean() in a same way but it's not working unfortunately.

60-hz avatar Nov 17 '20 00:11 60-hz

I believe toboolean() belongs to external module that you need to require? For converting numbers to boolean, you can just do num ~= 0 to make it return true or false.

For example,

[tgl]
|
ofelia f;
print(a ~= 0);

cuinjune avatar Nov 17 '20 00:11 cuinjune

Oh yes thanks, that's so simple... I forgot that lua didn't used != but ~= instead, thanks!

60-hz avatar Nov 17 '20 10:11 60-hz