Re: Re : duplicate parts


On Tue, Oct 20, 2009 at 07:25:17PM +0200, Stefan Westerfeld wrote:
> On Sat, Oct 10, 2009 at 05:42:18PM -0700, jean legrand wrote:
> > with some effort (missing docs), I have written this solution. Sorry in advance for the identation. 
> > I've left the loop range idea away and the script only copies the content of a part into another, both parts given in arguments.
> > I'm not very happy with the constant 2147483647 but I don't know how to say "find for all times".
> > Also, I think there is a more elegant way to find a part from its name but I can't find out which one.
> > 
> > Can you help me improve this code ?
> That looks nice already. However, please make sure that you do not only copy
> the notes but also the events (such as stereo panning or modulation depth).
> Another improvement that is - I think - required is to replace the string
> based specification of the part with an object based one. That is, the user
> should get a dropdown list of all possible source parts.
> I would have expected that the only thing that needs to be changed for this
> to work is replacing (bse-param-string ...) with (bse-param-part ...). However
> this did not work when I tried it, and some time spent debugging did only
> reveal so far that bseparam-proxy.* is responsible for the necessary magic,
> but I didn't figure out how to make it work. So I'll do a bit more
> debugging.
> [...]

Ok, I think I've figured out whiy using (bse-param-part ...) does not work:
the dropdown box for selecting a part is normally filled with candidates
by calling bse_item_get_candidates function like:

static void
bse_wave_osc_get_candidates (BseItem               *item,
                             guint                  param_id,
                             BsePropertyCandidates *pc,
                             GParamSpec            *pspec)
  BseWaveOsc *self = BSE_WAVE_OSC (item);
  switch (param_id)
      BseProject *project;
    case PARAM_WAVE:
      bse_property_candidate_relabel (pc, _("Available Waves"), _("List of available waves to choose as oscillator source"));
      project = bse_item_get_project (item);
      if (project)
          BseWaveRepo *wrepo = bse_project_get_wave_repo (project);
          bse_item_gather_items_typed (BSE_ITEM (wrepo), pc->items, BSE_TYPE_WAVE, BSE_TYPE_WAVE_REPO, FALSE);
      G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);

The idea is that an object that has a property which can be set to an object
usually knows which possible object can be choosen. This gives an easy to
use interface for cases like the wave oscillator, where the user can choose
the wave to be played by the wave oscillator in a dropdown box.

However, since in the case of the script, there is no object the script is
associated with, and there is therefore no get_candidates function that can
be called, the (bse-param-part ...) specification will get an empty dropdown

Before trying to implement a mechanism that can be used for object-less
procedures to supply candidates, I think its a good idea to look at how
the ideal interface would be:

* The "ideal" interface

I've looked at what Cubase 5 does. It seems to be pretty intuitive to me.  As
long as the selection tool is active (there are other tools):

Part Selection:
 - clicking on a part selects it
 - clicking on a part while one or more parts are already selected:
   - selects it an deselects the other parts if no modifier is used
   - selects it and the other part if shift is used
 - a frame around parts can be drawn, to select them, similar to the way
   note selection works in beast
 - selected parts have a red frame

Moving/Copying/Linking (Shared Copy):
 - the selected parts can be moved by dragging them with the mouse similar
   to the way note movement works in beast
 - the selected parts can be copied by dragging them with the mouse if
   ALT is used; copy mode is indicated by drawing a + at the mouse cursor
 - the selected parts can be linked (thats what beast can do already),
   creating a "shared copy" in the cubase terminology by using SHIFT and
   ALT while dragging
 - shared copys are drawn with an italic font for the part name, normal copys
   with a normal font 

I think for making arrangement more convenient, the best way to go would be to
implement part selection and dragging similar to what Cubase 5 does, as this
would result in a much more convenient interface that doing it with a script.

However, if this takes a long time, we can still add the script as temporary

   Cu... Stefan
Stefan Westerfeld, Hamburg/Germany,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]