< Back to IRCAM Forum

Adding ".0" into elements of a list

Hello,

Since I’m working with trees I want to add ties (.0) to some elements of a list. I wanted to do it inside an omloop so I could make iterations.

For example, If I had a lis of pulses ((5 4 5 6) (4 3 6 5) (4 5 5 3)) and I wanted it to became ((5 4 5 6) (4.0 3 6 5) (4.0 5 5 3)), what would be the best way to do it? I couldn’t find a function that does this kind of mergging: adding .0 to a regular number or transforming a regular number into a float one.

Thanks in advance!

Alex

Dear Alex

you have just multiply your numbers by 1.0

But be careful not to have a starting note by a tie. This actually can lead to further problems.

Best
K

… or you can convert an integer to a float using the function ‘FLOAT’
See : http://clhs.lisp.se/Body/f_float.htm