Audiobus: Use your music apps together.

What is Audiobus?Audiobus is an award-winning music app for iPhone and iPad which lets you use your other music apps together. Chain effects on your favourite synth, run the output of apps or Audio Units into an app like GarageBand or Loopy, or select a different audio interface output for each app. Route MIDI between apps — drive a synth from a MIDI sequencer, or add an arpeggiator to your MIDI keyboard — or sync with your external MIDI gear. And control your entire setup from a MIDI controller.

Download on the App Store

Audiobus is the app that makes the rest of your setup better.

MOZAIC - Create your own AU MIDI plugins - OUT NOW!

1525355575879

Comments

  • Question:
    Could something (at least) partially predictive work? Chords are based off of intervals determined by semitones and relative distances same with larger music theory. Could entering what key your in (or several if you’re modulating) help?

  • @_ki Thanks so much for taking a stab at this. I love Mozaic but know nothing about coding. ( I do plan on learning, but when that happens is another story,lol) Sounds like the chord timing could be an issue but hopefully there’s a cool script that could come from this. I really appreciate your time and help looking into this.

  • Is there a way to refer to a variable by reference? I am building an "app" that creates n 8 note step sequencers. I use shift down to switch pages. I use an array for each "page" to store the relevant data.

    Tons of code could be saved if I could do something like what is represented by the following pseudocode;

    on shiftDown
    increment pageNum (wrap to 0 if pageNum is at maxPageNum)

    set current array to myArray_pageNum
    ..,,,

    Where myArray_pageNum would really refer to something like myArray_0 or myArray_1 where 0 or 1 was the pageNum

    Or alternately have a if elseif cascade that does something like

    if pageNum = 1
    Set current array to myArray_1
    Elseif pageNum = 2
    set current array to myArray_2

  • Scala FX is used to turn standard MIDI input into scale specific MIDI output using a scala style format. The script needs to have a source of MIDI notes routed to it. It will only work with synths that respond to MIDI pitchbend messages. It loads a scale using ratios and remaps incoming MIDI notes to the new scale. Any scales with more than 12 tones are expected to come from different MIDI channels (12 tones per channel across the range of octaves). C triggers the first tone in the scale. The chromatic (12ET) scale is the default scale.

    Preserves the velocity of the notes sent to it.
    Set the Pitchbend range to match your synth(s).

    You can use the script to randomly generate scales by selecting the number of tones you want in your scale.

    For more details read the instructions in the text description loaded in with the Scala FX script. You will need to scroll down to read all of the instructions.

  • @espiegel123 said:
    Is there a way to refer to a variable by reference? I am building an "app" that creates n 8 note step sequencers. I use shift down to switch pages. I use an array for each "page" to store the relevant data.

    Tons of code could be saved if I could do something like what is represented by the following pseudocode;

    on shiftDown
    increment pageNum (wrap to 0 if pageNum is at maxPageNum)

    set current array to myArray_pageNum
    ..,,,

    Where myArray_pageNum would really refer to something like myArray_0 or myArray_1 where 0 or 1 was the pageNum

    Or alternately have a if elseif cascade that does something like

    if pageNum = 1
    Set current array to myArray_1
    Elseif pageNum = 2
    set current array to myArray_2

    I use a lot of code similar to what you describe here in my scripts. In addition, a lot of Boolean variables to control and test for the execution of code. Having lots of user defined events like:

    @MyEvent
    //my code
    @End

    can make coding much more manageable as if I ever find myself retyping code, I tend to just create a new user event to replace the duplicate code with.

    The Log command is another debugging tool I use with great frequency to make sure my code is actually doing what I want it to be doing. For example: Log {@MyEvent Var1 is }, Var1 Sometimes I will create user events and insert calls to them just so I can print out key variables and arrays to see what their values are during various stages of script execution.

    Being able to comment out code is also a great way to manage Log messages and test code too. For example: //Log {@MyEvent Var1 is }, Var1 will stop sending out that Log message but I can still leave it in my code in case I make changes which lead me to wanting to verify this is working as expected.

    Two of the most painful work arounds are the lack of string variables so I end up using lots of Lookup table code structures to assign GUI labels. The other is if you have lines of code that are too long, you need to break them up into smaller lines so they’ll be read into Mozaic correctly. This will often mean creating user events to piece these lines together into arrays once they’re read into Mozaic.

    My Scala FX script has examples of all of these uses. I have script code created during testing which has a lot more built-in debugging code if anybody is interested in looking at it as an example of how you can create your own programming tools versus the sanitized and cleaned up version of the code posted for end users.

  • @InfoCheck said:

    @espiegel123 said:
    Is there a way to refer to a variable by reference? I am building an "app" that creates n 8 note step sequencers. I use shift down to switch pages. I use an array for each "page" to store the relevant data.

    Tons of code could be saved if I could do something like what is represented by the following pseudocode;

    on shiftDown
    increment pageNum (wrap to 0 if pageNum is at maxPageNum)

    set current array to myArray_pageNum
    ..,,,

    Where myArray_pageNum would really refer to something like myArray_0 or myArray_1 where 0 or 1 was the pageNum

    Or alternately have a if elseif cascade that does something like

    if pageNum = 1
    Set current array to myArray_1
    Elseif pageNum = 2
    set current array to myArray_2

    I use a lot of code similar to what you describe here in my scripts. In addition, a lot of Boolean variables to control and test for the execution of code. Having lots of user defined events like:

    @MyEvent
    //my code
    @End

    can make coding much more manageable as if I ever find myself retyping code, I tend to just create a new user event to replace the duplicate code with.

    The Log command is another debugging tool I use with great frequency to make sure my code is actually doing what I want it to be doing. For example: Log {@MyEvent Var1 is }, Var1 Sometimes I will create user events and insert calls to them just so I can print out key variables and arrays to see what their values are during various stages of script execution.

    Being able to comment out code is also a great way to manage Log messages and test code too. For example: //Log {@MyEvent Var1 is }, Var1 will stop sending out that Log message but I can still leave it in my code in case I make changes which lead me to wanting to verify this is working as expected.

    Two of the most painful work arounds are the lack of string variables so I end up using lots of Lookup table code structures to assign GUI labels. The other is if you have lines of code that are too long, you need to break them up into smaller lines so they’ll be read into Mozaic correctly. This will often mean creating user events to piece these lines together into arrays once they’re read into Mozaic.

    My Scala FX script has examples of all of these uses. I have script code created during testing which has a lot more built-in debugging code if anybody is interested in looking at it as an example of how you can create your own programming tools versus the sanitized and cleaned up version of the code posted for end users.

    Yes, those are useful techniques. As far as you know, is the answer to the question I asked: “no, it’s not possible.” (Which seems to be the case, but I was hoping that I overlooked something. I have an alternative (but messy) technique which would be array where the “pages” are offsets in that one array.

  • @espiegel You could use the page-number to compute an offset into a single array and 'fold' the data.

    For instance, if each page needs to store 12 variables (normally adressed as val = dataArray[valueIndex]), access the single array using val = dataArray[pageNumber*12 + valueIndex] . This would work for up to 1024/12 = 85 possible pages.

  • @espiegel123 said:

    @InfoCheck said:

    @espiegel123 said:
    Is there a way to refer to a variable by reference? I am building an "app" that creates n 8 note step sequencers. I use shift down to switch pages. I use an array for each "page" to store the relevant data.

    Tons of code could be saved if I could do something like what is represented by the following pseudocode;

    on shiftDown
    increment pageNum (wrap to 0 if pageNum is at maxPageNum)

    set current array to myArray_pageNum
    ..,,,

    Where myArray_pageNum would really refer to something like myArray_0 or myArray_1 where 0 or 1 was the pageNum

    Or alternately have a if elseif cascade that does something like

    if pageNum = 1
    Set current array to myArray_1
    Elseif pageNum = 2
    set current array to myArray_2

    I use a lot of code similar to what you describe here in my scripts. In addition, a lot of Boolean variables to control and test for the execution of code. Having lots of user defined events like:

    @MyEvent
    //my code
    @End

    can make coding much more manageable as if I ever find myself retyping code, I tend to just create a new user event to replace the duplicate code with.

    The Log command is another debugging tool I use with great frequency to make sure my code is actually doing what I want it to be doing. For example: Log {@MyEvent Var1 is }, Var1 Sometimes I will create user events and insert calls to them just so I can print out key variables and arrays to see what their values are during various stages of script execution.

    Being able to comment out code is also a great way to manage Log messages and test code too. For example: //Log {@MyEvent Var1 is }, Var1 will stop sending out that Log message but I can still leave it in my code in case I make changes which lead me to wanting to verify this is working as expected.

    Two of the most painful work arounds are the lack of string variables so I end up using lots of Lookup table code structures to assign GUI labels. The other is if you have lines of code that are too long, you need to break them up into smaller lines so they’ll be read into Mozaic correctly. This will often mean creating user events to piece these lines together into arrays once they’re read into Mozaic.

    My Scala FX script has examples of all of these uses. I have script code created during testing which has a lot more built-in debugging code if anybody is interested in looking at it as an example of how you can create your own programming tools versus the sanitized and cleaned up version of the code posted for end users.

    Yes, those are useful techniques. As far as you know, is the answer to the question I asked: “no, it’s not possible.” (Which seems to be the case, but I was hoping that I overlooked something. I have an alternative (but messy) technique which would be array where the “pages” are offsets in that one array.

    There are only one dimensional arrays in Mozaic, so yes you have to do manipulations (like your page offsets) to access a desired range in the array so in effect you end up simulating multi-dimensional array functionality. I find myself using lots of DIV commands for these sorts of tasks. Mozaic does support recursive calls so perhaps you’re clever enough to use them for your benefit.

  • @_ki said:
    @espiegel You could use the page-number to compute an offset into a single array and 'fold' the data.

    For instance, if each page needs to store 12 variables (normally adressed as val = dataArray[valueIndex]), access the single array using val = dataArray[pageNumber*12 + valueIndex] . This would work for up to 1024/12 = 85 possible pages.

    Looks like we wrote responses at the same time :) my backup plan is having pages be indexes such as you mention and maybe parallel arrays for storing the different types of data for the pages.

  • @brambos said:

    @ManWhoWouldBeStrings said:

    @brambos said:
    If you have a script you are willing to share which exhibits the issue that could be helpful. :)

    Yeah sure, I’m just running the Simple Recorder/Looper 1.1 by @H_Basilier with some slight modifications just to ignore recording notes from certain channels, but otherwise the same as on PatchStorage

    I am running a few other simple scripts as well in separate instances of Mozaic, modifying some of the messages before being sent to the Simple Recorder/Looper, and these instances will also sometimes lose track of the bar, which I got around by using a simple Timer counting 1-4 starting at @OnHostStart, but of course that limits my use of the timer for other things, which in the case of the looper patch is critical.

    Ok, clear. Thanks!

    I thought I should also mention @brambos if you’re still checking out this issue of Mozaic hearing the new bar incorrectly that I am Ableton link’ed to Loopy, and starting the clock via a midi command to Loopy, although I found starting it with a midi command to AUM’s start transport to also cause this issue.

  • @wim said:

    @ManWhoWouldBeStrings said:
    ...which I got around by using a simple Timer counting 1-4 starting at @OnHostStart, but of course that limits my use of the timer for other things, which in the case of the looper patch is critical.

    Side thought re: multiple timers. If I need more than one timer, I just use an array:

    Thanks for this. I actually did come up with something similar to keep track of the length of the clock in bars and beat number running in Loopy with this: where the beat of the clock can be checked and called in other instances with GLOBAL1[GLOBAL0]

    @OnLoad
    SetShortName {CLOCK}
      GLOBAL0 = 1
      FillArray GLOBAL1[1], 1, 8 //clocks 1-4
      clocklength[1] = [4, 8, 0, 16, 0, 0, 0, 32] //lengths of clocks 1, 2, 4, 8
      SetTimerInterval (QuarterNote)
      dblclock = 64
      halfclock = 65
    @End
    
    @OnHostStop
      FillArray GLOBAL1[1], 1, 8
      StopTimer
      ResetTimer
    @End 
    
    @OnHostStart
      StartTimer
    @End
    
    @OnTimer
    SetTimerInterval (QuarterNote)
    for _clock = 1 to 8
    if clocklength[_clock] >0
      if GLOBAL1[_clock] < clocklength[_clock]
        GLOBAL1[_clock] = ((GLOBAL1[_clock]) +1)
      else
        GLOBAL1[_clock] = 1
      endif
    log {clock}, _clock, {: }, GLOBAL1[_clock]
    endif
    endfor
    @End 
    
    @OnMidiNoteOn
    //keep track of Loopy’s clock bar length
      if midinote = dblclock
        GLOBAL0 = GLOBAL0 *2
      elseif midinote = halfclock
        GLOBAL0 = GLOBAL0 / 2
      endif
    @End
    

    Just thought I’d post that here as an addition to your side thought :) and of course to see if there’s any suggestions for a more efficient/effective way to accomplish this...

  • @ManWhoWouldBeStrings said:

    @brambos said:

    @ManWhoWouldBeStrings said:

    @brambos said:
    If you have a script you are willing to share which exhibits the issue that could be helpful. :)

    Yeah sure, I’m just running the Simple Recorder/Looper 1.1 by @H_Basilier with some slight modifications just to ignore recording notes from certain channels, but otherwise the same as on PatchStorage

    I am running a few other simple scripts as well in separate instances of Mozaic, modifying some of the messages before being sent to the Simple Recorder/Looper, and these instances will also sometimes lose track of the bar, which I got around by using a simple Timer counting 1-4 starting at @OnHostStart, but of course that limits my use of the timer for other things, which in the case of the looper patch is critical.

    Ok, clear. Thanks!

    I thought I should also mention @brambos if you’re still checking out this issue of Mozaic hearing the new bar incorrectly that I am Ableton link’ed to Loopy, and starting the clock via a midi command to Loopy, although I found starting it with a midi command to AUM’s start transport to also cause this issue.

    And it’s only when using multiple instances of Mozaic?

  • @brambos : it would be hugely helpful if there were a call (independent of timer events) to get an absolute(ish) time revenue that one can use to create measure time (in milliseconds) between events like pad taps and shift presses and other things. Currently, it seems like the only way to do this is to set up timer events with a really short interval. This gets messy when you are trying to track double-taps or long presses when you also need timer events.

    I understand that one make clever use of timer events to do this. But that becomes way more complex than would be necessary if there were something like a system read only function/variable like now() or tickcount(), curMilliseconds() or something.

    It would simplify a lot of things enormously when you have different types of events and need to measure the time between events of interest.

  • edited December 2019

    @espiegel123 said:
    @brambos : it would be hugely helpful if there were a call (independent of timer events) to get an absolute(ish) time revenue that one can use to create measure time (in milliseconds) between events like pad taps and shift presses and other things.

    That was added in a previous update!

    Look into SystemTime... It returns the current (at time of execution) system time in milliseconds. Note: it really is 'time of execution', so it doesn't adjust for buffer latencies etc.

  • @brambos said:

    @espiegel123 said:
    @brambos : it would be hugely helpful if there were a call (independent of timer events) to get an absolute(ish) time revenue that one can use to create measure time (in milliseconds) between events like pad taps and shift presses and other things.

    That was added in a previous update!

    Look into SystemTime... It returns the current (at time of execution) system time in milliseconds. Note: it really is 'time of execution', so it doesn't adjust for buffer latencies etc.

    Awesome! Sorry for not noticing it. Maybe it could be added to the lists of functions/variables found towards the end of the docs. Maybe it’s there and I’m just not seeing it.

  • @brambos: I just noticed that if I have more than one Mozaic window open in AUM and switch to code view in the frontmost window (when other window is showing the GUI) and tap in the code to pop up the onscreen keyboard, the Mozaic that is not the frontmost will switch to code view.

    Question: is there a way to clear the log contents? (If not, maybe long press on the Log label could clear it?

  • edited December 2019

    @brambos said:

    @ManWhoWouldBeStrings said:

    @brambos said:

    @ManWhoWouldBeStrings said:

    @brambos said:
    If you have a script you are willing to share which exhibits the issue that could be helpful. :)

    Yeah sure, I’m just running the Simple Recorder/Looper 1.1 by @H_Basilier with some slight modifications just to ignore recording notes from certain channels, but otherwise the same as on PatchStorage

    I am running a few other simple scripts as well in separate instances of Mozaic, modifying some of the messages before being sent to the Simple Recorder/Looper, and these instances will also sometimes lose track of the bar, which I got around by using a simple Timer counting 1-4 starting at @OnHostStart, but of course that limits my use of the timer for other things, which in the case of the looper patch is critical.

    Ok, clear. Thanks!

    I thought I should also mention @brambos if you’re still checking out this issue of Mozaic hearing the new bar incorrectly that I am Ableton link’ed to Loopy, and starting the clock via a midi command to Loopy, although I found starting it with a midi command to AUM’s start transport to also cause this issue.

    And it’s only when using multiple instances of Mozaic?

    As far as I’ve seen yes, but then again I’m always using multiple instances of Mozaic :) And actually since as I said it doesn’t always happen it’s hard to catch under which circumstances and when exactly it happens, but seems to be after stopping and starting the host a few times, and especially when I’m working on/testing out and re-uploading a script I’m editing.

  • @ManWhoWouldBeStrings said:
    As far as I’ve seen yes, but then again I’m always using multiple instances of Mozaic :) And actually since as I said it doesn’t always happen it’s hard to catch under which circumstances and when exactly it happens, but seems to be after stopping and starting the host a few times, and especially when I’m working on/testing out and re-uploading a script I’m editing.

    I haven't read the discussion on this super carefully, but your previous comment triggered a thought. Is it possible that you've saved a script while it had active variables in-state? When you save a script without pressing upload first, all the states of controls and variables are saved in it. If those aren't specifically initialized on a new load, they could have unexpected values in them. If any of those are counters, position variables, etc, that could have this kind of effect.

    Maybe off base, but I thought I'd throw it out there.

    I always try to be careful to upload code before saving a script, and also to think carefully about which variables should be initialized on every new load.

  • I am working on a script that uses TranslateCurve and TranslateScale on a knob value to make the value range and mapping reasonable for setting LFO frequencies in the range of about 0.01 (slow LFOs that take 100 seconds) to 10 (10 cycles per second). I have that part working nicely.

    The freq value gets stored in a variable in a preset.

    My problem is trying to map that floating point number back to the original knob value so that when the preset is recalled that it can set the knob.

    I thought that I might be able to just reverse the process, but that doesn’t quite work.

    Here is the code for processing the knob to get the frequency:
    freqMin=0.01
    freqMax = 10
    CurveFreq=3
    testValue=GetKnobValue testKnob
    temp = TranslateScale testValue,0,127,freqMin,freqMax
    freq = TranslateCurve temp,curveFreq,freqMin,

    I tried a number of things to reverse the process
    floatValue=freq
    rev1 = TranslateCurve floatValue, (1/curveFreq),freqMin,freqMax
    rev2 = TranslateScale rev1,freqMin,freqMax,0,127

    The code above is off by quite a bit for the lowest values in the range. Things are much closer if I set floatValue to freq-freqMin but that is also not quite right. I have tried quite a few other things that don’t work.

    I have a feeling that either I am making a boneheaded error in trying to reverse the process or that it isn’t possible.

    Any ideas? I can always save both the frequency value and the knob value that generated it, but if I can derive the knob value I’d prefer that as it’s more elegant.

    Any ideas?

  • wimwim
    edited December 2019

    I’m not sure I understand why you need to do that? When you save a preset, both knob values and variables are saved.

    If you only initialize the knobs and variables on a new load then everything should be restored automaticallly. The typical code I use to avoid re-initializing variables is:

    @OnLoad
    
      //If this is a brand new load, "init" will be unassigned. Otherwise
      //it will be saved with a value of TRUE
    
      if Unassigned init
        init = TRUE
        //Initialize other variables and controls here
      endif
    
      //Initialize things that must be set every time here.
    
    @End
    

    But, maybe when you’re referring to saving a preset, you mean saving it inside the app? I think in that case I’d just save the position of the knob in a variable and restore it later by a direct call instead.

    @OnKnobChange
    
      knob = LastKnob
      value = GetKnobValue Lastknob
    
      knobval[knob] = value
    
      if knob = 0
        //assign variable with TranslateScale, TranslateCurve, etc.
      endif
    
    @End
    
    @SetKnobs
    
      //Knobs array should be initialized to -1 on a new load
    
      for i = 0 to 21
        if knobs[i] <> -1
          SetKnobValue i, knobs[i]
        endif
      endfor
    
    @End
    
  • @wim said:
    I’m not sure I understand why you need to do that? When you save a preset, both knob values and variables are saved.

    If you only initialize the knobs and variables on a new load then everything should be restored automaticallly. The typical code I use to avoid re-initializing variables is:

    @OnLoad
    
      //If this is a brand new load, "init" will be unassigned. Otherwise
      //it will be saved with a value of TRUE
    
      if Unassigned init
        init = TRUE
        //Initialize other variables and controls here
      endif
      
      //Initialize things that must be set every time here.
     
    @End
    

    But, maybe when you’re referring to saving a preset, you mean saving it inside the app? I think in that case I’d just save the position of the knob in a variable and restore it later by a direct call instead.

    @OnKnobChange
    
      knob = LastKnob
      value = GetKnobValue Lastknob
     
      knobval[knob] = value
      
      if knob = 0
        //assign variable with TranslateScale, TranslateCurve, etc.
      endif
    
    @End
    
    @SetKnobs
    
      //Knobs array shoudl be initialized to -1 on a new load
    
      for i = 0 to 21
        if knobs[i] <> -1
          SetKnobValue i, knobs[i]
        endif
      endfor
        
    @End
    

    Yes, I am talking about "internal" presets. The plugins that I am working on have many knobs and settings that are useful to be able to save as internal presets that can be stored and recalled from within the plug in. For example, one has knobs to control CCs in other synths and lets you assign those knobs to LFOs. It is handy to save these as 'presets' that get recalled when tapping a pad.

    Anyway, I do understand (as I mentioned in my earlier post) that I can save both the calculated value and the knob value (or just save the knob value and recalculate the derived value) -- but I am curious as to whether it is possible to reverse the calculation and I am doing it wrong.

    This is as much a point of interest as anything else. I am interested in knowing how to perform the reciprocal calculation if its possible. And if it isn't possible that's good to know to.

    Make sense?

  • @espiegel123 said:
    Make sense?

    Yeh, but not enough to try to bend my brain around it. :D
    Hopefully someone smarter and more curious than I am will chime in. B)

  • @wim said:

    @espiegel123 said:
    Make sense?

    Yeh, but not enough to try to bend my brain around it. :D
    Hopefully someone smarter and more curious than I am will chime in. B)

    @brambos? (See post a few above about whether it is possible to reverse a combination of TranslateScale and TranslateCurve to get back the original number)

  • _ki_ki
    edited December 2019

    As i have only used TranslateScale for my knobs (where inversion just uses exchanged params), I have not yet encountered this interesting problem :) The inverse function probably depends on the type of curve applied in TranslateCurve (the manual is a bit unspecifc, it could be a kind of gamma function)

  • @_ki said:
    As i have only used TranslateScale for my knobs (where inversion just uses exchanged params), I have not yet encountered this interesting problem :) The inverse function probably depends on the type of curve applied in TranslateCurve (the manual is a bit unspecifc, it could be a kind of gamma function)

    I tried using the inverse value for the curve on the translation back and with a fudge factor (which is about the same as the min value being passed in) subtracted before the translation, I get the best translation that I've been able to get, but it isn't precise.

    I can store the knob value and do the translation only when I need it, but @brambos if there is a way to reverse the process precisely I am curious to know it. No sweat if it isn't possible, but if it is it would be cool to know.

  • @brambos : it is looking like any variable that starts with the word "global" is seen as assigned. For example, when I check

    if Unassigned globalPresetsPA

    Mozaic treats it as already existing. I am not sure if this is a bug or not. I didn't check to see if the variable behaved global (in the may global0 through global99 are)

  • @espiegel123 said:
    @brambos : it is looking like any variable that starts with the word "global" is seen as assigned. For example, when I check

    if Unassigned globalPresetsPA

    Mozaic treats it as already existing. I am not sure if this is a bug or not. I didn't check to see if the variable behaved global (in the may global0 through global99 are)

    Ah.. the interpreter tests for the string "global" at the start of a variable name and assumes it's a global if it has. This is a bug, but better treat the string "global" as a reserved word ;)

    @espiegel123 said:

    @_ki said:
    As i have only used TranslateScale for my knobs (where inversion just uses exchanged params), I have not yet encountered this interesting problem :) The inverse function probably depends on the type of curve applied in TranslateCurve (the manual is a bit unspecifc, it could be a kind of gamma function)

    I tried using the inverse value for the curve on the translation back and with a fudge factor (which is about the same as the min value being passed in) subtracted before the translation, I get the best translation that I've been able to get, but it isn't precise.

    I can store the knob value and do the translation only when I need it, but @brambos if there is a way to reverse the process precisely I am curious to know it. No sweat if it isn't possible, but if it is it would be cool to know.

    No you can't reverse the translation in an easy way. It's a power function, but not trivial to reverse.

  • @brambos said:

    @espiegel123 said:
    @brambos : it is looking like any variable that starts with the word "global" is seen as assigned. For example, when I check

    if Unassigned globalPresetsPA

    Mozaic treats it as already existing. I am not sure if this is a bug or not. I didn't check to see if the variable behaved global (in the may global0 through global99 are)

    Ah.. the interpreter tests for the string "global" at the start of a variable name and assumes it's a global if it has. This is a bug, but better treat the string "global" as a reserved word ;)

    @espiegel123 said:

    @_ki said:
    As i have only used TranslateScale for my knobs (where inversion just uses exchanged params), I have not yet encountered this interesting problem :) The inverse function probably depends on the type of curve applied in TranslateCurve (the manual is a bit unspecifc, it could be a kind of gamma function)

    I tried using the inverse value for the curve on the translation back and with a fudge factor (which is about the same as the min value being passed in) subtracted before the translation, I get the best translation that I've been able to get, but it isn't precise.

    I can store the knob value and do the translation only when I need it, but @brambos if there is a way to reverse the process precisely I am curious to know it. No sweat if it isn't possible, but if it is it would be cool to know.

    No you can't reverse the translation in an easy way. It's a power function, but not trivial to reverse.

    Ok. Thanks.

    It might be a good idea to mention in the manual not to use global at the start of a variable name (in the section on globals).

  • @brambos : I've discovered that if you try to access array indices that are out of bounds that Mozaic sometimes either doesn't return an error or returns a syntax error (at runtime) rather than returning a message related to the array bounds size. Also, some routines that probably should return errors aren't

    If trying to read from an array index >1023, you get an error like

    [RECALLPRESET] Syntax Error: unknown or invalid argument "MYPRESETS[i]"

    FillArray doesn't complain at runtime if the numcells argument is too large

    Anyway, if Mozaic gave a different message that would be grand.

  • @espiegel123 said:
    @brambos : I've discovered that if you try to access array indices that are out of bounds that Mozaic sometimes either doesn't return an error or returns a syntax error (at runtime) rather than returning a message related to the array bounds size. Also, some routines that probably should return errors aren't

    If trying to read from an array index >1023, you get an error like

    [RECALLPRESET] Syntax Error: unknown or invalid argument "MYPRESETS[i]"

    FillArray doesn't complain at runtime if the numcells argument is too large

    Anyway, if Mozaic gave a different message that would be grand.

    One other wrinkle. Mozaic doesn't complain when you assign to an out-of-bounds array index.

    I.e. no error is reported with

    myPresets[1025]=-1

    whereas

    i=myPresets[1025]

    returns the syntax error message. It seems like the assignment should get an error.

Sign In or Register to comment.