<commit_before>import {ADD_CHANNEL,
        ADD_CHANNEL_EFFECT,
        ADD_CHANNEL_SOURCE,
        MOVE_CHANNEL_EFFECT_DOWN,
        MOVE_CHANNEL_EFFECT_UP,
        REMOVE_CHANNEL_EFFECT,
        REMOVE_CHANNEL_SOURCE,
        REMOVE_CHANNEL,
        UPDATE_SELECTED_ADD_EFFECT,
        UPDATE_SELECTED_ADD_SOURCE} from '../actions';

export const emptyChannel = {effects: [],
                             selectedAddEffect: 'pingPongDelay',
                             selectedAddSource: 'detuned',
                             sources: []};

export const defaultChannel = {effects: ['pingPongDelay'],
                               selectedAddEffect: 'pingPongDelay',
                               selectedAddSource: 'detuned',
                               sources: ['sine']};

export const initialState = [{...defaultChannel, sources: ['detuned']},
                             defaultChannel];

export default (state = initialState, {type, value}) => {
  switch (type) {
    case ADD_CHANNEL:
      return [...state,
              emptyChannel];
    case ADD_CHANNEL_SOURCE: {
      const {channelId, source} = value;
      const channel = state[channelId];
      const {sources} = channel;
      return [...state.slice(0, channelId),
              {...channel, sources: [...sources, source]},
              ...state.slice(channelId + 1)];
    }
    case ADD_CHANNEL_EFFECT: {<commit_msg>fix selectedAddSource from detuned to fm<commit_after>import {
  ADD_CHANNEL,
  ADD_CHANNEL_EFFECT,
  ADD_CHANNEL_SOURCE,
  MOVE_CHANNEL_EFFECT_DOWN,
  MOVE_CHANNEL_EFFECT_UP,
  REMOVE_CHANNEL_EFFECT,
  REMOVE_CHANNEL_SOURCE,
  REMOVE_CHANNEL,
  UPDATE_SELECTED_ADD_EFFECT,
  UPDATE_SELECTED_ADD_SOURCE,
} from '../actions';

export const emptyChannel = {effects: [],
                             selectedAddEffect: 'pingPongDelay',
                             selectedAddSource: 'detuned',
                             sources: []};

export const defaultChannel = {effects: ['pingPongDelay'],
                               selectedAddEffect: 'pingPongDelay',
                               selectedAddSource: 'fm',
                               sources: ['sine']};

export const initialState = [{...defaultChannel, sources: ['detuned']},
                             defaultChannel];

export default (state = initialState, {type, value}) => {
  switch (type) {
    case ADD_CHANNEL:
      return [...state,
              emptyChannel];
    case ADD_CHANNEL_SOURCE: {
      const {channelId, source} = value;
      const channel = state[channelId];
      const {sources} = channel;
      return [...state.slice(0, channelId),
              {...channel, sources: [...sources, source]},
              ...state.slice(channelId + 1)];
    }
    case ADD_CHANNEL_EFFECT: {
{'fraction_non_alphanumeric': 0.1080592699674738, 'fraction_numerical': 0.0014456089627755693, 'mean_word_length': 1.9635974304068522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7029004', 'n_tokens_mistral': 757, 'n_tokens_neox': 751, 'n_words': 157}