{"action":"created","issue":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/1827","repository_url":"https://api.github.com/repos/supercollider/supercollider","labels_url":"https://api.github.com/repos/supercollider/supercollider/issues/1827/labels{/name}","comments_url":"https://api.github.com/repos/supercollider/supercollider/issues/1827/comments","events_url":"https://api.github.com/repos/supercollider/supercollider/issues/1827/events","html_url":"https://github.com/supercollider/supercollider/issues/1827","id":128769858,"number":1827,"title":"someBuffer.write fails on supernova when parameters have class Float","user":{"login":"carlocapocasa","id":1167940,"avatar_url":"https://avatars.githubusercontent.com/u/1167940?v=3","gravatar_id":"","url":"https://api.github.com/users/carlocapocasa","html_url":"https://github.com/carlocapocasa","followers_url":"https://api.github.com/users/carlocapocasa/followers","following_url":"https://api.github.com/users/carlocapocasa/following{/other_user}","gists_url":"https://api.github.com/users/carlocapocasa/gists{/gist_id}","starred_url":"https://api.github.com/users/carlocapocasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlocapocasa/subscriptions","organizations_url":"https://api.github.com/users/carlocapocasa/orgs","repos_url":"https://api.github.com/users/carlocapocasa/repos","events_url":"https://api.github.com/users/carlocapocasa/events{/privacy}","received_events_url":"https://api.github.com/users/carlocapocasa/received_events","type":"User","site_admin":false},"labels":[{"id":11946377,"url":"https://api.github.com/repos/supercollider/supercollider/labels/comp:%20class%20library","name":"comp: class library","color":"CFFF7D","default":false},{"id":4477106,"url":"https://api.github.com/repos/supercollider/supercollider/labels/comp:%20supernova","name":"comp: supernova","color":"F4FF75","default":false},{"id":390573968,"url":"https://api.github.com/repos/supercollider/supercollider/labels/not%20a%20big%20issue","name":"not a big issue","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-01-26T09:27:05Z","updated_at":"2016-12-09T21:05:36Z","closed_at":null,"body":"To reproduce:\n\n(\n  Server.supernova;\n  s.waitForBoot {forkIfNeeded {\n    b.free;\n    b = Buffer.alloc(s, 999999, 2);\n    b.write(\"/tmp/foo.aiff\", \\aiff, \\float, 32.0);\n  }}\n)\n\nExpected result: 32 frames of the buffer are written to /tmp/foo.aiff\n\nActual result: File is not written, message is displayed:\n_exception in handle_message: wrong arguments for /b_allocReadChannel_\n\nReplace 32.0 (class Float) with 32 (class Integer) and it works.\nReplace Server.supernova with Server.scsynth and it works.\nIn addition to the frames parameter mentioned above, this behavior also occurs for the start and leave_open parameters. The same behavior may of course also occur for other OSC messages.\n\nOn the server side, the error appears to be triggered by the [Supernova OSC Handler class](https://github.com/supercollider/supercollider/blob/master/server/supernova/sc/sc_osc_handler.cpp) in the fire_b_write_exception function. This is called when the parameter does not pass the isInt32. So one possible cause is that only Integer and Boolean parameters get properly converted to the desired Int32 on the server.\n\nNote the error message in fire_b_write_exception is wrong (#1828).\n"},"comment":{"url":"https://api.github.com/repos/supercollider/supercollider/issues/comments/266123113","html_url":"https://github.com/supercollider/supercollider/issues/1827#issuecomment-266123113","issue_url":"https://api.github.com/repos/supercollider/supercollider/issues/1827","id":266123113,"user":{"login":"vivid-synth","id":10969331,"avatar_url":"https://avatars.githubusercontent.com/u/10969331?v=3","gravatar_id":"","url":"https://api.github.com/users/vivid-synth","html_url":"https://github.com/vivid-synth","followers_url":"https://api.github.com/users/vivid-synth/followers","following_url":"https://api.github.com/users/vivid-synth/following{/other_user}","gists_url":"https://api.github.com/users/vivid-synth/gists{/gist_id}","starred_url":"https://api.github.com/users/vivid-synth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivid-synth/subscriptions","organizations_url":"https://api.github.com/users/vivid-synth/orgs","repos_url":"https://api.github.com/users/vivid-synth/repos","events_url":"https://api.github.com/users/vivid-synth/events{/privacy}","received_events_url":"https://api.github.com/users/vivid-synth/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T21:05:36Z","updated_at":"2016-12-09T21:05:36Z","body":"In terms of saving language-side developers effort, this shouldn't make a big difference. I'm the maintainer of a Haskell client for SC and the only change I'd need is to call the ```toIntegral``` function on the value passed to the buffer write method.\r\n\r\nMy reluctance to add this to the OSC handler is that:\r\n  - This allows us to tell the server to do something imprecise: e.g. should a numFrames of 32.5 write a file with 32 or 33 frames?\r\n  - This doesn't let us do anything cool/new that would make the compromise worth it\r\n\r\nI think of the SC server as a tool which requires you, when it would make a difference, to as much as possible require you to tell it what you mean. Clients, then, have the responsibility of being user-friendly and relaying back what the user meant with precision. Since SC only lets UGens write and read Floats, getting correct input from the client is one of the only reasons we *have* different numeric types in the OSC messages.\r\n\r\nRegardless of what each server accepts, I think we should definitely add this cast to Buffer.write. This would make the original example work, and make code backwards-compatible if we wanted to remove the cast from scsynth. I'm happy to submit a PR for this."}}
{"actor":{"display_login":"vivid-synth"}}