Skip to content

Commit

Permalink
For issue #100, added current tick value to each output event and to …
Browse files Browse the repository at this point in the history
…the ringbuffer data, seems to work, need further verification.
  • Loading branch information
ahlstromcj committed Sep 7, 2022
1 parent c510578 commit 894efb2
Show file tree
Hide file tree
Showing 11 changed files with 332 additions and 69 deletions.
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision: 0.96.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Seq66 0.99.0.
# Generated by GNU Autoconf 2.69 for Seq66 0.99.1.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Seq66'
PACKAGE_TARNAME='seq66'
PACKAGE_VERSION='0.99.0'
PACKAGE_STRING='Seq66 0.99.0'
PACKAGE_VERSION='0.99.1'
PACKAGE_STRING='Seq66 0.99.1'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1446,7 +1446,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Seq66 0.99.0 to adapt to many kinds of systems.
\`configure' configures Seq66 0.99.1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1521,7 +1521,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Seq66 0.99.0:";;
short | recursive ) echo "Configuration of Seq66 0.99.1:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1665,7 +1665,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Seq66 configure 0.99.0
Seq66 configure 0.99.1
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2155,7 +2155,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Seq66 $as_me 0.99.0, which was
It was created by Seq66 $as_me 0.99.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -3090,7 +3090,7 @@ fi

# Define the identity of the package.
PACKAGE='seq66'
VERSION='0.99.0'
VERSION='0.99.1'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -21224,7 +21224,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Seq66 $as_me 0.99.0, which was
This file was extended by Seq66 $as_me 0.99.1, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -21290,7 +21290,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Seq66 config.status 0.99.0
Seq66 config.status 0.99.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
Binary file modified contrib/midi/simpleblastbeat.midi
Binary file not shown.
3 changes: 2 additions & 1 deletion libseq66/include/play/sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,8 @@ class sequence
midibyte status, midibyte cc, int divide, bool linked = false
);
bool change_ppqn (int p);
void put_event_on_bus (event & ev);
// void put_event_on_bus (event & ev);
void put_event_on_bus (event ev);
void reset_loop ();
void set_trigger_offset (midipulse trigger_offset);
void adjust_trigger_offsets_to_length (midipulse newlen);
Expand Down
4 changes: 3 additions & 1 deletion libseq66/src/midi/jack_assistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ jack_dummy_callback (jack_nframes_t nframes, void * arg)
int
jack_transport_callback (jack_nframes_t /*nframes*/, void * arg)
{
jack_assistant * j = static_cast<jack_assistant *>(arg);
jack_assistant * j = reinterpret_cast<jack_assistant *>(arg);
if (not_nullptr(j))
{
jack_position_t pos;
Expand Down Expand Up @@ -1840,6 +1840,8 @@ jack_assistant::show_position (const jack_position_t & pos)

/**
* A member wrapper function for the new free function create_jack_client().
* This function is used for creating a JACK transport client and a JACK
* sequencer (MIDI) client.
*
* \param name
* Provides the name of the client, used in the call to
Expand Down
6 changes: 5 additions & 1 deletion libseq66/src/play/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5547,7 +5547,8 @@ sequence::to_string () const
*/

void
sequence::put_event_on_bus (event & ev)
// sequence::put_event_on_bus (event & ev)
sequence::put_event_on_bus (event ev)
{
midibyte note = ev.get_note();
bool skip = false;
Expand All @@ -5563,7 +5564,10 @@ sequence::put_event_on_bus (event & ev)
--m_playing_notes[note];
}
if (! skip)
{
ev.set_timestamp(m_parent->get_tick()); /* issue #100 */
master_bus()->play_and_flush(m_true_bus, &ev, midi_channel(ev));
}
}

/**
Expand Down
5 changes: 3 additions & 2 deletions seq_rtmidi/include/midi_jack_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2017-01-02
* \updates 2022-02-18
* \updates 2022-09-06
* \license See above.
*
* GitHub issue #165: enabled a build and run with no JACK support.
Expand Down Expand Up @@ -147,7 +147,8 @@ struct midi_jack_data

bool valid_buffer () const
{
return not_nullptr(m_jack_buffsize) && not_nullptr(m_jack_buffmessage);
return not_nullptr(m_jack_buffmessage);
/* not_nullptr(m_jack_buffsize) && */
}

#if defined SEQ66_MIDI_PORT_REFRESH
Expand Down
36 changes: 35 additions & 1 deletion seq_rtmidi/include/midi_jack_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* \library seq66 application
* \author Chris Ahlstrom
* \date 2017-01-01
* \updates 2022-06-24
* \updates 2022-09-06
* \license See above.
*
* We need to have a way to get all of the JACK information of
Expand Down Expand Up @@ -97,6 +97,30 @@ class midi_jack_info final : public midi_info

jack_client_t * m_jack_client;

/**
* jack_nframes_t jack_get_buffer_size(jack_client_t *)
*
* Returns the current maximum size that is passed to the process callback.
* It should only be used before the client has been activated.
* This size may change, clients that depend on it must register a
* bufsize callback to be notified if it does.
*
* Part of issue #100.
*/

jack_nframes_t m_jack_buffer_size;

/**
* jack_nframes_t jack_get_sample_rate(jack_client_t *)
*
* Returns the sample rate of the JACK system as set by the user when jackd
* started.
*
* Part of issue #100.
*/

jack_nframes_t m_jack_sample_rate;

public:

midi_jack_info () = delete;
Expand All @@ -112,6 +136,16 @@ class midi_jack_info final : public midi_info
return m_jack_client;
}

int jack_buffer_size () const
{
return int(m_jack_buffer_size);
}

int jack_sample_rate () const
{
return int(m_jack_sample_rate);
}

virtual bool api_get_midi_event (event * inev) override;
virtual bool api_connect () override;
virtual int api_poll_for_midi () override;
Expand Down
17 changes: 16 additions & 1 deletion seq_rtmidi/include/rtmidi_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* \library seq66 application
* \author Gary P. Scavone; severe refactoring by Chris Ahlstrom
* \date 2016-11-20
* \updates 2022-06-30
* \updates 2022-09-07
* \license See above.
*
* The lack of hiding of these types within a class is a little to be
Expand All @@ -50,6 +50,12 @@

#define SEQ66_RTMIDI_VERSION "2.1.1" /* the revision at fork time */

/*
* EXPERIMENTAL. Doesn't break playback !
*/

#define USE_ISSUE_100_FIX

/*
* Do not document the namespace; it breaks Doxygen.
*/
Expand Down Expand Up @@ -156,6 +162,11 @@ class midi_message
public:

midi_message (double ts = 0.0);
midi_message (const midibyte * mbs, size_t sz);

static midipulse extract_timestamp (const midibyte * mbs, size_t sz);

void copy (midibyte * mbs, size_t sz);

midibyte & operator [] (size_t i)
{
Expand Down Expand Up @@ -194,6 +205,10 @@ class midi_message
m_bytes.push_back(b);
}

bool push_timestamp (midipulse b);
midipulse pop_timestamp ();
midipulse extract_timestamp () const;

double timestamp () const
{
return m_timestamp;
Expand Down
Loading

0 comments on commit 894efb2

Please sign in to comment.