Subject: Re: [ecasound] How to start a chain in a certain position?
From: Jeremy Hall (jhall_AT_uu.net)
Date: Tue Jan 29 2002 - 20:46:03 EET
I like the Locations model where the definition of a location is:
class Location : public SigC::Object, public Stateful
{
public:
enum Flags {
IsMark = 0x1,
IsAutoPunch = 0x2,
IsAutoLoop = 0x4,
IsHidden = 0x8,
IsCDMarker = 0x10
};
Location (nframes_t sample_start,
nframes_t sample_end,
const string &name,
Flags bits = Flags(0))
: _name (name),
_start (sample_start),
_end (sample_end),
_flags (bits) { }
Location () {
_start = 0;
_end = 0;
_flags = 0;
}
nframes_t start() { return _start; }
nframes_t end() { return _end; }
nframes_t length() { return _end - _start; }
int set_start (nframes_t s);
int set_end (nframes_t e);
int set (nframes_t start, nframes_t end);
const string& name() { return _name; }
void set_name (const string &str) { _name =
str; name_changed(this); }
void set_auto_punch (bool yn, void *src);
void set_auto_loop (bool yn, void *src);
void set_hidden (bool yn, void *src);
void set_cd (bool yn, void *src);
bool is_auto_punch () { return _flags & IsAutoPunch; }
bool is_auto_loop () { return _flags & IsAutoLoop; }
bool is_mark () { return _flags & IsMark; }
bool is_hidden () { return _flags & IsHidden; }
bool is_cd_marker () { return _flags & IsCDMarker; }
SigC::Signal1<void,Location*> name_changed;
SigC::Signal1<void,Location*> end_changed;
SigC::Signal1<void,Location*> start_changed;
SigC::Signal2<void,Location*,void*> FlagsChanged;
/* this is sent only when both start&end change at the same time
*/
SigC::Signal1<void,Location*> changed;
XMLNode *get_state (void);
int set_state (const XMLNode *);
private:
string _name;
nframes_t _start;
nframes_t _end;
unsigned long _flags;
void set_mark (bool yn);
bool set_flag_internal (bool yn, Flags flag);
};
A ``Mark'' is a single point in time, where _start and _end are the
same. A CD marker could be used to denote track boundaries should we wish
to export an ecasound session into separate cd-track-sized files. (the
mixed session that is)
Having locations that are both cmdline-configurable and saveable makes out
for a good thing. The cs-goto Location::name() would be nice, for
example. We already have the autoloop idea going.
interesting methods of Locations could be
Location *first_location_before (nframes_t);
Location *first_frame_after(nframes_t);
just an idea.
_J
In the new year, Kai Vehmanen wrote:
> Answering to on old message...
>
> On Thu, 18 Oct 2001, janne halttunen wrote:
>
> > Okay, what about if you have a song almost prepared, but it lacks, say,
> > something like a guitar solo? So, you have a perfect spot for it, but you
> > have difficulties in getting into the groove immediatly after you
> > pushed the start-button. You perhaps want to jam a bit with the song,
> > before going to the hot spot? Ok, you could edit the crap out
>
> I've been thinking about replacing all the various position-offset
> mechanisms (ewf, -y, the few proposed new ideas) with special locator
> objects.
>
> The basic idea is to have special audio object types (just like the
> recently added 'typeselect' and 'reverse'). For instance:
>
> # a 10sec long input, the audio data is taken from
> # from 'foo.wav', range 20sec->30sec (start=20,length=10)
> -i:select_range,foo.wav,20,10
>
> # a 10sec long output, all audio data goes to
> # 'foo.wav', replacing old data in the 20->30sec range
> -o:select_range,foo.wav,20,10
>
> # unlike with 'select_range', lenght matches the
> # total lenght of 'foo.wav'; but unlike a normal
> # output, only the range '20sec->30sec' is
> # written to, other areas are in a sense write-proceted
> # this could be used for punch-in recording with
> # a lead-in time... ("setpos 15 ; start" to get 5secs
> # of time to prepare)
> -o:select_punchin,foo.wav,20,10
>
> And possibly other types of objects (select_offset, select_loop, etc). I
> haven't had time to develop the concept further, but the above examples
> should describe the basic idea.
>
> Compared to current mechanisms, there are a number of advantages:
>
> - no need for separate files like with .ewf, everything
> is configurable from the command-line
> - seeking with various setpos commands don't confuse
> the system
> - fits nicely to the ecasound framework, no need for new
> file formats or new special options
> - makes it easier for frontend programs to offer
> easy to use looping, offseting and punch-in recording
> (they don't need to know how to write ewf files)
>
> Comments?
>
> --
> http://www.eca.cx
> Audio software for Linux!
>
> --
> To unsubscribe send message 'unsubscribe' in the body of the
> message to <ecasound-list-request_AT_wakkanet.fi>.
>
-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request_AT_wakkanet.fi>.
This archive was generated by hypermail 2b28 : Tue Jan 29 2002 - 20:36:32 EET