summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_source.cc
AgeCommit message (Collapse)Author
2009-07-21Fix some unused parameter warnings.Carl Hetherington
git-svn-id: svn://localhost/ardour2/branches/3.0@5403 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-07The great audio processing overhaul.David Robillard
The vast majority of Route signal processing is now simply in the list of processors. There are definitely regressions here, but there's also a lot of things fixed. It's far too much work to let diverge anymore regardless, so here it is. The basic model is: A route has a fixed set of input channels (matching its JACK input ports and diskstream). The first processor takes this as input. The next processor is configured using the first processor's output as input, and is allowed to choose whatever output it wants given that input... and so on, and so on. Finally, the last processor's requested output is used to set up the panner and create whatever Jack ports are needed to output the data. All 'special' internal processors (meter, fader, amp, insert, send) are currently transparent: they read any input, and return the same set of channels back (unmodified, except for amp). User visible changes: * LV2 Instrument support (tracks with both MIDI and audio channels) * MIDI in/out plugin support * Generic plugin replication (for MIDI plugins, MIDI/audio plugins) * Movable meter point Known Bugs: * Things seem to get weird on loaded sessions * Output delivery is sketchy * 2.0 session loading was probably already broken... but it's definitely broken now :) Please test this and file bugs if you have any time... git-svn-id: svn://localhost/ardour2/branches/3.0@5055 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-04Fix MIDI recording.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5039 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-01Fix MIDI playback.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5024 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-30Missed one...David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@5023 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-04-14SMFSource / MIDISource: more readable variable names in ↵Hans Baier
read/write(_unlocked), added debugging output to diagnose recording bug (MIDI recording stops receiving events after a short while) git-svn-id: svn://localhost/ardour2/branches/3.0@4974 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25*** NEW CODING POLICY ***David Robillard
All #include statements that include a header that is a part of a library bundled with ardour MUST use quotes, not angle brackets. Do this: #include "ardour/types.h" NOT this: #include <ardour/types.h> Rationale: This is best practice in general, to ensure we include the local version and not the system version. That quotes mean "local" (in some sense) and angle brackets mean "system" (in some sense) is a ubiquitous convention and IIRC right in the C spec somewhere. More pragmatically, this is required by (my) waf (stuff) for dependencies to work correctly. That is: !!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!! Failure to comply is punishable by death by torture. :) P.S. It's not that dramatic in all cases, but this (in combination with some GCC flags specific to the include type) is the best way I have found to be absolutely 100% positive the local ones are being used (and we definitely want to be absolutely 100% positive on that one). git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-20Make source length a dynamic thing.David Robillard
Update MIDI region length (actually and visually) when position changes. git-svn-id: svn://localhost/ardour2/branches/3.0@4644 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Introduce new time for session-relative frame time, and make source ↵David Robillard
interface capable of handling 64-bit long sessions. sframes_t is "session frames". The rules for time stamps are: - Anything relative to transport time, session position, etc, should be sframes_t - Anything relative to jack cycles, including the length thereof, should be nframes_t To support sessions which exceed UINT32_MAX frames, we need to replace all the uses of nframes_t for session time with sframes_t, and make sure the conversions are sound. This does not depend on jack's nframes_t; that we are using the same type at all right now was an oops. This is also be kinda nice for readability since the two different time bases have different types... git-svn-id: svn://localhost/ardour2/branches/3.0@4636 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-19Interpret tempo time based on read position (not source timeline position ↵David Robillard
which is more or less meaningless). Move time conversion into the region view rather than the source. Adapt MIDI (including controllers) regions to the destination tempo when moved (e.g. dragging a region to a location with half the tempo will make the notes twice as long). git-svn-id: svn://localhost/ardour2/branches/3.0@4635 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix deadlock and potential race condition when editing MIDI.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4614 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-17Fix the horrible mess that was anything related to sources and paths.David Robillard
Most significant changes: - Factor out FileSource from AudioFileSource, use for SMFSource too - Explicitly pass embedded rather than mysterious name mangling or whatever - Destroy a ton of duplicated or very-nearly-duplicated code - Clean up and document all that weird source stuff in session.cc git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move duplicated AudioFileSource::Flags and SMFSource::Flags into Source.David Robillard
Clean up source stuff. git-svn-id: svn://localhost/ardour2/branches/3.0@4605 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-16Move all beats <-> frames time conversion into a single object that can be ↵David Robillard
passed around. This has 3 main benefits: - All conversion code is in one place (less duplication, potential bugs) - The conversion method can be passed to things that are ignorant of the actual time units involved, information required, etc. (In the future it would be nice to have user selectable tempo/frame time) - It should be relatively simple now to support tempo changes part-way through a MIDI region (at least architecturally speaking) git-svn-id: svn://localhost/ardour2/branches/3.0@4594 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Fix genererally retarded and broken note range / diskstream display / etc. ↵David Robillard
related things (correctly display region contents on initial session load). git-svn-id: svn://localhost/ardour2/branches/3.0@4583 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15The Big Change: Store time in MidiModel as tempo time, not frame time.David Robillard
The time stamp of an event is now always tempo, from file to model and back again. Frame time is only relevant at playback or recording time, in the audio thread (MidiModel and MidiBuffer). I think perhaps we don't need to change the actual time from double (which is convenient for math), it is the time base conversion that caused problems. Using a correct equality comparison (i.e. not == which is not correct for floating point) should probably make the undo issues go away, in 99.99% of cases anyway. There's almost certainly some regressions in here somewhere, but they do not seem to be time related. The bugs I'm hitting in testing are old ones that seem unrelated now, so it's checkpoint time. This sets us up for fancy things like tempo map import and tempo/meter changes halfway through MIDI regions, but for now it's still assumed that the tempo at the start of the region is valid for the duration of the entire region. git-svn-id: svn://localhost/ardour2/branches/3.0@4582 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-15Use nframes_t for timestamps of real (jack) time MIDI events (i.e. in ↵David Robillard
MidiBuffer and MidiRingBuffer). Use iterator interface of Sequence to read events in a MIDISource rather than Sequence::read, avoiding timestamp confusion. Disable no longer useful Sequence::read. git-svn-id: svn://localhost/ardour2/branches/3.0@4570 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-02Make (MIDI) event time stamp type a template parameter.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@4473 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-01-28* MIDI control lanes: Set Interpolationtype according to ParameterHans Baier
git-svn-id: svn://localhost/ardour2/branches/3.0@4452 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-30Separate low level details of SMF reading/writing from concept of 'midi ↵David Robillard
source in ardour'. git-svn-id: svn://localhost/ardour2/branches/3.0@3839 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-09-19Factor out sequencing related things into an independant new library: "evoral".David Robillard
Anything related to the storage of events/values over a range of time lives in evoral. This includes MidiModel (Evoral::Sequence) and automation data (AutomationList (Evoral::ControlList), Automatable (Evoral::ControlSet), etc). libs/evoral synced with http://svn.drobilla.net/lad/trunk/evoral r1511. git-svn-id: svn://localhost/ardour2/branches/3.0@3754 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02rollback to 3428, before the mysterious removal of libs/* at 3431/3432Paul Davis
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02remove empty sigc++2 directoryDoug McLain
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-05-16Tidy up MIDI debugging output.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@3358 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-11* persistent undo for MIDI edits works nowHans Baier
* fixed bug: dragging of notes beyond left region bounds made it disappear (unsigned int wrap around) git-svn-id: svn://localhost/ardour2/branches/3.0@3249 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-09* implemented persistent undo for MidiModel::DeltaCommand. Deserializing ↵Hans Baier
works, but weirdly has no effect when undo/redo is applied in the editor git-svn-id: svn://localhost/ardour2/branches/3.0@3240 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-08* fixed bug: MIDI region did not sound if its position was less than its ↵Hans Baier
start offset git-svn-id: svn://localhost/ardour2/branches/3.0@3239 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-03* implemented editing velocities (http://tracker.ardour.org/view.php?id=2148)Hans Baier
* added MIDI panic button (http://tracker.ardour.org/view.php?id=2118) * bugfix: moving notes above midi 127 or below 0 does not wrap around anymore * bugfix: deadlock on editing notes after playback (http://tracker.ardour.org/view.php?id=2140) due to unbalanced lock acquire/release * bugfix: First note off lost in playback (http://tracker.ardour.org/view.php?id=2132) * bugfix: Last note off lost in saving MIDI files (http://tracker.ardour.org/view.php?id=2132) * bandaid fix for http://tracker.ardour.org/view.php?id=1985 (Cannot reopen session because jack ports are not unregistered on session close) * bandaid fix: replaced conf.CheckPKGExists ('\"slv2 >= 0.6.0\"') by conf.CheckPKGExists ('slv2') in SConstruct, because the former would fail, even if SLV 0.6.0 was installed * added/enabled debugging output for debugging MIDI model (might be removed later) git-svn-id: svn://localhost/ardour2/branches/3.0@3211 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-02-02Merge with trunk R2978.David Robillard
git-svn-id: svn://localhost/ardour2/branches/3.0@2988 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-10-07Fix several MIDI timestamp related problems:David Robillard
Fix recording MIDI regions that start at t != 0. Fix display of MIDI events in regions that start at t != 0. Fix recording after relocating an already rec-armed MIDI track. git-svn-id: svn://localhost/ardour2/trunk@2528 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-16Make SMFSource suck significantly less.David Robillard
Read from MidiRingbuffer directly into model, don't read MidiRingBuffer into a new midi buffer, then into the model. Pass rec data to UI via model instead of a separate buffer. Read MIDI CC data into MidiModel (though not actually used yet). Made quantization toggle edited flag so model is saved. git-svn-id: svn://localhost/ardour2/trunk@2308 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Saving of edited MIDI data to disk (on session save).David Robillard
Seems to be a pretty random problem with note duration restoring though... git-svn-id: svn://localhost/ardour2/trunk@2290 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-11Fix MIDI file names on recording (don't write out a ton of useless empty ↵David Robillard
.mid files). Preliminary hooks for writing model to file (still does nothing). git-svn-id: svn://localhost/ardour2/trunk@2289 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-08-01Fix note delete crash bug.David Robillard
Fix midi recording crash bug. git-svn-id: svn://localhost/ardour2/trunk@2216 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-31Get MidiRegionView's hands on MidiModel for editing operations to come.David Robillard
MIDI select rectangle. Add notes on a proper click only (not mouse down). Fix crash when dragging from region to outside region. git-svn-id: svn://localhost/ardour2/trunk@2196 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-28Playback from MIDI model, playback of clicked-in events.David Robillard
Note the diskstream chunk size affects reading of clicked-in, so you may need to seek away and back again to have new events read (this will be fixed). git-svn-id: svn://localhost/ardour2/trunk@2183 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-17Midi pencil undo (not yet serializable).David Robillard
Formatting fixes for session.h (ie kill more of those damned 8 space expanded tabs). git-svn-id: svn://localhost/ardour2/trunk@2135 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-07-15Selection of visible note range (full range vs fit contents, selectable from ↵David Robillard
midi track menu). Added note pencil tool, mock note adding (notes can be added visually but don't yet play). Reworked MidiModel to be notes w/ duration instead of realtime style MIDI events. Moved layering (stacked/overlaid) from auto time axis down to route time axis since it applies to MIDI tracks as well. git-svn-id: svn://localhost/ardour2/trunk@2128 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-06-07Fixed MIDI crash bug.David Robillard
Added some asserts to gtkmm2ext that hopefully may catch a bug I might have possibly seen once or twice, probably. Fixed uninitialized value in time_axis_view.cc. git-svn-id: svn://localhost/ardour2/trunk@1958 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-05-03optimize some performance bottlenecks; remove jack_nframes_t that crept back ↵Paul Davis
into the code git-svn-id: svn://localhost/ardour2/branches/midi@1779 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-09-19Merged with trunk R920.David Robillard
git-svn-id: svn://localhost/ardour2/branches/midi@921 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-23- Fixes for some recording bugsDavid Robillard
- Working MIDI playback - Various SMF fixes - Loading of MIDI containing sessions w/o clobbering .mid files - Varispeed MIDI fixes (still no reverse though) - Fix for crazy rec-region sizes - Throttled MIDI diskstream flush based on time passed (related to rec-region fix) - Fixed playback of MIDI regions not positioned at origin (time stamp translation) - Commented/removed old debug print statements (though some still remain) git-svn-id: svn://localhost/ardour2/branches/midi@844 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-21Recording to SMF. Playback not quite working yet, just some buglets left to ↵David Robillard
iron out. git-svn-id: svn://localhost/ardour2/branches/midi@841 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-14More solid "fake" recording and serializationDavid Robillard
git-svn-id: svn://localhost/ardour2/branches/midi@825 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-14- MIDI "recording" - rec region creation/drawing, actual MIDI region ↵David Robillard
creation/view/pretty pictures/etc - MIDI containing session saving and restoring (ie XML - Source, Region, Playlist; all but the actual .mid files) - Numerous little fixes for audio specific stuff to accomplish the above - Dirty hacks to accomplish the above - Profit!!! git-svn-id: svn://localhost/ardour2/branches/midi@821 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-11- Changed IO's vector<Port*>'s to PortListDavid Robillard
- Added new Port classes, code to drive them - Added PortList, which is a filthy mess ATM (nevermind that, it's the interface that's important at this stage) - Added ChanCount, though it isn't very thoroughly used yet. That's the next step.... - Fixed a few bugs relating to loading sessions saved with trunk - Fixed a few random other bugs Slowly working towards type agnosticism while keeping all the former code/logic intact is the name of the game here Warning: Removing ports is currently (intentionally) broken due solely to laziness. git-svn-id: svn://localhost/ardour2/branches/midi@786 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-06-26Actually added the code mentioned in my last commit. Whoops.David Robillard
git-svn-id: svn://localhost/ardour2/branches/midi@643 d708f5d6-7413-0410-9779-e7cbd77b26cf