• hp3

    Here is the abstraction patch download.
    k1-test.pd

    posted in technical issues read more
  • hp3

    I am getting a different result in my code when I run a patch as a an abstraction vs on its own. The issue seems to be with a list append object and the right cold inlet. The patch does the following:

    1. takes a number input
    2. pass the number input to the hot side of the list append
    3. if the number input is <= 127, pass 1 to the right cold side of list append else if it is 128 or greater pass 1 + 1 (2) to the right cold side list append.
    4. format the list in a message, print the message
    5. and also print the value of the data directly.

    Here is the abstraction patch:
    abstraction with list append.PNG

    Here is the main patch:
    main patch.PNG

    When I run the main patch and enter 127 then 128 into the number atom I get the following output in the console:
    list append related console.PNG

    first problem is the number out of range. Second problem is that the $2 value in the message is not the same as the value printed from "print result".

    When I run the patch on its own and use the number atom in the patch for the value I get a different output in the console:
    patch on its own list append related console.PNG

    In this case the value of "print result" and the $2 value in the message are the same.

    It seems there is a difference in the order of execution of the print statements and maybe there is also a difference in order of when the cold inlet on the list append gets updated.

    Why is there a difference when run as an abstraction and how do I correct the number out of range error?

    thanks for your help.

    posted in technical issues read more
  • hp3

    I have an abstraction that builds a system exclusive parameter change message. I pass 3 arguments to the abstraction and it builds a system exclusive message from the 3 arguments and a value sent to the abstraction inlet from a slider.

    One of the arguments corresponds to the source (audio channel) in a k1 hardware synthesizer. The decimal value of the source that goes into the sysex message is 0,2,4, or 6. But for ease of use I want to pass 1,2,3,4 as the value of the source argument to the abstraction, then have math convert that 1-4 value into the even numbers 0 - 6.

    Here is a screen shot of the abstraction (k1sx) in the main patch with 3 arguments, 0, 41, 1 (channel number, parameter number, source number).

    abstraction-with-arguments.PNG

    The abstraction should generate a midi message with the source number converted from 1 to 0 (1 - 1 * 2).

    Here is a screen shot of my attempt to do this with an argument within the abstraction, which did not work...
    inside-abstraction-with-math.PNG

    Is there a way that I can take the $3 argument, subtract 1 multiply by 2 and then place this new value as the 2nd to the last value in the message box near the bottom of the patch?

    posted in technical issues read more
  • hp3

    thanks for all the help. I am very new to Pure data. I am not sure how to set up the delay. Are there any examples or tutorials that I might refer to?

    posted in technical issues read more
  • hp3

    ok, here is the main patch

    k1 controls.pd

    and here is the abstraction that generates the sysex
    k1sx.pd

    All of this works fine if I operate one control at a time, but if I click the bang, the ui elements update and the midi messages print out correctly but the only parameter that changes on the hardware synth is the one corresponding to the rightmost control.

    posted in technical issues read more
  • hp3

    thanks for all the suggestions. I was able to implement the send and receive technique, that seems to work well in my situation.

    However, I am noticing that when I use the bang to reset the values of the user interface, even though pd is sending out the correct midi messages for each ui element, the hardware synthesizer is not responding to the midi messages except for the last message received which would correspond to the radio button (right most control).

    Is this due to midi sysex messages being sent too quickly for the synthesizer to process and it only process the last message? Is there a way to put a delay time in between the messages?

    posted in technical issues read more
  • hp3

    By the way what the purpose of the Init/No Init button in the Slider properties window?

    posted in technical issues read more
  • hp3

    By "re-run" I meant unchecking edit mode from the Edit window.
    By "re-opening" I meant close the patch from the File menu, then use the File menu to open the patch.

    When I "re-open" the patch the abstraction sets the default values for the ui elements as I intend. But I have to close and re-open the patch file to acheive this automatic reset. I would like to achieve this when I uncheck Edit mode.

    Alternatively, I am using your suggestion of a bang to the abstraction and also a loadbang in the abstraction to output the default values to multiple sliders.

    mainpatch-bang-reset.PNG
    abstraction-to-reset-ui.PNG

    My eventual goal is to have about 10 sliders and other ui elements to transmit midi parameters to a hardware synth. I want to have default values for all of the ui elements and an easy way to reset the ui to its default values after I have used the interface.

    My current approach uses an abstraction to send a default/starting value to an outlet for each ui element. The sending of this value is triggered by either loadbang in the abstraction or a bang button in the main patch.

    Is this the preferred approach? There may be 10 outlets in the abstraction.

    posted in technical issues read more
  • hp3

    It looks like my abstraction is working correctly. I needed to close the patch and reopen. When I reopen the main patch, the slider is at the default 50 position or whatever I set in the abstraction.

    Is there a way to get the user interface to reset from re-running the patch instead of re-opening the patch?

    posted in technical issues read more
  • hp3

    I would like to have a slider with a starting value/position at the 50% position, so for example if the slider range is 1 - 100, then the starting value and position would be 50. I have used a bang to a message to the slider to set the starting value.

    bang
    |
    50(
    |
    slider

    This works fine but requires manual input on my part to set the value of the slider by clicking the bang button. I would prefer have this happen automatically, essentially reset the patch user interface controls to defaults when I run the patch. I tried an abstraction and use loadbang to trigger this routine

    abstraction
    loadbang
    |
    50(
    |
    outlet
    end of abstraction
    |
    slider - main patch

    But this did not output anything when the main patch runs.

    how would I get something to run automatically in the main patch when the patch executes?

    posted in technical issues read more
  • hp3

    Thanks for the example.

    posted in technical issues read more
  • hp3

    Thanks for the replies.

    After doing some research I think I should be using an abstraction. I will want to change 4 values in the message. The message structure is below, the pound signs show the parts of the message to change.

    240 - status
    64 - manufurer id

    - channel number

    16 - sysex function
    0 - Group num (not sure what this is may be internal external storage)
    3 - Machine ID number

    - parameter number

    - source number (1 - 4 audio sources)

    - parameter value

    247 - end

    The parameter value would come from the slider or number object, the channel number, parameter number and source number would come from arguments. Can you provide some advice on how I would merge the fixed values, the slider value and the arguments into a single message? Thanks for any help.

    here are screen shots of my two patches.

    mainpatch.PNG

    abstractionpatch.PNG

    posted in technical issues read more
  • hp3

    I am working on using a pd patch to send MIDI sysex parameters to control a Kawai K1r synthesizer parameters. My current patch is working however I would like to make my code more "resusable",

    My patch consists of a slider with an outlet to a int object that converts the slider value into a whole number, then out to a message object that contains the complete decimal code for the sysex message. I have a $1 at the position where the parameter value should change, so the int object value is inserted into the message string at that point. Then the message is sent out to the midout. I am able to use the slider in my PD patch to change the value of a parameter and see and hear the changes from the synthesizer. My patch currently has 1 slider.

    I intend to set up sliders for many parameters, and would like to avoid copying the full sysex message for each slider. It would seem preferable to store the "header" of the sysex message as a constant or global variable and build the sysex string by concatenating 3 or 4 parts; the header, the parameter number, the parameter value and the end of message.

    Below is an example message in decimal values:

    240 64 0 16 0 3 15 0 $1 247

    Reading this left to right, I only need to change the 7th and 9th values in the sysex string. How do I go about doing this in PD?

    posted in technical issues read more
Internal error.

Oops! Looks like something went wrong!