{"url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546","repository_url":"https://api.github.com/repos/open-cogsci/OpenSesame","labels_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546/labels{/name}","comments_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546/comments","events_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546/events","html_url":"https://github.com/open-cogsci/OpenSesame/issues/546","id":243355289,"node_id":"MDU6SXNzdWUyNDMzNTUyODk=","number":546,"title":"White noise option in Synth is broken","user":{"login":"eort","id":8819465,"node_id":"MDQ6VXNlcjg4MTk0NjU=","avatar_url":"https://avatars.githubusercontent.com/u/8819465?v=4","gravatar_id":"","url":"https://api.github.com/users/eort","html_url":"https://github.com/eort","followers_url":"https://api.github.com/users/eort/followers","following_url":"https://api.github.com/users/eort/following{/other_user}","gists_url":"https://api.github.com/users/eort/gists{/gist_id}","starred_url":"https://api.github.com/users/eort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eort/subscriptions","organizations_url":"https://api.github.com/users/eort/orgs","repos_url":"https://api.github.com/users/eort/repos","events_url":"https://api.github.com/users/eort/events{/privacy}","received_events_url":"https://api.github.com/users/eort/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[{"id":425538403,"node_id":"MDU6TGFiZWw0MjU1Mzg0MDM=","url":"https://api.github.com/repos/open-cogsci/OpenSesame/labels/Bug","name":"Bug","color":"FF9800","default":false,"description":null}],"state":"closed","locked":false,"assignees":[{"login":"eort","id":8819465,"node_id":"MDQ6VXNlcjg4MTk0NjU=","avatar_url":"https://avatars.githubusercontent.com/u/8819465?v=4","gravatar_id":"","url":"https://api.github.com/users/eort","html_url":"https://github.com/eort","followers_url":"https://api.github.com/users/eort/followers","following_url":"https://api.github.com/users/eort/following{/other_user}","gists_url":"https://api.github.com/users/eort/gists{/gist_id}","starred_url":"https://api.github.com/users/eort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eort/subscriptions","organizations_url":"https://api.github.com/users/eort/orgs","repos_url":"https://api.github.com/users/eort/repos","events_url":"https://api.github.com/users/eort/events{/privacy}","received_events_url":"https://api.github.com/users/eort/received_events","type":"User","user_view_type":"public","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/open-cogsci/OpenSesame/milestones/33","html_url":"https://github.com/open-cogsci/OpenSesame/milestone/33","labels_url":"https://api.github.com/repos/open-cogsci/OpenSesame/milestones/33/labels","id":2587096,"node_id":"MDk6TWlsZXN0b25lMjU4NzA5Ng==","number":33,"title":"3.1.8 Jazzy James (8th maintenance release)","description":"","creator":{"login":"smathot","id":594936,"node_id":"MDQ6VXNlcjU5NDkzNg==","avatar_url":"https://avatars.githubusercontent.com/u/594936?v=4","gravatar_id":"","url":"https://api.github.com/users/smathot","html_url":"https://github.com/smathot","followers_url":"https://api.github.com/users/smathot/followers","following_url":"https://api.github.com/users/smathot/following{/other_user}","gists_url":"https://api.github.com/users/smathot/gists{/gist_id}","starred_url":"https://api.github.com/users/smathot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smathot/subscriptions","organizations_url":"https://api.github.com/users/smathot/orgs","repos_url":"https://api.github.com/users/smathot/repos","events_url":"https://api.github.com/users/smathot/events{/privacy}","received_events_url":"https://api.github.com/users/smathot/received_events","type":"User","user_view_type":"public","site_admin":false},"open_issues":0,"closed_issues":4,"state":"closed","created_at":"2017-06-16T10:36:48Z","updated_at":"2017-08-10T12:50:45Z","due_on":"2017-08-31T00:00:00Z","closed_at":"2017-08-10T12:50:45Z"},"comments":2,"created_at":"2017-07-17T10:38:57Z","updated_at":"2017-08-10T12:49:26Z","closed_at":"2017-08-10T12:49:26Z","assignee":{"login":"eort","id":8819465,"node_id":"MDQ6VXNlcjg4MTk0NjU=","avatar_url":"https://avatars.githubusercontent.com/u/8819465?v=4","gravatar_id":"","url":"https://api.github.com/users/eort","html_url":"https://github.com/eort","followers_url":"https://api.github.com/users/eort/followers","following_url":"https://api.github.com/users/eort/following{/other_user}","gists_url":"https://api.github.com/users/eort/gists{/gist_id}","starred_url":"https://api.github.com/users/eort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eort/subscriptions","organizations_url":"https://api.github.com/users/eort/orgs","repos_url":"https://api.github.com/users/eort/repos","events_url":"https://api.github.com/users/eort/events{/privacy}","received_events_url":"https://api.github.com/users/eort/received_events","type":"User","user_view_type":"public","site_admin":false},"author_association":"COLLABORATOR","issue_field_values":[],"type":null,"active_lock_reason":null,"sub_issues_summary":{"total":0,"completed":0,"percent_completed":0},"issue_dependencies_summary":{"blocked_by":0,"total_blocked_by":0,"blocking":0,"total_blocking":0},"body":"When trying to generate white noise with the synthesizer (either with the item, or with coding), Opensesame crashes with this error message:\r\n\r\n~~~.python\r\nTraceback:\r\n  File \"/usr/local/lib/python2.7/dist-packages/libopensesame/synth.py\", line 58, in prepare\r\n    attack=self.var.attack, decay=self.var.decay)\r\n  File \"/usr/local/lib/python2.7/dist-packages/openexp/synth.py\", line 61, in synth\r\n    signal = osc_gen(osc, key_to_freq(freq), length, rate)\r\n  File \"/usr/local/lib/python2.7/dist-packages/openexp/synth.py\", line 142, in osc_gen\r\n    return np.random.random(length*rate)*2 - 1\r\n  File \"mtrand.pyx\", line 856, in mtrand.RandomState.random_sample (numpy/random/mtrand/mtrand.c:15541)\r\n  File \"mtrand.pyx\", line 167, in mtrand.cont0_array (numpy/random/mtrand/mtrand.c:6141)\r\nTypeError: 'float' object cannot be interpreted as an index\r\n~~~\r\n\r\nThe error seems to originate because in the function `osc_gen` in `openexp/synth.py`, the length parameter is scaled down: `length *= .001`, making it a float type, which `np.random.random()` can't handle. \r\n\r\nPossible fix could be to explicitly make the input to `np.random.random()` an integer:\r\n\r\n~~~.python\r\nif _type == u'white_noise':\r\n    return np.random.random(int(length*rate))*2 - 1\r\n~~~\r\n\r\nEduard\r\n\r\n\r\n\r\n\r\n","closed_by":{"login":"smathot","id":594936,"node_id":"MDQ6VXNlcjU5NDkzNg==","avatar_url":"https://avatars.githubusercontent.com/u/594936?v=4","gravatar_id":"","url":"https://api.github.com/users/smathot","html_url":"https://github.com/smathot","followers_url":"https://api.github.com/users/smathot/followers","following_url":"https://api.github.com/users/smathot/following{/other_user}","gists_url":"https://api.github.com/users/smathot/gists{/gist_id}","starred_url":"https://api.github.com/users/smathot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smathot/subscriptions","organizations_url":"https://api.github.com/users/smathot/orgs","repos_url":"https://api.github.com/users/smathot/repos","events_url":"https://api.github.com/users/smathot/events{/privacy}","received_events_url":"https://api.github.com/users/smathot/received_events","type":"User","user_view_type":"public","site_admin":false},"reactions":{"url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/open-cogsci/OpenSesame/issues/546/timeline","performed_via_github_app":null,"state_reason":"completed","pinned_comment":null}