{"id":1455,"date":"2018-11-26T14:27:09","date_gmt":"2018-11-26T22:27:09","guid":{"rendered":"http:\/\/tre.ucsd.edu\/wordpress\/?p=1455"},"modified":"2018-11-26T14:27:19","modified_gmt":"2018-11-26T22:27:19","slug":"mus177206-updated-fuzztrem-other-juce-details","status":"publish","type":"post","link":"https:\/\/tre.ucsd.edu\/wordpress\/?p=1455","title":{"rendered":"mus177\/206 &#8211; updated fuzztrem, other JUCE details"},"content":{"rendered":"<p>Here is the updated fuzztrem plugin with 3 parameters and controls added\u00a0<a href=\"https:\/\/tre.ucsd.edu\/wordpress\/wp-content\/uploads\/2018\/11\/ClassTest1126.zip\">ClassTest1126<\/a>.<\/p>\n<p>Sample code to parse MIDI &#8211; noteOff, noteOn and bendPitch are my own methods &#8211; you will need to write your own versions of these methods to connect the MIDI data to your process.<\/p>\n<pre>   MidiBuffer::Iterator it(midiMessages);\r\n    MidiMessage msg(0x80,0,0,0);\r\n    int pos;\r\n    int32_t note;\r\n\r\n    \/\/ start with the MIDI processing\r\n    while(it.getNextEvent(msg , pos))\r\n    {\r\n        if(msg.isNoteOn())\r\n        {\r\n            note = msg.getNoteNumber();\r\n            noteOn(note);\r\n        }\r\n        if(msg.isNoteOff())\r\n        {\r\n            note = msg.getNoteNumber();\r\n            noteOff(note);\r\n        }\r\n        if(msg.isPitchWheel())\r\n        {\r\n            bendPitch(msg.getPitchWheelValue());\r\n        }\r\n    }\r\n<\/pre>\n<p>Simple code to save your current settings to a session (pulled from my plugin ++pitchsift)<\/p>\n<pre>\r\nvoid PitchsiftAudioProcessor::getStateInformation (MemoryBlock& destData)\r\n{\r\n    \/\/ You should use this method to store your parameters in the memory block.\r\n    \/\/ You could do that either as raw data, or use the XML or ValueTree classes\r\n    \/\/ as intermediaries to make it easy to save and load complex data.\r\n    \r\n    ScopedPointer<XmlElement> xml (parameters.state.createXml());\r\n    copyXmlToBinary (*xml, destData);\r\n}\r\n\r\nvoid PitchsiftAudioProcessor::setStateInformation (const void* data, int sizeInBytes)\r\n{\r\n    \/\/ You should use this method to restore your parameters from this memory block,\r\n    \/\/ whose contents will have been created by the getStateInformation() call.\r\n    \r\n    \/\/ This getXmlFromBinary() helper function retrieves our XML from the binary blob..\r\n    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is the updated fuzztrem plugin with 3 parameters and controls added\u00a0ClassTest1126. Sample code to parse MIDI &#8211; noteOff, noteOn and bendPitch are my own methods &#8211; you will need to write your own versions of these methods to connect &hellip; <a href=\"https:\/\/tre.ucsd.edu\/wordpress\/?p=1455\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,23,1],"tags":[],"_links":{"self":[{"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1455"}],"collection":[{"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1455"}],"version-history":[{"count":1,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1455\/revisions"}],"predecessor-version":[{"id":1456,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1455\/revisions\/1456"}],"wp:attachment":[{"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}